Jenkins setup for Xamarin Forms app on MacOSX - xamarin

I am trying to setup a Jenkins job for Xamarin.Forms app. I have added the MSBuild plugin to my Jenkins configuration and am trying to configure the MSBuild location.
I tried to add this Path:/Library/Frameworks/Mono.framework/Commands/xbuild to MSBuild location but the Jenkins dashboard is showing this warning:
What is the exact path for the MSBuild? how can I fix this warning?

msbuild and xbuild are located here /Library/Frameworks/Mono.Framework/Commands on a Mac.
I was running Jenkins on a Mac and did this:
Path to MSBuild:/Library/Frameworks/Mono.Framework/Commands
Name: msbuild (don't think this part matters, it is just the name you can call it anything you want.)
like so:

Related

TeamCity - MSBuild incorrect build order

Just trying TeamCity for our applications, however, when we try to build the project it fails as the projects are built out of order, causing a crash and it failing to continue.
I have manually run MSBuild against the solution file and it runs correctly. Is there any extra configuration we could have missed when setting up the server?

Build Wix installer Project in Teamcity 9.1, but how to set the `WixToolPath` in build machine?

I'm using Win10 64bit OS, with Wix3.11RC Toolset installed. My VS2017 have created a Wix v3 installer Project. Our team is using TeamCity9.1 as the CI tool.
Now I want to make the Build Agent in TeamCity to support wixproj build without touch CI server settings(I don't have privilege ). I basically follow some tutorials to checked in all necessary Wix build files(the wix Bin folder, and the wix.targets ) which is put in a relative path to the source code, now I'm blocked with the path issue in editing .wixproj file, the official doc said:
http://wixtoolset.org/documentation/manual/v3/msbuild/daily_builds.html
<PropertyGroup>
<WixToolPath>$(SourceCodeControlRoot)\wix\[[Version]]\</WixToolPath>
<WixTargetsPath>$(WixToolPath)Wix.targets</WixTargetsPath>
<WixTasksPath>$(WixToolPath)wixtasks.dll</WixTasksPath>
</PropertyGroup>
And this is mine:
<PropertyGroup>
<WixToolPath>..\..\wix\3.11\</WixToolPath>
<WixTargetsPath>$(WixToolPath)targetsFile\v3.x\wix.targets</WixTargetsPath>
<WixTasksPath>$(WixToolPath)wixtasks.dll</WixTasksPath>
</PropertyGroup>
The reason I'm using the relative path for WixToolPath is the $(SourceCodeControlRoot) was resolved as D:\ here, but actually the source code will be checked out by CI server and put under a random folder like D:\ABC\f14c7929aa63f1fc. By my configuration, the local build even can't go through, the build error indicates the WixTasksPath had been resolved to a non-existed path: C:\Program Files (x86)\MSBuild\Microsoft\WiX\v3.x\..\..\wix\3.11\wixtasks.dll
So how can I achieve? thanks!
One of the approaches you can try is to change the path in the file to the absolute path using TeamCity-provided references before invoking the tool. In TeamCity settings you can reference the checkout directory path as %system.teamcity.build.checkoutDir% or use ${teamcity.build.checkoutDir} within MSBuild step if run as MSBuild build step.
You can do the replacement in the first build step or just use TeamCity file content replacer to change the old value to new one.
just use
<WixTasksPath>wixtasks.dll</WixTasksPath>
this worked for me.

How to build a Metro app to custom folder

I'm trying to build my Blank App(XAML) for Windows store in custom folder via MSBuild.
In documentation is written that I should add the following attribute to my build command: /p:OutputPath="path", but MSBuild ignoring it. Also I've tried to add this property in .vcxproj but it gives no result.
My command in VS dev command prompt looks like this:
MSbuild "PathToApp\MySolution.sln" /p:Platform=Win32;OutputPath="MyPath"
How can I change output directory for my Metro app?

Set TargetProfile for an Azure project

I'm getting the following error from a build I'm running through TeamCity on my development machine:
[ResolveServiceConfiguration] WATMessage
[16:02:05][WATMessage] C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v10.0\Windows Azure Tools\1.7\Microsoft.WindowsAzure.targets(354, 5): No default service configuration "ServiceConfiguration.cscfg" could be found in the project.
[16:02:05][Xxx.Azure.Production\Xxx.Azure.Production.ccproj] Project Xxx.Azure.Production\Xxx.Azure.Production.ccproj failed.
The same solution builds okay in VS.NET.
I think what I need to do is set the TargetProfile for each of the Azure projects (there's more than one complaining) to override the default of Cloud but I can't find out where to do this.
So how do I set the Target Profile for an Azure project?
Have you tried setting the target profile at command line?
/p:TargetProfile=MyProfile
Given an Azure service configuration file named "ServiceConfiguration.Production.cscfg":
In your TeamCity project build configuration, go to Build Parameters (step 7)
Add a system property with the name "system.TargetProfile" and a value of "Production"
This pattern applies for any named configuration in the format ServiceConfiguration.[your profile].cscfg.
To work around this problem I have created ServiceConfiguration.Cloud.cscfg for each Azure project using the .cscfg that was being set in the definition.
In my case, I renamed the ServiceConfiguration.Cloud.csfg file, and since the build agent will first look for that file because the default TargetProfile is "Cloud", I had to re-create the ServiceConfiguration.Cloud.csfg file in the same location, then went into the .ccproj file and added this line under the <ItemGroup> node:
<ServiceConfiguration Include="ServiceConfiguration.Cloud.csfg" />
Then I rebuilt and the problem was solved.

Deploying .NET with Jenkins/Hudson

I've been using Jenkins/Hudson CI for deploying my .NET web site project. I've been using the MSbuild plugin to build my project, and then xcopy to copy it out to the server.
I've noticed if I use the publish feature in Visual Studio I get a different set of files. I've got the config transforms working, but I end up with all the .cs files and a winmerge compare shows the binaries being different.
So, I'd like to either get Jenkins working just like the publish feature, or confirm that an xcopy deploy is functionally the same thing.
I've had good experiences with using Web Deploy and as a final build step with Jenkins running a bat file containing:
msdeploy.exe -verb:sync -source:package=%PACKAGE% -dest:auto,ComputerName=%TARGETHOST%
You'll have to install the web deploy package on your build server and the extention on IIS.
I'm using the MSBuild Jenkins plugin to build and then deploy the project. As mentioned in other answers, you need to have Web Deploy installed.
In the project configuration page in Jenkins, you need to add the following to the Command Line Arguments field:
/p:Configuration=Debug /p:DeployOnBuild=true /p:PublishProfile=publishProfileName
Of course, you need to first create the publish profile, either in VS or by exporting it from IIS and you also need to specify the solution file path in the MSBuild Build File field.

Resources