60 lines
3.9 KiB
XML
60 lines
3.9 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
<PropertyGroup>
|
|
<ProjectGuid>{12639975-A892-4D11-A050-40520E88339B}</ProjectGuid>
|
|
<OutputType>Library</OutputType>
|
|
<RootNamespace>SpaceFlint.Demos</RootNamespace>
|
|
<AssemblyName>Demo_Android_CS</AssemblyName>
|
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
|
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
|
<!-- Android SDK path -->
|
|
<AndroidHome Condition="'$(ANDROID_HOME)' != ''">$(ANDROID_HOME)</AndroidHome>
|
|
<AndroidHome Condition="'$(ANDROID_SDK_ROOT)' != ''">$(ANDROID_SDK_ROOT)</AndroidHome>
|
|
<AndroidJar>$(AndroidHome)/platforms/android-30/android.jar</AndroidJar>
|
|
<AndroidBin>$(AndroidHome)/build-tools/30.0.2/</AndroidBin>
|
|
</PropertyGroup>
|
|
<Import Project="..\..\Solution.project" />
|
|
<ItemGroup>
|
|
<Reference Include="System" />
|
|
<Reference Include="$(ObjDir)Android.dll" />
|
|
<None Include="..\Common\App.config" />
|
|
<Compile Include="..\Common\HAL.cs" />
|
|
<Compile Include="..\Common\Points.cs" />
|
|
<Compile Include="MainActivity.cs" />
|
|
<AndroidManifest Include="AndroidManifest.xml" />
|
|
<MyKeystore Include="my.keystore" />
|
|
</ItemGroup>
|
|
<PropertyGroup>
|
|
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
|
|
</PropertyGroup>
|
|
<!-- import android.jar into android.dll -->
|
|
<Target Name="ImportAndroid" BeforeTargets="ResolveAssemblyReferences"
|
|
Inputs="$(AndroidJar)" Outputs="$(ObjDir)android.dll">
|
|
<Error Condition="'$(AndroidHome)' == ''"
|
|
Text="Please specify ANDROID_HOME or ANDROID_SDK_ROOT."/>
|
|
<Error Condition="(! Exists($(AndroidJar)))"
|
|
Text="Cannot find $(AndroidJar) file."/>
|
|
<Delete Files="$(ObjDir)android.dll" />
|
|
<Exec Command=""$(ObjDir)Bluebonnet" "$(AndroidJar)" "$(ObjDir)android.dll"" />
|
|
</Target>
|
|
<Target Name="ExportDalvik" AfterTargets="AfterBuild"
|
|
Condition=" '$(_AssemblyTimestampBeforeCompile)' != '$(_AssemblyTimestampAfterCompile)'">
|
|
<Delete Files="$(OutputPath)$(AssemblyName).apk" />
|
|
<Delete Files="$(OutputPath)$(AssemblyName).unaligned.apk" />
|
|
<Delete Files="$(OutputPath)$(AssemblyName).jar" />
|
|
<Delete Files="$(OutputPath)classes.dex" />
|
|
<Exec Command=""$(ObjDir)Bluebonnet" "$(OutputPath)$(AssemblyName).dll" "$(OutputPath)$(AssemblyName).jar"" />
|
|
<Exec Command=""$(AndroidBin)d8" --release --lib "$(AndroidJar)" "$(OutputPath)$(AssemblyName).jar" "$(ObjDir)/Baselib.jar" --output "$(OutputPath.TrimEnd('\').TrimEnd('/'))"" />
|
|
<Exec Command=""$(AndroidBin)aapt" package -f -F "$(OutputPath)$(AssemblyName).unaligned.apk" -M "@(AndroidManifest)" -I "$(AndroidJar)"" />
|
|
<Exec Command=""$(AndroidBin)aapt" add "$(OutputPath)$(AssemblyName).unaligned.apk" classes.dex" WorkingDirectory="$(OutputPath)" />
|
|
<Exec Command=""$(AndroidBin)zipalign" -f 4 "$(OutputPath)$(AssemblyName).unaligned.apk" "$(OutputPath)$(AssemblyName).apk"" />
|
|
<Exec Command=""$(AndroidBin)apksigner" sign --ks "@(MyKeystore)" --ks-pass "pass:123456" "$(OutputPath)$(AssemblyName).apk"" />
|
|
</Target>
|
|
<Target Name="RunDemo" DependsOnTargets="Build;AfterBuild">
|
|
<Message Importance="High" Text="---------------------------------------------------------------" />
|
|
<Message Importance="High" Text="= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" />
|
|
<Message Importance="High" Text="Install to Android: "$(OutputPath)$(AssemblyName).apk"" />
|
|
<Message Importance="High" Text="= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =" />
|
|
<Message Importance="High" Text="---------------------------------------------------------------" />
|
|
</Target>
|
|
</Project> |