Cruise Control.Net 1.5 + Visual Source Safe + MSBuild.exe - cruisecontrol.net

I am trying Cruise Control.net 1.5 integrate to Visual Source Safe.
Could any one share with me step by step (configuration for Build+Email+Triggers+Publish)to do cruise control.net with Visual Source safe.
Thanks in advance...

Have you looked at "How to Hook Up a VS.NET 2005 Solution with CruiseControl.NET in a few minutes." ?
The configuration file (for vss) looks like this:
<cruisecontrol>
<project name="Johans Test System">
<sourcecontrol type="vss" autoGetSource="true" applyLabel="true">
<executable>C:\Program Files\Microsoft Visual SourceSafe\ss.exe</executable>
<project>$/JohansTestSystem.root</project>
<username>Johan</username>
<password></password>
<ssdir>c:\vss\</ssdir>
<workingDirectory>C:\CI\</workingDirectory>
<cleanCopy>true</cleanCopy>
</sourcecontrol>
<triggers>
<intervalTrigger seconds="60" />
</triggers>
<tasks>
<msbuild>
<executable>C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe</executable>
<workingDirectory>c:\CI\JohansTestSystem</workingDirectory>
<projectFile>JohansTestSystem.sln</projectFile>
<buildArgs>/noconsolelogger /p:Configuration=Debug /v:diag</buildArgs>
<targets>Build</targets>
<timeout>15</timeout>
<logger>ThoughtWorks.CruiseControl.MsBuild.XmlLogger,ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
<nunit path="C:\nunit\bin\nunit-console.exe">
<assemblies>
<assembly>C:\CI\JohansTestSystem\Johan.Test\bin\Debug\Johan.Test.dll</assembly>
</assemblies>
</nunit>
</tasks>
<publishers>
<xmllogger />
</publishers>
</project>
</cruisecontrol>
Email blocks documentation is pretty straightforward.
Here is CruiseControl.NET's example:
1<email mailport="25" includeDetails="TRUE" mailhostUsername="smtpuser" mailhostPassword="smtppassword" useSSL="FALSE">
2 <from>buildmaster#mycompany.com</from>
3 <mailhost>smtp.mycompany.com</mailhost>
4 <users>
5 <user name="BuildGuru" group="buildmaster" address="buildguru#mycompany.com" />
6 <user name="JoeDeveloper" group="developers" address="joedeveloper#thoughtworks.com" />
7 </users>
8 <groups>
9 <group name="developers">
10 <notifications>
11 <notificationType>Failed</notificationType>
12 <notificationType>Fixed</notificationType>
13 </notifications>
14 </group>
15 <group name="buildmaster">
16 <notifications>
17 <notificationType>Always</notificationType>
18 </notifications>
19 </group>
20 </groups>
21 <converters>
22 <regexConverter find="$" replace="#TheCompany.com" />
23 </converters>
24 <modifierNotificationTypes>
25 <NotificationType>Failed</NotificationType>
26 <NotificationType>Fixed</NotificationType>
27 </modifierNotificationTypes>
28 <subjectSettings>
29 <subject buildResult="StillBroken" value="Build is still broken for {CCNetProject}" />
30 </subjectSettings>
31 <xslFiles>
32 <file>xsl\header.xsl</file>
33 <file>xsl\compile.xsl</file>
34 <file>xsl\unittests.xsl</file>
35 <file>xsl\modifications.xsl</file>
36 </xslFiles>
37 <attachments>
38 <file>C:\Data\AFile.txt</file>
39 <file>Relative.txt</file>
40 </attachments>
41</email>
and of course if you want to send via gmail, that's cool too:
GMail For sending mail via gmail :
* mailhost="smtp.gmail.com"
* mailport="587"
* mailhostUsername="xxx.yyy#gmail.com"
* mailhostPassword="yourpassword"
* useSSL="TRUE"
You should probably also check out this SO thread about CC.NET email publishing:

Related

Parsing XML for sub children using using python

