Getting a command line build going

Hi, I’m trying to set up continuous integration of my Silver/Fire project.

I’m trying to grab the command out of the Fire build and run it, but it always fails with "could not import "$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets"
I’ve tried adding properties and env variables to make it match the Fire environment, but to no avail.

Am I missing some magic here?

(Note I have a separate, old, copy of mono installed)

$ /Applications/Fire.app/Contents/Resources/Mono/bin/mono /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5/xbuild.exe /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln /nologo /target:Build /verbosity:diagnostic /property:Configuration=Debug "/property:ElementsXbuildNougatSDKFolder=/Applications/Fire.app/Contents/Resources/Nougat SDKs" "/property:ElementsXbuildReferencePathsXMLFolder=/Applications/Fire.app/Contents/Resources/Reference Paths with Data Abstract Trial" /toolsversion:4.0 "/property:MONO_PATH=/Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5" "/property:MONO_GAC_PREFIX=/Applications/Fire.app/Contents/Resources/Mono" "/property:LD_LIBRARY_PATH=/Applications/Fire.app/Contents/Frameworks/"
Loading default tasks for ToolsVersion: 4.0 from /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5/Microsoft.Common.tasks

Build started 17/12/2015 9:42:00 AM.
__________________________________________________
/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements: Importing project /Applications/Fire.app/Contents/Resources/Mono/lib/mono/xbuild/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets from extension path /Applications/Fire.app/Contents/Resources/Mono/lib/mono/xbuild
/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements:  warning : Could not find project file /Applications/Fire.app/Contents/Resources/Mono/lib/mono/xbuild/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets, to import. Ignoring.
Project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln" (Build target(s)):

Initial Properties:
_ = /Applications/Fire.app/Contents/Resources/Mono/bin/mono
__CF_USER_TEXT_ENCODING = 0x1F5:0x0:0x0
Apple_PubSub_Socket_Render = /private/tmp/com.apple.launchd.g0xA5dPerk/Render
AspNetConfiguration = $(Configuration)
CLICOLOR = 1
Configuration = Debug
CurrentSolutionConfigurationContents = Debug|AnyCPU
ElementsXbuildNougatSDKFolder = /Applications/Fire.app/Contents/Resources/Nougat SDKs
ElementsXbuildReferencePathsXMLFolder = /Applications/Fire.app/Contents/Resources/Reference Paths with Data Abstract Trial
HOME = /Users/jon
LANG = en_AU.UTF-8
LD_LIBRARY_PATH = /Applications/Fire.app/Contents/Frameworks/
LOGNAME = jon
LSCOLORS = GxFxCxDxBxegedabagaced
MONO_GAC_PREFIX = /Applications/Fire.app/Contents/Resources/Mono
MONO_PATH = /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5
MSBuildBinPath = /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5
MSBuildExtensionsPath = /Applications/Fire.app/Contents/Resources/Mono/lib/mono/xbuild
MSBuildExtensionsPath32 = /Applications/Fire.app/Contents/Resources/Mono/lib/mono/xbuild
MSBuildExtensionsPath64 = /Applications/Fire.app/Contents/Resources/Mono/lib/mono/xbuild
MSBuildProjectDefaultTargets = Build
MSBuildProjectDirectory = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift
MSBuildProjectExtension = .sln
MSBuildProjectFile = PortableCoreSwift.sln
MSBuildProjectFullPath = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln
MSBuildProjectName = PortableCoreSwift
MSBuildThisFile = PortableCoreSwift.sln
MSBuildThisFileDirectory = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/
MSBuildThisFileDirectoryNoRoot = git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/
MSBuildThisFileExtension = .sln
MSBuildThisFileFullPath = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln
MSBuildThisFileName = PortableCoreSwift
MSBuildToolsPath = /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5
MSBuildToolsRoot = /Applications/Fire.app/Contents/Resources/Mono/lib/mono
MSBuildToolsVersion = 4.0
OLDPWD = /Applications/Fire.app/Contents/Resources/Mono
OS = Unix
PATH = /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
Platform = AnyCPU
PWD = /Applications/Fire.app/Contents/Resources/Mono/bin
SHELL = /bin/bash
SHLVL = 1
SolutionDir = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/
SolutionExt = .sln
SolutionFileName = PortableCoreSwift.sln
SolutionName = PortableCoreSwift
SolutionPath = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln
SSH_AUTH_SOCK = /private/tmp/com.apple.launchd.X6XXnnqv2t/Listeners
TERM = xterm-256color
TERM_PROGRAM = Apple_Terminal
TERM_PROGRAM_VERSION = 361.1
TERM_SESSION_ID = 1F2DE4E9-4C54-46D1-B333-EA57D0C4694D
TMPDIR = /var/folders/bf/kwg2ldp544g2whhky_tx32900000gn/T/
USER = jon
XPC_FLAGS = 0x0
XPC_SERVICE_NAME = 0

Initial Items:
BuildLevel0
	/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements
ProjectReference
	/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements
Building target "ValidateSolutionConfiguration" in project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln" ("/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln").
	Target ValidateSolutionConfiguration:
	Task "Message"
		Using task Message from Microsoft.Build.Tasks.Message, Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
		Building solution configuration "Debug|AnyCPU".
	Done executing task "Message"
	Done building target "ValidateSolutionConfiguration" in project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln".
