2020-08-26 11:23:24 +03:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
|
|
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
|
|
<PropertyGroup>
|
|
|
|
<ProjectGuid>{359C7175-498C-4205-8D11-223CBE2D5B21}</ProjectGuid>
|
|
|
|
<OutputType>Library</OutputType>
|
|
|
|
<RootNamespace>SpaceFlint.Demos</RootNamespace>
|
|
|
|
<AssemblyName>Demo_Android_FS</AssemblyName>
|
|
|
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
|
|
|
<GenerateTargetFrameworkAttribute>false</GenerateTargetFrameworkAttribute>
|
|
|
|
<ProjectLanguage>FSharp</ProjectLanguage>
|
|
|
|
<!-- Android SDK path -->
|
|
|
|
<AndroidHome Condition="'$(ANDROID_HOME)' != ''">$(ANDROID_HOME)</AndroidHome>
|
|
|
|
<AndroidHome Condition="'$(ANDROID_SDK_ROOT)' != ''">$(ANDROID_SDK_ROOT)</AndroidHome>
|
2021-09-29 17:15:04 +03:00
|
|
|
<AndroidJar>$(AndroidHome)/platforms/android-30/android.jar</AndroidJar>
|
2020-08-26 11:23:24 +03:00
|
|
|
<AndroidBin>$(AndroidHome)/build-tools/30.0.2/</AndroidBin>
|
|
|
|
</PropertyGroup>
|
|
|
|
<Import Project="..\..\Solution.project" />
|
|
|
|
<ItemGroup>
|
|
|
|
<Content Include="packages.config" />
|
|
|
|
<Reference Include="FSharp.Core">
|
|
|
|
<HintPath>..\packages\FSharp.Core.4.7.2\lib\net45\FSharp.Core.dll</HintPath>
|
|
|
|
</Reference>
|
|
|
|
<Reference Include="System" />
|
|
|
|
<Reference Include="$(ObjDir)Android.dll" />
|
|
|
|
<None Include="..\Common\App.config" />
|
|
|
|
<Compile Include="HAL.fs" />
|
|
|
|
<Compile Include="..\Common\Points.fs" />
|
|
|
|
<Compile Include="MainActivity.fs" />
|
|
|
|
<AndroidManifest Include="AndroidManifest.xml" />
|
|
|
|
<MyKeystore Include="..\Android_CS\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)FSharp.Core.dll" "$(OutputPath)$(AssemblyName).jar"" />
|
|
|
|
<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>
|