|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 3 | + <Import Project="..\installers\create-installers.targets" /> |
| 4 | + <PropertyGroup> |
| 5 | + <BuildDependsOn>ResolveReferences</BuildDependsOn> |
| 6 | + </PropertyGroup> |
| 7 | + <PropertyGroup> |
| 8 | + <PkgInstallDir>/</PkgInstallDir> |
| 9 | + <PkgInstallDir Condition="$([MSBuild]::IsOsPlatform(Linux))">/usr</PkgInstallDir> |
| 10 | + <PayloadDir>$(OutputPath)\pkg\archive</PayloadDir> |
| 11 | + <PkgOutputPath>$(OutputPath)\pkg\packages</PkgOutputPath> |
| 12 | + <PkgResourcesPath>$(OutputPath)\pkg\resources</PkgResourcesPath> |
| 13 | + <PkgDistributionDestination>$(OutputPath)\pkg\distribution.xml</PkgDistributionDestination> |
| 14 | + <PkgLicenseSrcEn Condition="'$(PkgLicenseSrcEn)' == ''">$(XamarinAndroidSourcePath)\LICENSE</PkgLicenseSrcEn> |
| 15 | + <PkgLicenseDestinationEn>$(PkgResourcesPath)\en.lproj</PkgLicenseDestinationEn> |
| 16 | + <PkgScriptsDir>$(MSBuildThisFileDirectory)scripts</PkgScriptsDir> |
| 17 | + <UpdateInfoGuid>d1ec039f-f3db-468b-a508-896d7c382999</UpdateInfoGuid> |
| 18 | + </PropertyGroup> |
| 19 | + <Target Name="_CopyFilesToPayloadDir" |
| 20 | + DependsOnTargets="ConstructInstallerItems;GetXAVersion" > |
| 21 | + <PropertyGroup> |
| 22 | + <XAFrameworkDir>$(PayloadDir)\Library\Frameworks\Xamarin.Android.framework\Versions\$(XAVersion)</XAFrameworkDir> |
| 23 | + <MonoFrameworkExternalDir>$(PayloadDir)\Library\Frameworks\Mono.framework\External</MonoFrameworkExternalDir> |
| 24 | + <MSBuildTargetsDir>$(XAFrameworkDir)\lib\xamarin.android\xbuild\Xamarin\Android</MSBuildTargetsDir> |
| 25 | + <MSBuildFrameworksDir>$(XAFrameworkDir)\lib\xamarin.android\xbuild-frameworks\MonoAndroid</MSBuildFrameworksDir> |
| 26 | + </PropertyGroup> |
| 27 | + <RemoveDir Directories="$(PayloadDir)" /> |
| 28 | + <Copy |
| 29 | + SourceFiles="@(FrameworkItemsUnix)" |
| 30 | + DestinationFiles="@(FrameworkItemsUnix->'$(MSBuildFrameworksDir)\%(RelativePath)')" |
| 31 | + /> |
| 32 | + <Copy |
| 33 | + SourceFiles="@(MSBuildItemsUnix)" |
| 34 | + DestinationFiles="@(MSBuildItemsUnix->'$(MSBuildTargetsDir)\%(RelativePath)')" |
| 35 | + /> |
| 36 | + <Copy |
| 37 | + SourceFiles="@(XATargetsSrcFiles)" |
| 38 | + DestinationFolder="$(XAFrameworkDir)\lib\xamarin.android\xbuild\Xamarin" |
| 39 | + /> |
| 40 | + <Copy |
| 41 | + SourceFiles="@(LegacyTargetsFiles)" |
| 42 | + DestinationFolder="$(XAFrameworkDir)\lib\xamarin.android\xbuild\Novell" |
| 43 | + /> |
| 44 | + <Copy |
| 45 | + SourceFiles="@(MonoDocFiles)" |
| 46 | + DestinationFolder="$(XAFrameworkDir)\lib\monodoc" |
| 47 | + /> |
| 48 | + <Copy |
| 49 | + SourceFiles="@(VersionFiles);$(PkgLicenseSrcEn)" |
| 50 | + DestinationFolder="$(XAFrameworkDir)" |
| 51 | + /> |
| 52 | + </Target> |
| 53 | + <Target Name="_CreateSymbolicLinks" |
| 54 | + DependsOnTargets="_CopyFilesToPayloadDir"> |
| 55 | + <Exec WorkingDirectory="$(PayloadDir)\Library\Frameworks\Xamarin.Android.framework\Versions" |
| 56 | + Command="ln -fs $(XAVersion) Current" |
| 57 | + /> |
| 58 | + <!-- Required for VS Mac Updater --> |
| 59 | + <MakeDir Directories="$(PayloadDir)\Developer" /> |
| 60 | + <Exec WorkingDirectory="$(PayloadDir)\Developer" |
| 61 | + Command="ln -fs "../Library/Frameworks/Xamarin.Android.framework/Versions/Current" MonoAndroid" |
| 62 | + /> |
| 63 | + <Exec WorkingDirectory="$(MSBuildTargetsDir)\lib" |
| 64 | + Command="ln -fs host-$(HostOS) host" |
| 65 | + /> |
| 66 | + <MakeDir Directories="$(MonoFrameworkExternalDir)\xbuild" /> |
| 67 | + <Exec WorkingDirectory="$(MonoFrameworkExternalDir)\xbuild" |
| 68 | + Command="ln -fs "../../../Xamarin.Android.framework/Versions/$(XAVersion)/lib/xamarin.android/xbuild/Novell" ." |
| 69 | + /> |
| 70 | + <MakeDir Directories="$(MonoFrameworkExternalDir)\xbuild\Xamarin" /> |
| 71 | + <Exec WorkingDirectory="$(MonoFrameworkExternalDir)\xbuild\Xamarin" |
| 72 | + Command="ln -fs "../../../../Xamarin.Android.framework/Versions/$(XAVersion)/lib/xamarin.android/xbuild/Xamarin/Android" ." |
| 73 | + /> |
| 74 | + <MakeDir Directories="$(MonoFrameworkExternalDir)\xbuild-frameworks" /> |
| 75 | + <Exec WorkingDirectory="$(MonoFrameworkExternalDir)\xbuild-frameworks" |
| 76 | + Command="ln -fs "../../../Xamarin.Android.framework/Versions/$(XAVersion)/lib/xamarin.android/xbuild-frameworks/MonoAndroid" ." |
| 77 | + /> |
| 78 | + <MakeDir Directories="$(MonoFrameworkExternalDir)\monodoc" /> |
| 79 | + <Exec WorkingDirectory="$(MonoFrameworkExternalDir)\monodoc" |
| 80 | + Command="ln -fs "../../../Xamarin.Android.framework/Versions/$(XAVersion)/lib/monodoc/MonoAndroid-docs.source" ." |
| 81 | + /> |
| 82 | + <Exec WorkingDirectory="$(MonoFrameworkExternalDir)\monodoc" |
| 83 | + Command="ln -fs "../../../Xamarin.Android.framework/Versions/$(XAVersion)/lib/monodoc/MonoAndroid-lib.tree" ." |
| 84 | + /> |
| 85 | + <Exec WorkingDirectory="$(MonoFrameworkExternalDir)\monodoc" |
| 86 | + Command="ln -fs "../../../Xamarin.Android.framework/Versions/$(XAVersion)/lib/monodoc/MonoAndroid-lib.zip" ." |
| 87 | + /> |
| 88 | + </Target> |
| 89 | + <Target Name="_FinalizePayload" |
| 90 | + DependsOnTargets="_CreateSymbolicLinks"> |
| 91 | + <ReplaceFileContents |
| 92 | + SourceFile="distribution.xml.in" |
| 93 | + DestinationFile="$(PkgDistributionDestination)" |
| 94 | + Replacements="@PACKAGE_TITLE@=Xamarin.Android $(ProductVersion)" |
| 95 | + /> |
| 96 | + <Exec |
| 97 | + WorkingDirectory="$(XamarinAndroidSourcePath)" |
| 98 | + ConsoleToMSBuild="true" |
| 99 | + Command="git log --no-color --first-parent -n1 --pretty=format:%ct"> |
| 100 | + <Output TaskParameter="ConsoleOutput" PropertyName="UpdateInfoVersion" /> |
| 101 | + </Exec> |
| 102 | + <WriteLinesToFile |
| 103 | + File="$(XAFrameworkDir)\updateinfo" |
| 104 | + Lines="$(UpdateInfoGuid) $(UpdateInfoVersion)" |
| 105 | + Overwrite="true" |
| 106 | + /> |
| 107 | + <MakeDir Directories="$(PkgLicenseDestinationEn)" /> |
| 108 | + <Copy |
| 109 | + SourceFiles="$(PkgLicenseSrcEn)" |
| 110 | + DestinationFiles="$(PkgLicenseDestinationEn)\License" |
| 111 | + /> |
| 112 | + </Target> |
| 113 | + <Target Name="CreatePkg" |
| 114 | + Condition=" '$(HostOS)' == 'Darwin' " |
| 115 | + DependsOnTargets="_FinalizePayload"> |
| 116 | + <MakeDir Directories="$(PkgOutputPath)"/> |
| 117 | + <PropertyGroup> |
| 118 | + <PkgProductOutputPath Condition="'$(PkgProductOutputPath)' == ''">$(OutputPath)Xamarin.Android.Sdk-$(XAOSSInstallerSuffix).pkg</PkgProductOutputPath> |
| 119 | + </PropertyGroup> |
| 120 | + <ItemGroup> |
| 121 | + <PkgBuildArgs Include="--root "$(PayloadDir)"" /> |
| 122 | + <PkgBuildArgs Include="--identifier com.xamarin.android.pkg" /> |
| 123 | + <PkgBuildArgs Include="--version $(XAVersion)"/> |
| 124 | + <PkgBuildArgs Include="--install-location "$(PkgInstallDir)" "/> |
| 125 | + <PkgBuildArgs Include="--scripts "$(PkgScriptsDir)" "/> |
| 126 | + <PkgBuildArgs Include=""$(PkgOutputPath)/xamarin.android.pkg" "/> |
| 127 | + </ItemGroup> |
| 128 | + <Exec Command="pkgbuild @(PkgBuildArgs, ' ')" /> |
| 129 | + <ItemGroup> |
| 130 | + <ProductBuildArgs Include="--resources "$(PkgResourcesPath)"" /> |
| 131 | + <ProductBuildArgs Include="--distribution "$(PkgDistributionDestination)"" /> |
| 132 | + <ProductBuildArgs Include="--package-path "$(PkgOutputPath)"" /> |
| 133 | + <ProductBuildArgs Include=""$(PkgProductOutputPath)"" /> |
| 134 | + </ItemGroup> |
| 135 | + <Exec Command="productbuild @(ProductBuildArgs, ' ')" /> |
| 136 | + </Target> |
| 137 | +</Project> |
0 commit comments