Done building target "ValidateSolutionConfiguration" in project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln" ("/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln").
Building target "Build" in project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln" ("/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln").
	Target Build:
	Task "MSBuild"
		Using task MSBuild from Microsoft.Build.Tasks.MSBuild, Microsoft.Build.Tasks.v4.0, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
		Global Properties:
			BuildingSolutionFile = true
			Configuration = Debug
			CurrentSolutionConfigurationContents = Debug|AnyCPU
			Platform = AnyCPU
			SolutionDir = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/
			SolutionExt = .sln
			SolutionFileName = PortableCoreSwift.sln
			SolutionName = PortableCoreSwift
			SolutionPath = /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln
/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements: error : /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements: /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements could not import "$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets"
		/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements: Microsoft.Build.BuildEngine.InvalidProjectFileException: /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements: /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements could not import "$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets" ---> Microsoft.Build.BuildEngine.InvalidProjectFileException: /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements could not import "$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets"
		  at Microsoft.Build.BuildEngine.Import.ForEachExtensionPathTillFound (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.Project project, Microsoft.Build.BuildEngine.ImportedProject importingProject, System.Func`3 func) <0x11397b070 + 0x00adb> in :0 
		  at Microsoft.Build.BuildEngine.Project.AddImport (System.Xml.XmlElement xmlElement, Microsoft.Build.BuildEngine.ImportedProject importingProject, Boolean evaluate_properties) <0x11397ad20 + 0x002b4> in :0 
		  at Microsoft.Build.BuildEngine.Project.ProcessElements (System.Xml.XmlElement rootElement, Microsoft.Build.BuildEngine.ImportedProject ip) <0x112bc7490 + 0x00441> in :0 
		  at Microsoft.Build.BuildEngine.Project.ProcessXml () <0x112bc08a0 + 0x005e1> in :0 
		  at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) <0x112bcc3e0 + 0x004b0> in :0 
		  --- End of inner exception stack trace ---
		  at Microsoft.Build.BuildEngine.Project.DoLoad (System.IO.TextReader textReader) <0x112bcc3e0 + 0x00593> in :0 
		  at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName, ProjectLoadSettings settings) <0x112bc9210 + 0x0049d> in :0 
		  at Microsoft.Build.BuildEngine.Project.Load (System.String projectFileName) <0x112bc91d0 + 0x0001b> in :0 
		  at Microsoft.Build.BuildEngine.Engine.BuildProjectFileInternal (System.String projectFile, System.String[] targetNames, Microsoft.Build.BuildEngine.BuildPropertyGroup globalProperties, IDictionary targetOutputs, BuildSettings buildFlags, System.String toolsVersion) <0x112be13d0 + 0x003f0> in :0 
		  at Microsoft.Build.BuildEngine.Engine.BuildProjectFile (System.String projectFile, System.String[] targetNames, Microsoft.Build.BuildEngine.BuildPropertyGroup globalProperties, IDictionary targetOutputs, BuildSettings buildFlags, System.String toolsVersion) <0x112be0470 + 0x00088> in :0 
	Task "MSBuild" execution -- FAILED
	Done building target "Build" in project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln".-- FAILED
Done building target "Build" in project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln" ("/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln").
Done building project "/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln".-- FAILED

Target performance summary:
    15.999 ms  ValidateSolutionConfiguration                           1 calls
    40.782 ms  Build                                                   1 calls

Tasks performance summary:
    10.134 ms  Message                                                 1 calls
    38.477 ms  MSBuild                                                 1 calls

Build FAILED.

Warnings:

/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements:  warning : Could not find project file /Applications/Fire.app/Contents/Resources/Mono/lib/mono/xbuild/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets, to import. Ignoring.

Errors:

/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.sln (Build) ->
(Build target) ->

	/git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements: error : /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements: /git/Payment/Clients/PortableCoreSwift/PortableCoreSwift/PortableCoreSwift.elements could not import "$(MSBuildExtensionsPath)/RemObjects Software/Oxygene/RemObjects.Oxygene.Cooper.Android.targets"

	 1 Warning(s)
	 1 Error(s)

Time Elapsed 00:00:00.2530290

Building from the command line works very well if you install the external (command line) compiler and then use the xbuild tool, see http://docs.elementscompiler.com/Fire/Setup/ExternalCompiler/ for all the details.

This prolly means you don’t have the external compiler installed, only Fire. If so, xbuild can’t find the compiler.

Thanks, I got it running using the external compilers, running xbuild out of a gradle script.

That works well, except for the requirement of sudo to install it - I would be nicer to be able to automatically grab the right zip and use it as part of the gradle build within Android Studio.

Can you use the elements files with xbuild all the sudo installing stuff?

probably, but you’d have to pass a lot of manual stuff to xbuild, like where to find the .targets files, if they aren’t in a (only root-writable) standard location where xbuild wants them. Also i’m not sure if you could make the build work w/o having the compiler in Mono’s GAC (which also requires sudo…). I don’t think it’s be worth the hassle.

Ok thanks. There is quite a bit going on in that install script.

I might just automate the download and running the install as far as making it a gradle task, then tell developers to run that when we update, so at least it’s repeatable.

Nb I did get a command line build running through Fire, without having to install anything else, by

    export MSBuildExtensionsPath=/Applications/Fire.app/Contents/Resources/XBuildTargets
    
  /Applications/Fire.app/Contents/Resources/Mono/bin/mono /Applications/Fire.app/Contents/Resources/Mono/lib/mono/4.5/xbuild.exe /path/to/your/sln  /nologo /target:Build /verbosity:minimal /property:Configuration=Debug "/property:ElementsXbuildNougatSDKFolder=/Applications/Fire.app/Contents/Resources/Nougat SDKs" "/property:ElementsXbuildReferencePathsXMLFolder=/Applications/Fire.app/Contents/Resources/Reference Paths with Data Abstract Trial" /toolsversion:4.0
1 Like