Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to build from MSBuild command line (trig build on OSX from Windows)

$
0
0

Hi everybody !

I'm currently working on the setup of an automated build with TFS. My main issue is due to the fact we use PCL in VB.Net in our solution which is not currently supported by Xamarin Studio (no trouble in VS). This prevent us to use the mdtool command line directly on the OS X build machine. The only solution that we seem to have is to trig the build from an MSBuild command line and reproduce the same scheme as if we start a debug session from within VS to build the native application on the OS X remote build server.

Currently if I try to start a build with :

msbuild "C:\Path\To\My\Solution\MySolution.sln" /p:Configuration=Debug;Platform=iPhoneSimulator /t:Clean;Build

This has the same effect as using "Build>Rebuild All" in visual studio => Only compile the PCL and evaluate references, but no remote build is trigged.

So I took a look into Xamarin.MonoTouch.Common.targets to figure out which setting manage the remote build when starting a debug session. This seems to be managed by the _BuildNativeApplication Target element. But I have a very limited experience and understanding of .targets files... Following the Target and DependsOnTargets attributes, the _BuildNativeApplication is drived by the _RemoteBuild Target which seems to be the last executed Target (DependsOnTargets hierarchy). In the Target executed before, I have not seen any condition which can stop/exit the build before to reach _BuildNativeApplication in the .targets file while simply executing a build action from VS (maybe in one of the Xamarin.MonoTouch.Build.Task ?).

I also made a try by restoring the property which is commented in the file. This seems to allow to run the _BuildNativeApplication step. I added the required parameter, resulting in the following command line:

msbuild "C:\Path\To\My\Solution\MySolution.sln" /p:Configuration=Debug;Platform=iPhoneSimulator;HttpPort="5000";ServerAddress="192.168.93.128" /t:Clean;Build

But I got an error during the _BuildNativeApplication step:

Saying hello to the remote server at http://192.168.93.128:5000/ C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(125,3): error : The server committed a protocol violation. Section=ResponseStatusLine [C:\Users\ggirard\Documents\Visual Studio 2012\Projects\CIBuildTest\CIBuidTest.Touch\CIBuidTest.Touch.csproj] C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(125,3): error : Failed to retrieve info from the build server\r [C:\Users\ggirard\Documents\Visual Studio 2012\Projects\CIBuildTest\CIBuidTest.Touch\CIBuidTest.Touch.csproj] C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(125,3): error : [C:\Users\ggirard\Documents\Visual Studio 2012\Projects\CIBuildTest\CIBuidTest.Touch\CIBuidTest.Touch.csproj] C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.MonoTouch.Common.targets(125,3): error : Remote build step failed. [C:\Users\ggirard\Documents\Visual Studio 2012\Projects\CIBuildTest\CIBuidTest.Touch\CIBuidTest.Touch.csproj] Done Building Project "C:\Users\ggirard\Documents\Visual Studio 2012\Projects\CIBuildTest\CIBuidTest.Touch\CIBuidTest.Touch.csproj" (default targets) -- FAILED.

So as a result, I am currently a little bit stuck, especially due to my lack of knowledge about the Microsoft/Xamarin build processes.

I hope someone could provide me more information and help me to achieve my aim :)

Thanks,

Guillaume.


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>