I am trying to parse the below XML to get the following data. There are multiple rules following, I have shared only one rule below. Is it possible to parse the XML for these values?
name from section header, rule id value, applied-to name, source names, source values, destination name, destination value.
<?xml version="1.0" encoding="UTF-8"?>
<filteredfirewallConfiguration timestamp="1621338984151">
<contextId>globalroot</contextId>
<layer3Sections>
<section id="asdfsdf" name="production" generationNumber="132" timestamp="1621930404081" managedBy="universalroot-0" tcpStrict="false" stateless="false" useSid="false" type="LAYER3">
<rule id="1213213" disabled="false" logged="true" managedBy="universalroot-0">
<name>From Conversion Server</name>
<action>allow</action>
<appliedToList>
<appliedTo>
<name>re-int-dx</name>
<value>universalwire</value>
<type>VirtualWire</type>
<isValid>true</isValid>
</appliedTo>
<appliedTo>
<name>re-ext-ap</name>
<value>universalwire</value>
<type>VirtualWire</type>
<isValid>true</isValid>
</appliedTo>
</appliedToList>
<sectionId>sfsdfafee</sectionId>
<sources excluded="false">
<source>
<name>sdfsdf101</name>
<value>ipset-werfwefdc</value>
<type>IPSet</type>
<isValid>true</isValid>
</source>
<source>
<name>sdfsfdf102</name>
<value>ipset-4wsetgfreds</value>
<type>IPSet</type>
<isValid>true</isValid>
</source>
</sources>
<destinations excluded="false">
<destination>
<name>production-database-cluster</name>
<value>sg</value>
<type>SecurityGroup</type>
<isValid>true</isValid>
</destination>
<destination>
<name>newname</name>
<value></value>
<type>IPSet</type>
<isValid>true</isValid>
</destination>
</destinations>
<services>
<service>
<name>servicenwe</name>
<value>application-dgfsdfg</value>
<type>Application</type>
<isValid>true</isValid>
</service>
</services>
<direction>inout</direction>
<packetType>any</packetType>
</rule>
sofar, I have been able to get the section header only.
import requests
import xml.etree.ElementTree as ET
tree = ET.parse("out.xml")
root = tree.getroot()
for child in root.find('./layer3Sections'):
print(child.tag, child.attrib)

Powershell command -- To add a attribute if not exist in a particular node of a XML

<APPPOOL APPPOOL.NAME="Classic" RuntimeVersion="v2.0" state="Started">
<add name="Classic" autoStart="true" managedRuntimeVersion="v2.0">
<APPPOOL APPPOOL.NAME="GetServiceDet" RuntimeVersion="v2.0" state="Started">
<add name="GetServiceDet" autoStart="true">
my file has many line begining with word "add name".
I want to check if these lines have a string "managedRuntimeVersion".
if not exists, then i need to add managedRuntimeVersion="v2.0" to
that line.
Expected Result as below
<APPPOOL APPPOOL.NAME="Classic" RuntimeVersion="v2.0" state="Started">
<add name="Classic" autoStart="true" managedRuntimeVersion="v2.0">
<APPPOOL APPPOOL.NAME="GetServiceDet" RuntimeVersion="v2.0" state="Started">
<add name="GetServiceDet" autoStart="true" managedRuntimeVersion="v2.0">
I have tried with the below script.. but in the result.. it is given only the lines having "add name"
$sfile="C:\Users\subash.s\Desktop\backup\pool.xml"
(((gc "$sfile") | Select-String -Pattern "add name" |
select-string -notmatch "managedRuntimeVersion") -replace '>',' managedRuntimeVersion="v2.0">') |
Set-Content "$sfile"
with the above script. i got below result..
<add name="Classic" autoStart="true" managedRuntimeVersion="v2.0">
<add name="GetServiceDet" autoStart="true" managedRuntimeVersion="v2.0">
For Pete's sake, the configuration file is XML, not a text file! Edit it as an XML document, and you will save a lot of headaches.
There are a few ways to add attributes into such a document. As the XML in the question is a fragment - and of illegal syntax, the sample code uses a bit modified version of the same. Select all add nodes that don't have got managedRuntimeVersion attribute, create one and add attribute with values to the nodes. Like so,
# Dummy data for testing
[xml]$x = #'
<root>
<APPPOOL APPPOOL.NAME="GetServiceDet" RuntimeVersion="v2.0" state="Started">
<add name="GetServiceDet2" autoStart="true"/>
</APPPOOL>
<APPPOOL APPPOOL.NAME="Classic" RuntimeVersion="v2.0" state="Started">
<add name="Classic" autoStart="true" managedRuntimeVersion="v2.0" />
</APPPOOL>
<APPPOOL APPPOOL.NAME="GetServiceDet" RuntimeVersion="v2.0" state="Started">
<add name="GetServiceDet" autoStart="true"/>
</APPPOOL>
</root>
'#
# Select all add elements that don't have managedRuntimeVersion attribute
$nl=$x.SelectNodes('/root/APPPOOL/add[not(#managedRuntimeVersion)]')
# Add attributes to the elements
foreach($n in $nl) {
# Create new attribute and assign a value
$a = $x.CreateAttribute('managedRuntimeVersion')
$a.Value = 'v2.0'
[void]$n.Attributes.Append($a)
}
# Print modified version to console
$x.save([console]::out)
# Output
<?xml version="1.0" encoding="ibm850"?>
<root>
<APPPOOL APPPOOL.NAME="GetServiceDet" RuntimeVersion="v2.0" state="Started">
<add name="GetServiceDet2" autoStart="true" />
</APPPOOL>
<APPPOOL APPPOOL.NAME="Classic" RuntimeVersion="v2.0" state="Started">
<add name="Classic" autoStart="true" managedRuntimeVersion="v2.0" />
</APPPOOL>
<APPPOOL APPPOOL.NAME="GetServiceDet" RuntimeVersion="v2.0" state="Started">
<add name="GetServiceDet" autoStart="true" managedRuntimeVersion="v2.0" />
</APPPOOL>
</root>
Reading the actual file and saving changes to disk are left as an exercise to the reader.

