Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down
23 changes: 23 additions & 0 deletions Xamarin.Android-Tests.sln
Original file line number Diff line number Diff line change
@@ -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
15 changes: 0 additions & 15 deletions Xamarin.Android.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down
10 changes: 5 additions & 5 deletions build-tools/scripts/BuildEverything.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)
5 changes: 4 additions & 1 deletion samples/HelloWorld/HelloWorld.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<OutputType>Library</OutputType>
<RootNamespace>HelloWorld</RootNamespace>
<AssemblyName>HelloWorld</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
Expand All @@ -17,6 +16,10 @@
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
</PropertyGroup>
<Import Project="..\..\..\Configuration.props" />
<PropertyGroup>
<TargetFrameworkVersion>$(AndroidFrameworkVersion)</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
Expand Down
6 changes: 5 additions & 1 deletion tools/scripts/xabuild
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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" \
Expand Down