Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

SOLVED: Use xbuild to build just one project from a multi-project solution

Alfageme:

First of all, I'm a complete beginner on the whole Xamarin-life-cycle, build tools and terms, so sorry if this is quite basic/incorrect in some wording.

We have a Example.sln file with the following project definitions; one for Android and one for iOS:


Project("{...}") = "Example", "Example\Example\Example.csproj", "{...}"
EndProject
Project("{...}") = "Example.Droid", "Example\Example.Droid\Example.Droid.csproj", "{...}"
EndProject
Project("{...}") = "Example.iOS", "Example\Example.iOS\Example.iOS.csproj", "{...}"
EndProject

I'm currently trying to build just the iOS project with xbuild on the command line. My question is if there's a way to specify this on an xbuild flag; e.g. tried with /t:Example.ios:Build and stuff alike without luck. So I simply tried unbundling the Android project and running:


$ xbuild /p:Configuration="Ad-Hoc" \
/p:Platform="iPhone" \
/p:IpaPackageDir="./Builds" \
/t:Build Example.sln

Which, I guess, since the Droid project is still before iOS on the .sln, is failing when looking for the Android SDK:


/Users/ci/Example-app/Example.sln (Build) ->
(Build target) ->
/Users/ci/Example-app/Example/Example.Droid/Example.Droid.csproj (default targets) ->
/Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets (_BuildSdkCache target) ->

: error XA5205: The Android SDK Directory could not be found. Please set via /p:AndroidSdkDirectory.

Temporarily removing the Android project from the Solution did the trick (preserving the Example\Example.Droid files but commenting out the 2 lines) but it's not quite optimal for me, i.e. maybe in some other CI job I want to just build the Android app, etc.

Thanks!



Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE


This post first appeared on Stack Solved, please read the originial post: here

Share the post

SOLVED: Use xbuild to build just one project from a multi-project solution

×

Subscribe to Stack Solved

Get updates delivered right to your inbox!

Thank you for your subscription

×