Xamarin Forms App crashing at startup on iOS

I am new to Xamarin and not sure what I am doing wrong. I have packaged an enterprise app and currently trying to deploy it as ipa package. The app crashes at startup with the following trace. Really not sure how to proceed and what is the core reason of the crash
Edit. Updated stack trace after disabling assembly linking:
Thread 0 name: tid_403 Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000018f2f7014 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000018f3bf450 pthread_kill + 112
2 libsystem_c.dylib 0x000000018f26b400 abort + 140
3 CrewConnectPlus.iOS 0x0000000100065604 mono_handle_native_sigsegv (mini-exceptions.c:2462)
4 libsystem_platform.dylib 0x000000018f3b9348 _sigtramp + 52
5 libsystem_pthread.dylib 0x000000018f3bf450 pthread_kill + 112
6 libsystem_c.dylib 0x000000018f26b400 abort + 140
7 CrewConnectPlus.iOS 0x00000001001682b0 print_all_exceptions(MonoObject*) (runtime.m:991)
8 CrewConnectPlus.iOS 0x00000001000a2398 mono_invoke_unhandled_exception_hook (exception.c:1108)
9 CrewConnectPlus.iOS 0x0000000100065298 mono_handle_exception_internal (mini-exceptions.c:1810)
10 CrewConnectPlus.iOS 0x0000000100064374 mono_handle_exception (mini-exceptions.c:2039)
11 CrewConnectPlus.iOS 0x000000010005cbbc mono_arm_throw_exception (exceptions-arm64.c:410)
12 CrewConnectPlus.iOS 0x000000010067c248 throw_exception + 168
13 CrewConnectPlus.iOS 0x0000000100405e08 System_AppDomain_Load_System_Reflection_AssemblyName_System_Security_Policy_Evidence + 1000
14 CrewConnectPlus.iOS 0x0000000100405960 System_AppDomain_Load_System_Reflection_AssemblyName + 32
15 CrewConnectPlus.iOS 0x0000000100457884 System_Reflection_Assembly_Load_System_Reflection_AssemblyName + 36
16 CrewConnectPlus.iOS 0x00000001024712f8 Xamarin_Forms_Xaml_XamlParser_GetElementType_Xamarin_Forms_Xaml_XmlType_System_Xml_IXmlLineInfo_System_Reflection_Assembly_Xamarin_Forms_Xaml_XamlParseException_ (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\XamlParser.cs:287)
17 CrewConnectPlus.iOS 0x00000001024687a0 Xamarin_Forms_Xaml_CreateValuesVisitor_Visit_Xamarin_Forms_Xaml_ElementNode_Xamarin_Forms_Xaml_INode (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\CreateValuesVisitor.cs:69)
18 CrewConnectPlus.iOS 0x0000000102463bac Xamarin_Forms_Xaml_ElementNode_Accept_Xamarin_Forms_Xaml_IXamlNodeVisitor_Xamarin_Forms_Xaml_INode (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\XamlNode.cs:178)
19 CrewConnectPlus.iOS 0x0000000102463b10 Xamarin_Forms_Xaml_ElementNode_Accept_Xamarin_Forms_Xaml_IXamlNodeVisitor_Xamarin_Forms_Xaml_INode (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\XamlNode.cs:173)
20 CrewConnectPlus.iOS 0x00000001024642a8 Xamarin_Forms_Xaml_RootNode_Accept_Xamarin_Forms_Xaml_IXamlNodeVisitor_Xamarin_Forms_Xaml_INode (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\XamlNode.cs:224)
21 CrewConnectPlus.iOS 0x0000000102462820 Xamarin_Forms_Xaml_XamlLoader_Visit_Xamarin_Forms_Xaml_RootNode_Xamarin_Forms_Xaml_HydratationContext (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\XamlLoader.cs:122)
22 CrewConnectPlus.iOS 0x0000000102462298 Xamarin_Forms_Xaml_XamlLoader_Load_object_string (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\XamlLoader.cs:80)
23 CrewConnectPlus.iOS 0x0000000102461fec Xamarin_Forms_Xaml_XamlLoader_Load_object_System_Type (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\XamlLoader.cs:57)
24 CrewConnectPlus.iOS 0x0000000102461f60 Xamarin_Forms_Xaml_Extensions_LoadFromXaml_TXaml_REF_TXaml_REF_System_Type (/C:\BuildAgent2\work\aad494dc9bc9783\Xamarin.Forms.Xaml\ViewExtensions.cs:37)
25 CrewConnectPlus.iOS 0x000000010016f4e0 CrewConnectPlus_Messages_InitializeComponent (/<unknown>:1)
26 CrewConnectPlus.iOS 0x000000010016f1e0 CrewConnectPlus_Messages__ctor (/<unknown>:1)
27 CrewConnectPlus.iOS 0x000000010016ee14 CrewConnectPlus_App_GoToMainPage (/<unknown>:1)
28 CrewConnectPlus.iOS 0x000000010016ed9c CrewConnectPlus_App_SetMainPage (/<unknown>:1)
29 CrewConnectPlus.iOS 0x000000010016ed58 CrewConnectPlus_App__ctor (/<unknown>:1)
30 CrewConnectPlus.iOS 0x000000010016cc10 CrewConnectPlus_iOS_AppDelegate_FinishedLaunching_UIKit_UIApplication_Foundation_NSDictionary (/<unknown>:1)
OK finally managed to get a hand on a physical device and went through the Apple hassle of creating a dev provisioning profile in order to debug the issue:
It seems that my main xaml document (Messages.xaml) cannot load a dependent one (APMHeader.xaml).
Messages.xaml is given by:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:apm="clr-namespace:CrewConnectPlus;assembly=CrewConnectPlus"
x:Class="CrewConnectPlus.Messages" Title="{Binding Title}" x:Name="BrowseItemsPage">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Sign All" Clicked="AddItem_Clicked" />
</ContentPage.ToolbarItems>
<ContentPage.Content>
<StackLayout>
<apm:APMHeader/>
<ListView x:Name="ItemsListView" ItemsSource="{Binding Items}" VerticalOptions="FillAndExpand" HasUnevenRows="true" RefreshCommand="{Binding LoadItemsCommand}" IsPullToRefreshEnabled="true" IsRefreshing="{Binding IsBusy, Mode=OneWay}" CachingStrategy="RecycleElement" ItemSelected="OnItemSelected">
<ListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Padding="10">
<Label Text="{Binding Text}" LineBreakMode="NoWrap" Style="{DynamicResource ListItemTextStyle}" FontSize="16" />
<Label Text="{Binding Description}" LineBreakMode="NoWrap" Style="{DynamicResource ListItemDetailTextStyle}" FontSize="13" />
</StackLayout>
</ViewCell>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage.Content>
</ContentPage>
And APMHeader is given by:
<?xml version="1.0" encoding="UTF-8"?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="CrewConnectPlus.APMHeader">
<ContentView.Content>
<StackLayout BackgroundColor="#25447A" HorizontalOptions="Fill" HeightRequest="100">
<Label Margin="10">
<Label.TextColor>Yellow</Label.TextColor>
<Label.Text>Anwar Ludin</Label.Text>
</Label>
<Label Margin="10">
<Label.TextColor>White</Label.TextColor>
<Label.Text>ALU</Label.Text>
</Label>
</StackLayout>
</ContentView.Content>
</ContentView>
And the error is:
Xamarin.Forms.Xaml.XamlParseException: Position 11:5. Type apm:APMHeader not found in xmlns clr-namespace:CrewConnectPlus;assembly=CrewConnectPlus
at Xamarin.Forms.Xaml.CreateValuesVisitor.Visit (Xamarin.Forms.Xaml.ElementNode node, Xamarin.Forms.Xaml.INode parentNode)
This works perfectly well on an Android device and the iPhone simulator. Not sure what is different on a physical device. I also checked that the output assembly name is CrewConnectPlus
I'm (very) late to this party, but the way you set properties looks weird.
Try changing:
<Label Margin="10">
<Label.TextColor>Yellow</Label.TextColor>
<Label.Text>Anwar Ludin</Label.Text>
</Label>
to
<Label Margin="10" TextColor="Yellow" Text="Anwar Ludin">
</Label>
Plus its more concise, so there's that.

