Iād say the best would be to create a #feature-request, just for tracking purposes - if you create one youāll be auto notified when we reply there with an update.
@ch_kent Iāll vote on that feature request, Iāve been fighting trying to get Humanizer resource assemblies into our Xamarin.iOS app, which works great with VS4Mac, since it uses MSBuild.
Did you try to build it in Xamarin Studio with MSBuild? Thereās an option in Xamarin Studio preferences to use msbuild instead of xbuild.
Asking because weāll add this option to the xamarin steps this week, so that youāll be able to choose whether you want to build with msbuild or xbuild, but the stacks will have Xamarin Studio and not VS for Mac for now.
Yes, having Xamarin Studio use msbuild works as well. Adding msbuild as an option with Xamarin Studio will be great for us. Thank you Viktor!
xamarin-archive 1.4.1 was just released, and the new version now has a tool option where you can set msbuild: https://github.com/bitrise-steplib/steps-xamarin-archive/releases/tag/1.4.1
P.S.: due to caching on bitrise.io it might take some time for the new version to show up. If you use the local workflow editor or set the version in bitrise.yml directly, 1.4.1 is available now. On the website it should be available in ~10-30 mins; if youād still not see it after that, please reload the page/editor a couple of times to refresh the browserās cache.
Sorry I dropped off this thread - I had personal stuff come up.
Iāll look at using MSBuild from XS too, though I use FAKE to run my build, so not sure yet of the exact process yet.
If we can help with anything just let us know @ch_kent!
I plan on getting to this tomorrow, so Iāve just been digging into the Go code trying to figure out what it actually means to invoke MSBuild versus xBuild. I donāt know Go, so am struggling a bit. I found this and this, which I believe are the heart of the matter. But I still canāt see the actual command itās executing.
Is it just a case of executing an MSBuild executable instead of an xBuild executable? Iād check on my Mac, but I havenāt upgraded to latest Xamarin yet (and wonāt be until probably next week).
This is now supported directly in the Xamarin Archive step, see above
Or do you mean another step?
The xamarin-archive step is where I started. Iām trying to understand what it looks like to invoke MSBuild rather than xBuild. Understand that Iām not using a Bitrise step here. I have a FAKE build script that is responsible for running my build. It is (presumably) currently running xBuild, so I want to change it to invoke MSBuild. However, just not sure what that will look likeā¦
OK, I think Iāve made progress by using the latest FAKE (I was using 4.41.6, but now 4.61.3). Iāve tracked down the relevant FAKE code here. As you can see, it now searches for the correct binary, preferring msbuild
on mono >= 5. Fortunately, it also logs what it finds here.
Looking in my (failing) build log I see:
Building project: Src/XXX.Core.sln
/Library/Frameworks/Mono.framework/Versions/Current/Commands/msbuild Src/XXX.Core.sln /t:Clean /v:d /p:RestorePackages="False" /p:Configuration="Release" /logger:Fake.MsBuildLogger+ErrorLogger,"/Users/vagrant/git/Src/packages/FAKE/tools/FakeLib.dll"
So itās now correctly using msbuild
, not xbuild
. The errors are different now, and all look like this:
"/Users/vagrant/git/Src/Services.Connected.Droid/Services.Connected.Droid.csproj" (Clean target) (2) ->
/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.targets(40,3): error MSB4019: The imported project "/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/xbuild/MSBuild/Xamarin/Android/Xamarin.Android.CSharp.targets" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk. [/Users/vagrant/git/Src/Services.Connected.Droid/Services.Connected.Droid.csproj]
Looking into it furtherā¦
I just upgraded my Mac to 15.2.2. When I do find . -name Xamarin.Android.CSharp.targets -print
from within /Library
, all I see is:
./Frameworks/Xamarin.Android.framework/Versions/5.1.0-100/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/5.1.0-113/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/5.1.0-129/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/6.1.2-21/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.0-18/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.1-2/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.1-3/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.2-37/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.2-42/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.1.0-41/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.1.0-43/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.2.0-7/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.3.1-2/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/5.1.0-100/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/5.1.0-113/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/5.1.0-129/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/6.1.2-21/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.0-18/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.1-2/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.1-3/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.2-37/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.0.2-42/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.1.0-41/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.1.0-43/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.2.0-7/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
./Frameworks/Xamarin.Android.framework/Versions/7.3.1-2/lib/xbuild/Xamarin/Android/Xamarin.Android.CSharp.targets
So I continue to be confusedā¦
This is so painful.
I got my Android project building on my Mac with VS4M. That is, netstandard + SDK style projects all working locally.
But in Bitrise I get hundreds of errors like this:
Properties/AssemblyInfo.cs(3,12): error CS0246: The type or namespace name 'AssemblyTitleAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/vagrant/git/Src/Utility/Utility.csproj]
/Users/vagrant/git/Src/AssemblyInfoCommon.cs(5,37): error CS0518: Predefined type 'System.String' is not defined or imported [/Users/vagrant/git/Src/Utility/Utility.csproj]
DisposableBase.cs(6,44): error CS0246: The type or namespace name 'IDisposable' could not be found (are you missing a using directive or an assembly reference?) [/Users/vagrant/git/Src/Utility/Utility.csproj]
@viktorbenei Could it be that VS4M is required after all?
PS. this happens regardless of whether .NET core is installed or not
I donāt think this would be related to VS4Mac, rather to Mono/.Net version maybe, or some kind of package.
These seem like a missing assembly reference / dependency.
Did you try to run the project with Xamarin Studio on your Mac?
XS canāt even load the projects because theyāre an āunknown typeā, which is expected because theyāre SDK-style projects now.
@viktorbenei Would it help if I shared my project in its entirety with you? Happy to do that (privately, of course).
Definitely, although if the issue is indeed VS4Mac ā Xam Studio, then all we can say is that the VS4Mac stack will come soon.
Actually, I think you should rather just ping us through the onsite chat, enable Support Access to the app, and weāll let you know as soon as the VS4Mac stack is in āpreviewā mode (in that mode the stack is not available publicly, but with a ābetaā tag we can enable access to it on a per-user basis).
We could even try to enable it for you right now, as the stack is already in āpreviewā mode (https://github.com/bitrise-io/bitrise.io/blob/master/system_reports/osx-vs4mac-stable.log) but there are still a couple of rough edges and things we should figure out. Our standard Xamarin cross platform project does compile on it without any issue or modification, so I guess it should be usable for most projects, but until itās out of the āpreviewā mode we canāt guarantee anything; preinstalled tools might change any time, etc.
Hmm, with the VS4M image, my build fails very quickly (1.5m) and there is no log loading. It just says Full logs will be available once this build is finished and the logs are available in the archive
.
Ah, I take that back. It eventually loaded. Seems the xamarin-user-management step is failing:
+------------------------------------------------------------------------------+
| (7) xamarin-user-management@1.0.3 |
+------------------------------------------------------------------------------+
| id: xamarin-user-management |
| version: 1.0.3 |
| collection: https://github.com/bitrise-io/bitrise-steplib.git |
| toolkit: bash |
| time: 2017-06-17T04:10:31-07:00 |
+------------------------------------------------------------------------------+
| |
cat: /Applications/Xamarin Studio.app/Contents/Resources/lib/monodevelop/bin/buildinfo: No such file or directory
e[34mGathering Xamarin License requirementse[0m
Downloading license files for Xamarin.iOS, Xamarin.Android
warning MT0061: No Xcode.app specified (using --sdkroot), using the system Xcode as reported by 'xcode-select --print-path': /Applications/Xcode.app/Contents/Developer
error MT0025: No SDK version was provided. Please add --sdk=X.Y to specify which iOS SDK should be used to build your application.
e[31mMissing data.e[0m
Please upgrade it.