diff --git a/Makefile b/Makefile index 678ceee527b..bbe4bb981f2 100644 --- a/Makefile +++ b/Makefile @@ -2,8 +2,10 @@ OS := $(shell uname) OS_ARCH := $(shell uname -m) V ?= 0 CONFIGURATION = Debug -MSBUILD = xbuild /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS) +MSBUILD = xbuild +MSBUILD_FLAGS = /p:Configuration=$(CONFIGURATION) $(MSBUILD_ARGS) RUNTIME := $(shell if [ -f `which mono64` ] ; then echo mono64 ; else echo mono; fi) --debug=casts +SOLUTION = Xamarin.Android.sln NUNIT_TESTS = \ bin/Test$(CONFIGURATION)/Xamarin.Android.Build.Tests.dll @@ -12,27 +14,31 @@ NUNIT_CONSOLE = packages/NUnit.ConsoleRunner.3.2.1/tools/nunit3-console.exe ifneq ($(V),0) MONO_OPTIONS += --debug -MSBUILD += /v:d +MSBUILD_FLAGS += /v:d endif ifneq ($(MONO_OPTIONS),) export MONO_OPTIONS endif -all: - $(MSBUILD) +all:: + $(MSBUILD) $(MSBUILD_FLAGS) $(SOLUTION) + +all-tests:: + tools/scripts/xabuild $(MSBUILD_FLAGS) Xamarin.Android-Tests.sln prepare:: prepare-external prepare-props prepare-external: git submodule update --init --recursive - nuget restore - (cd `$(MSBUILD) /p:DoNotLoadOSProperties=True /nologo /v:minimal /t:GetJavaInteropFullPath build-tools/scripts/Paths.targets` && nuget restore) + nuget restore $(SOLUTION) + nuget restore Xamarin.Android-Tests.sln + (cd `$(MSBUILD) $(MSBUILD_FLAGS) /p:DoNotLoadOSProperties=True /nologo /v:minimal /t:GetJavaInteropFullPath build-tools/scripts/Paths.targets` && nuget restore) prepare-props: cp Configuration.Java.Interop.Override.props external/Java.Interop/Configuration.Override.props ./build-tools/scripts/generate-os-info Configuration.OperatingSystem.props - cp `$(MSBUILD) /nologo /v:minimal /t:GetMonoSourceFullPath build-tools/scripts/Paths.targets`/mcs/class/msfinal.pub . + cp `$(MSBUILD) $(MSBUILD_FLAGS) /nologo /v:minimal /t:GetMonoSourceFullPath build-tools/scripts/Paths.targets`/mcs/class/msfinal.pub . include build-tools/scripts/BuildEverything.mk @@ -91,7 +97,8 @@ endif run-all-tests: run-nunit-tests run-apk-tests clean: - $(MSBUILD) /t:Clean + $(MSBUILD) $(MSBUILD_FLAGS) /t:Clean Xamarin.Android.sln + tools/scripts/xabuild $(MSBUILD_FLAGS) /t:Clean Xamarin.Android-Tests.sln distclean: # It may fail if we're cleaning a half-built tree, no harm done if we ignore it @@ -122,9 +129,9 @@ TEST_APK_PROJECTS = \ define RUN_TEST_APK # Must use xabuild to ensure correct assemblies are resolved tools/scripts/xabuild /t:SignAndroidPackage $(1) && \ - $(MSBUILD) /t:UnDeploy $(1) && \ - $(MSBUILD) /t:Deploy $(1) && \ - $(MSBUILD) /t:RunTests $(1) $(if $(ADB_TARGET),"/p:AdbTarget=$(ADB_TARGET)",) + $(MSBUILD) $(MSBUILD_FLAGS) /t:UnDeploy $(1) && \ + $(MSBUILD) $(MSBUILD_FLAGS) /t:Deploy $(1) && \ + $(MSBUILD) $(MSBUILD_FLAGS) /t:RunTests $(1) $(if $(ADB_TARGET),"/p:AdbTarget=$(ADB_TARGET)",) endef run-apk-tests: diff --git a/Xamarin.Android-Tests.sln b/Xamarin.Android-Tests.sln new file mode 100644 index 00000000000..8e31b055480 --- /dev/null +++ b/Xamarin.Android-Tests.sln @@ -0,0 +1,23 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2012 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Android-Tests", "src\Mono.Android\Test\Mono.Android-Tests.csproj", "{40EAD437-216B-4DF4-8258-3F47E1672C3A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HelloWorld", "samples\HelloWorld\HelloWorld.csproj", "{2305B00D-DE81-4744-B0DA-357835CAFE5A}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Release|Any CPU.Build.0 = Release|Any CPU + {2305B00D-DE81-4744-B0DA-357835CAFE5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2305B00D-DE81-4744-B0DA-357835CAFE5A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2305B00D-DE81-4744-B0DA-357835CAFE5A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2305B00D-DE81-4744-B0DA-357835CAFE5A}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection +EndGlobal diff --git a/Xamarin.Android.sln b/Xamarin.Android.sln index e9bee5053e7..61302a1b9e9 100644 --- a/Xamarin.Android.sln +++ b/Xamarin.Android.sln @@ -63,8 +63,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.ProjectTools", "src EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Xamarin.Android.Build.Tests", "src\Xamarin.Android.Build.Tasks\Tests\Xamarin.Android.Build.Tests\Xamarin.Android.Build.Tests.csproj", "{53E4ABF0-1085-45F9-B964-DCAE4B819998}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mono.Android-Tests", "src\Mono.Android\Test\Mono.Android-Tests.csproj", "{40EAD437-216B-4DF4-8258-3F47E1672C3A}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.EnterpriseServices", "src\System.EnterpriseServices\System.EnterpriseServices.csproj", "{2868FC32-A4E7-4008-87C8-2C7879CACB58}" EndProject Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "unix-distribution-setup", "build-tools\unix-distribution-setup\unix-distribution-setup.mdproj", "{2CF172E5-BDAE-4ABA-8BC8-08040ED3E77A}" @@ -273,18 +271,6 @@ Global {53E4ABF0-1085-45F9-B964-DCAE4B819998}.XAIntegrationDebug|AnyCPU.Build.0 = Debug|Any CPU {53E4ABF0-1085-45F9-B964-DCAE4B819998}.XAIntegrationRelease|AnyCPU.ActiveCfg = Debug|Any CPU {53E4ABF0-1085-45F9-B964-DCAE4B819998}.XAIntegrationRelease|AnyCPU.Build.0 = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Debug|AnyCPU.Build.0 = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Release|AnyCPU.ActiveCfg = Release|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.Release|AnyCPU.Build.0 = Release|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationDebug|Any CPU.ActiveCfg = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationDebug|Any CPU.Build.0 = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationRelease|Any CPU.ActiveCfg = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationRelease|Any CPU.Build.0 = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationDebug|AnyCPU.ActiveCfg = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationDebug|AnyCPU.Build.0 = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationRelease|AnyCPU.ActiveCfg = Debug|Any CPU - {40EAD437-216B-4DF4-8258-3F47E1672C3A}.XAIntegrationRelease|AnyCPU.Build.0 = Debug|Any CPU {2868FC32-A4E7-4008-87C8-2C7879CACB58}.Debug|AnyCPU.ActiveCfg = Debug|Any CPU {2868FC32-A4E7-4008-87C8-2C7879CACB58}.Debug|AnyCPU.Build.0 = Debug|Any CPU {2868FC32-A4E7-4008-87C8-2C7879CACB58}.Release|AnyCPU.ActiveCfg = Release|Any CPU @@ -429,7 +415,6 @@ Global {4D603AA3-3BFD-43C8-8050-0CD6C2601126} = {04E3E11E-B47D-4599-8AFC-50515A95E715} {2DD1EE75-6D8D-4653-A800-0A24367F7F38} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483} {53E4ABF0-1085-45F9-B964-DCAE4B819998} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483} - {40EAD437-216B-4DF4-8258-3F47E1672C3A} = {CAB438D8-B0F5-4AF0-BEBD-9E2ADBD7B483} {2868FC32-A4E7-4008-87C8-2C7879CACB58} = {04E3E11E-B47D-4599-8AFC-50515A95E715} {2CF172E5-BDAE-4ABA-8BC8-08040ED3E77A} = {E351F97D-EA4F-4E7F-AAA0-8EBB1F2A4A62} {1A4B041A-842F-40B3-A50D-49E01D30BD18} = {04E3E11E-B47D-4599-8AFC-50515A95E715} diff --git a/build-tools/scripts/BuildEverything.mk b/build-tools/scripts/BuildEverything.mk index 494389b6dd4..e630e5d69d6 100644 --- a/build-tools/scripts/BuildEverything.mk +++ b/build-tools/scripts/BuildEverything.mk @@ -61,13 +61,13 @@ FRAMEWORK_ASSEMBLIES = \ leeroy jenkins: prepare $(RUNTIME_LIBRARIES) $(TASK_ASSEMBLIES) $(FRAMEWORK_ASSEMBLIES) $(TASK_ASSEMBLIES): bin/%/lib/xbuild/Xamarin/Android/Xamarin.Android.Build.Tasks.dll: - $(MSBUILD) /p:Configuration=$* $(_MSBUILD_ARGS) + $(MSBUILD) $(MSBUILD_FLAGS) /p:Configuration=$* $(_MSBUILD_ARGS) $(SOLUTION) $(FRAMEWORK_ASSEMBLIES): $(foreach a, $(API_LEVELS), \ - $(MSBUILD) src/Mono.Android/Mono.Android.csproj /p:Configuration=Debug $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(a) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)); \ - $(MSBUILD) src/Mono.Android/Mono.Android.csproj /p:Configuration=Release $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(a) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)); ) + $(MSBUILD) $(MSBUILD_FLAGS) src/Mono.Android/Mono.Android.csproj /p:Configuration=Debug $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(a) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)); \ + $(MSBUILD) $(MSBUILD_FLAGS) src/Mono.Android/Mono.Android.csproj /p:Configuration=Release $(_MSBUILD_ARGS) /p:AndroidApiLevel=$(a) /p:AndroidFrameworkVersion=$(word $(a), $(ALL_FRAMEWORKS)); ) $(RUNTIME_LIBRARIES): - $(MSBUILD) /p:Configuration=Debug $(_MSBUILD_ARGS) - $(MSBUILD) /p:Configuration=Release $(_MSBUILD_ARGS) + $(MSBUILD) $(MSBUILD_FLAGS) /p:Configuration=Debug $(_MSBUILD_ARGS) $(SOLUTION) + $(MSBUILD) $(MSBUILD_FLAGS) /p:Configuration=Release $(_MSBUILD_ARGS) $(SOLUTION) diff --git a/samples/HelloWorld/HelloWorld.csproj b/samples/HelloWorld/HelloWorld.csproj index 5697c811fc8..29ebf50835d 100644 --- a/samples/HelloWorld/HelloWorld.csproj +++ b/samples/HelloWorld/HelloWorld.csproj @@ -8,7 +8,6 @@ Library HelloWorld HelloWorld - v5.0 True Resources\Resource.designer.cs Resource @@ -17,6 +16,10 @@ Assets true + + + $(AndroidFrameworkVersion) + true full diff --git a/tools/scripts/xabuild b/tools/scripts/xabuild index 3a8b3a6b0ae..0b3578e3f51 100755 --- a/tools/scripts/xabuild +++ b/tools/scripts/xabuild @@ -5,6 +5,10 @@ if [ -z "$CONFIGURATION" ] ; then CONFIGURATION=Debug fi +if [ -z "$MSBUILD" ] ; then + MSBUILD=xbuild +fi + export TARGETS_DIR="$topdir/bin/$CONFIGURATION/lib/xbuild" export MSBuildExtensionsPath="$TARGETS_DIR" export MONO_ANDROID_PATH="$topdir/bin/$CONFIGURATION" @@ -18,7 +22,7 @@ ANDROID_SDK_PATH=$(echo $ANDROID_SDK_PATH | sed 's/^\w*//g') export ANDROID_NDK_PATH export ANDROID_SDK_PATH -exec xbuild /p:Configuration=Release $MSBUILD_OPTIONS \ +exec $MSBUILD /p:Configuration=$CONFIGURATION $MSBUILD_OPTIONS \ /p:AndroidNdkDirectory="$ANDROID_NDK_PATH" \ /p:AndroidSdkDirectory="$ANDROID_SDK_PATH" \ /p:MonoDroidInstallDirectory="$MONO_ANDROID_PATH" \