Build a string in MSBuild as a concatenation of a base string n-times

I have a numer, "n" in a property in MSBuild. I also have a string "Str" that needs to be duplicated n-times to achieve a final string that is the repetition of "Str" n times.
Eg. If n is 3 and Str is "abc", what I want to obtain is "abcabcabc"
Since one cannot loop in MSBuild, I don't know how to achieve this. Perhaps with an item group, but how do I create one based on a property containing an "n" count?
Thanks!
To create a String repeated n times, you can also do this (at least in MSBuild Tools v4.0):
<SomeRepeatedString>$([System.String]::New("-", 40))</SomeRepeatedString>
usually for things like this I resolve to using inline C#, as it costs me less time than searching all over the internet to find a 'true' msbuild solution; here you go:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<MyString>abc</MyString>
<Count>3</Count>
</PropertyGroup>
<UsingTask TaskName="RepeatString" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<s ParameterType="System.String" Required="true" />
<n ParameterType="System.Int32" Required="true" />
<result ParameterType="System.String" Output="true" />
</ParameterGroup>
<Task>
<Code Type="Fragment" Language="cs"><![CDATA[
result = string.Concat( Enumerable.Repeat( s, n ) );
]]></Code>
</Task>
</UsingTask>
<Target Name="doit">
<RepeatString s="$(MyString)" n="$(Count)">
<Output PropertyName="result" TaskParameter="result" />
</RepeatString>
<Message Text="Result = $(result)"/>
</Target>
</Project>

Ribbon button should be hidden based on lead status - CRM 2011

I have custom button in lead ribbon. The custom button should be hidden when lead is qualified. How can I do that? Can any one please explain. I appreciate.
You can actually accomplish this entirely with built-in DisplayRule functionality. When a Lead is qualified, the StatusCode property is set to "Qualified", which translates into an OptionSet value of "3". You can check for the value of this property in a ValueRule and display/hide the control appropriately. I can think of two ways to achieve this:
Erik Pool's Visual Ribbon Editor
RibbonXml
<RibbonDiffXml>
<CustomActions>
<CustomAction Id="CompanyName.Form.lead.MainTab.Actions.Sample.CustomAction" Location="Mscrm.Form.lead.MainTab.Actions.Controls._children" Sequence="41">
<CommandUIDefinition>
<Button Id="CompanyName.Form.lead.MainTab.Actions.Sample" Command="CompanyName.Form.lead.MainTab.Actions.Sample.Command" Sequence="29" ToolTipTitle="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" LabelText="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.LabelText" ToolTipDescription="$LocLabels:CompanyName.Form.lead.MainTab.Actions.Sample.Description" TemplateAlias="isv" />
</CommandUIDefinition>
</CustomAction>
</CustomActions>
<Templates>
<RibbonTemplates Id="Mscrm.Templates"></RibbonTemplates>
</Templates>
<CommandDefinitions>
<CommandDefinition Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command">
<EnableRules />
<DisplayRules>
<DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule" />
</DisplayRules>
<Actions>
<Url Address="http://www.bing.com" />
</Actions>
</CommandDefinition>
</CommandDefinitions>
<RuleDefinitions>
<TabDisplayRules />
<DisplayRules>
<DisplayRule Id="CompanyName.Form.lead.MainTab.Actions.Sample.Command.DisplayRule.ValueRule">
<ValueRule Field="statuscode" Value="3" />
</DisplayRule>
</DisplayRules>
<EnableRules />
</RuleDefinitions>
<LocLabels>
<LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.LabelText">
<Titles>
<Title languagecode="1033" description="Sample" />
</Titles>
</LocLabel>
<LocLabel Id="CompanyName.Form.lead.MainTab.Actions.Sample.Description">
<Titles>
<Title languagecode="1033" description="Sample Description" />
</Titles>
</LocLabel>
</LocLabels>
</RibbonDiffXml>

Resources