2018-08-23 12:33:42 +03:00
|
|
|
@using System.Linq
|
|
|
|
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<TargetFrameworks>MonoAndroid90</TargetFrameworks>
|
|
|
|
<IsBindingProject>true</IsBindingProject>
|
|
|
|
@if (!string.IsNullOrEmpty(Model.AssemblyName)) {
|
|
|
|
<AssemblyName>@(Model.AssemblyName)</AssemblyName>
|
|
|
|
} else {
|
|
|
|
<AssemblyName>@(Model.NuGetPackageId)</AssemblyName>
|
|
|
|
}
|
|
|
|
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
|
|
|
|
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
|
|
|
|
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
|
|
|
|
<AndroidUseIntermediateDesignerFile>True</AndroidUseIntermediateDesignerFile>
|
|
|
|
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<PackageId>@(Model.NuGetPackageId)</PackageId>
|
|
|
|
<Title>Xamarin Android Support Library - @(Model.Name)</Title>
|
|
|
|
<Summary>Xamarin.Android bindings for Android Support Library - @(Model.Name)</Summary>
|
|
|
|
<Description>Xamarin.Android bindings for Android Support Library - @(Model.Name)</Description>
|
|
|
|
<PackageTags>Xamarin Android Xamarin.Android Support</PackageTags>
|
2018-10-11 18:48:28 +03:00
|
|
|
<Authors>Microsoft</Authors>
|
|
|
|
<Owners>Microsoft</Owners>
|
2018-08-23 12:33:42 +03:00
|
|
|
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
|
|
|
|
<PackageProjectUrl>https://go.microsoft.com/fwlink/?linkid=865352</PackageProjectUrl>
|
|
|
|
<PackageLicenseUrl>https://go.microsoft.com/fwlink/?linkid=865381</PackageLicenseUrl>
|
|
|
|
<PackageIconUrl>https://raw.githubusercontent.com/xamarin/AndroidSupportComponents/master/icons/@(Model.Name)_128x128.png</PackageIconUrl>
|
|
|
|
<PackageVersion>@(Model.NuGetVersion)</PackageVersion>
|
|
|
|
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<PropertyGroup>
|
|
|
|
<AndroidClassParser>class-parse</AndroidClassParser>
|
|
|
|
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
|
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
@foreach (var art in @Model.MavenArtifacts) {
|
2018-10-12 21:22:34 +03:00
|
|
|
<TransformFile Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.xml" Condition="Exists('..\..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.xml')" />
|
2018-08-23 12:33:42 +03:00
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
@*<ItemGroup>
|
|
|
|
@foreach (var art in @Model.MavenArtifacts) {
|
2018-10-12 21:22:34 +03:00
|
|
|
<JavaSourceJar Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-sources.jar" Condition="Exists('..\..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-sources.jar')" />
|
2018-08-23 12:33:42 +03:00
|
|
|
}
|
|
|
|
</ItemGroup>*@
|
|
|
|
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
@foreach (var art in @Model.MavenArtifacts) {
|
2018-10-12 21:22:34 +03:00
|
|
|
<_AndroidDocumentationPath Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.txt" Condition="Exists('..\..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.txt')" />
|
2018-08-23 12:33:42 +03:00
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
2018-09-07 16:08:21 +03:00
|
|
|
<None Include="@(Model.NuGetPackageId).targets" Pack="True" PackagePath="build\$(TargetFramework)" />
|
2018-08-23 12:33:42 +03:00
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
@if (@Model.MavenArtifacts.Count > 0) {
|
|
|
|
<ItemGroup>
|
|
|
|
@foreach (var art in @Model.MavenArtifacts) {
|
|
|
|
if (art.ProguardFile != null) {
|
|
|
|
<None Include="..\..\@(art.ProguardFile)" Pack="True" PackagePath="proguard\" />
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
}
|
|
|
|
|
2018-11-13 00:41:54 +03:00
|
|
|
<ItemGroup>
|
|
|
|
@foreach (var art in @Model.MavenArtifacts) {
|
|
|
|
if (art.MavenArtifactPackaging == "aar") {
|
|
|
|
<LibraryProjectZip Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId).aar" />
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
|
2018-08-30 12:44:07 +03:00
|
|
|
<ItemGroup>
|
|
|
|
<Folder Include="Additions\" />
|
|
|
|
<Folder Include="Jars\" />
|
|
|
|
<Folder Include="Transforms\" />
|
|
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
|
|
<Compile Include="..\..\source\AssemblyInfo.cs" />
|
|
|
|
<Compile Include="..\..\source\@(Model.MavenGroupId)\@(Model.Name)\additions\*.cs">
|
|
|
|
<Link>Additions/%(RecursiveDir)/%(Filename)%(Extension)</Link>
|
|
|
|
</Compile>
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
<TransformFile Include="..\..\source\Metadata.common.xml" >
|
|
|
|
<Link>Transforms/Metadata.common.xml</Link>
|
|
|
|
</TransformFile>
|
|
|
|
<TransformFile Include="..\..\source\@(Model.MavenGroupId)\@(Model.Name)\transforms\*.xml">
|
|
|
|
<Link>Transforms/%(RecursiveDir)/%(Filename)%(Extension)</Link>
|
|
|
|
</TransformFile>
|
|
|
|
</ItemGroup>
|
2018-08-23 12:33:42 +03:00
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
@foreach (var art in @Model.MavenArtifacts) {
|
2018-11-13 00:41:54 +03:00
|
|
|
if (1==2 && art.MavenArtifactPackaging == "aar") {
|
2018-10-12 21:22:34 +03:00
|
|
|
<None Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId).aar" Pack="True" PackagePath="aar\" />
|
2018-08-23 12:33:42 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
|
|
|
|
@if (@Model.MavenArtifacts.Count > 0) {
|
|
|
|
<ItemGroup>
|
|
|
|
@foreach (var art in @Model.MavenArtifacts) {
|
|
|
|
if (art.MavenArtifactPackaging == "aar") {
|
2018-10-12 21:22:34 +03:00
|
|
|
<InputJar Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)\classes.jar" />
|
2018-09-03 00:16:04 +03:00
|
|
|
<!-- For those artifacts with lib/ folder -->
|
|
|
|
<InputJar
|
2018-10-12 21:22:34 +03:00
|
|
|
Condition="Exists('..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)\libs\')"
|
|
|
|
Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)\libs\*.jar"
|
2018-09-03 00:16:04 +03:00
|
|
|
/>
|
2018-08-23 12:33:42 +03:00
|
|
|
} else {
|
2018-10-12 21:22:34 +03:00
|
|
|
<EmbeddedJar Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId).jar" />
|
2018-08-23 12:33:42 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
}
|
|
|
|
|
|
|
|
<ItemGroup>
|
2018-08-30 12:44:07 +03:00
|
|
|
<!-- ProjectReference -->
|
2018-08-23 12:33:42 +03:00
|
|
|
@foreach (var dep in @Model.NuGetDependencies) {
|
|
|
|
if (dep.IsProjectReference) {
|
2018-11-01 18:15:33 +03:00
|
|
|
<ProjectReference Include="..\..\generated\@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId)\@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId).csproj" PrivateAssets="none" />
|
2018-08-23 12:33:42 +03:00
|
|
|
}
|
|
|
|
}
|
2018-09-03 00:16:04 +03:00
|
|
|
<!-- some additional fixes -->
|
|
|
|
@if (@Model.NuGetPackageId == "Xamarin.Android.Support.Transition")
|
|
|
|
{
|
|
|
|
<ProjectReference Include="..\com.android.support.support-fragment\com.android.support.support-fragment.csproj" />
|
|
|
|
}
|
2018-08-23 12:33:42 +03:00
|
|
|
</ItemGroup>
|
2018-09-03 00:16:04 +03:00
|
|
|
|
2018-08-23 12:33:42 +03:00
|
|
|
|
|
|
|
<ItemGroup>
|
2018-08-30 12:44:07 +03:00
|
|
|
<!-- PackageReference -->
|
2018-08-23 12:33:42 +03:00
|
|
|
@foreach (var dep in @Model.NuGetDependencies) {
|
|
|
|
if (!dep.IsProjectReference) {
|
|
|
|
<PackageReference Include="@(dep.NuGetPackageId)" Version="@(dep.NuGetVersion)" />
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
|
2018-09-06 23:09:49 +03:00
|
|
|
@if (@Model.NuGetPackageId == "Xamarin.Android.Support.Annotations")
|
|
|
|
{
|
|
|
|
<ItemGroup>
|
2018-09-07 16:08:21 +03:00
|
|
|
<None Include="..\..\source\buildtasks\support-annotations\bin\$(Configuration)\Xamarin.Android.Support.BuildTasks.dll" Pack="True" PackagePath="build\$(TargetFramework)" />
|
2018-09-06 23:09:49 +03:00
|
|
|
</ItemGroup>
|
|
|
|
}
|
|
|
|
|
|
|
|
@if (@Model.NuGetPackageId == "Xamarin.Android.Support.Vector.Drawable")
|
|
|
|
{
|
|
|
|
<ItemGroup>
|
2018-09-07 16:08:21 +03:00
|
|
|
<None Include="..\..\source\buildtasks\support-vector-drawable\bin\$(Configuration)\Xamarin.Android.Support.Tasks.VectorDrawable.dll" Pack="True" PackagePath="build\$(TargetFramework)" />
|
2018-09-06 23:09:49 +03:00
|
|
|
</ItemGroup>
|
|
|
|
}
|
|
|
|
|
2018-08-23 12:33:42 +03:00
|
|
|
@if (@Model.NuGetPackageId == "Xamarin.Android.Support.v4")
|
|
|
|
{
|
2018-11-15 23:41:26 +03:00
|
|
|
<Target Name="AndroidSupportLibrariesTypeForwardersGenerationWithGenAPI" BeforeTargets="Build">
|
2018-08-23 12:33:42 +03:00
|
|
|
<Message Text="AndroidSupportLibrariesTypeForwardersGenerationWithGenAPI" ></Message>
|
|
|
|
<PropertyGroup>
|
2018-11-21 05:47:45 +03:00
|
|
|
<GenAPITargetFramework>$(TargetFramework)</GenAPITargetFramework>
|
|
|
|
<GenAPITargetFramework Condition=" '$(GenAPITargetFramework)' == '' ">$(TargetFrameworks)</GenAPITargetFramework>
|
|
|
|
<GenAPIPath>$(MSBuildProjectDirectory)\..\..\tools\microsoft.dotnet.buildtools.genapi.1.0.0-beta-00081\Microsoft.DotNet.BuildTools.GenAPI\tools\GenAPI.exe</GenAPIPath>
|
|
|
|
|
|
|
|
<GenAPIIntermediateOutputPath>bin\Release\MonoAndroid90\</GenAPIIntermediateOutputPath>
|
|
|
|
|
|
|
|
<GenAPILibPaths Condition=" '$(OS)' == 'Windows_NT' ">$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v1.0,$(VsInstallRoot)\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9.0</GenAPILibPaths>
|
2018-11-21 18:42:01 +03:00
|
|
|
<GenAPILibPaths Condition=" '$(OS)' != 'Windows_NT' ">/Library/Frameworks/Xamarin.Android.Framework/Libraries/mono/2.1,/Library/Frameworks/Xamarin.Android.framework/Libraries/mandroid/platforms/android-28</GenAPILibPaths>
|
2018-11-21 05:47:45 +03:00
|
|
|
|
|
|
|
<GenAPICommand Condition=" '$(OS)' == 'Windows_NT'">"$(GenAPIPath)"</GenAPICommand>
|
|
|
|
<GenAPICommand Condition=" '$(OS)' != 'Windows_NT'">mono --runtime=v4.0.30319 "$(GenAPIPath)"</GenAPICommand>
|
2018-08-23 12:33:42 +03:00
|
|
|
</PropertyGroup>
|
|
|
|
|
|
|
|
<ItemGroup>
|
|
|
|
@foreach (var dep in @Model.NuGetDependencies)
|
|
|
|
{
|
|
|
|
if (dep.IsProjectReference)
|
|
|
|
{
|
|
|
|
<GenAPIItemBase
|
2018-11-21 05:47:45 +03:00
|
|
|
Include="$(MSBuildProjectDirectory)\..\@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId)\">
|
|
|
|
<GenAPIAssembly>$(GenAPIIntermediateOutputPath)@(dep.NuGetPackageId).dll</GenAPIAssembly>
|
|
|
|
<GenAPICSCode>$(MSBuildProjectDirectory)\Additions\@(dep.NuGetPackageId).cs</GenAPICSCode>
|
2018-08-23 12:33:42 +03:00
|
|
|
</GenAPIItemBase>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
|
|
<Message Text=" GenAPIItemBase = %(GenAPIItemBase.Identity) %0A %(GenAPIItemBase.GenAPICSCode) %0A %(GenAPIItemBase.GenAPIAssembly)"></Message>
|
|
|
|
<!--
|
|
|
|
// For some reason GenAPI.exe can't handle absolute paths on mac/unix properly, so always make them relative
|
|
|
|
// GenAPI.exe -libPath:$(MONOANDROID) -out:Some.generated.cs -w:TypeForwards ./relative/path/to/Assembly.dll
|
|
|
|
-->
|
2018-11-21 05:47:45 +03:00
|
|
|
<MakeDir Directories="$(MSBuildProjectDirectory)\Additions" />
|
2018-08-23 12:33:42 +03:00
|
|
|
<Exec
|
2018-11-21 05:47:45 +03:00
|
|
|
Command="$(GenAPIPath) -libPath:"$(GenAPILibPaths)" -out:"%(GenAPIItemBase.GenAPICSCode)" -w:TypeForwards "%(GenAPIItemBase.Identity)%(GenAPIItemBase.GenAPIAssembly)""
|
2018-08-23 12:33:42 +03:00
|
|
|
/>
|
|
|
|
</Target>
|
2018-09-03 00:16:04 +03:00
|
|
|
}
|
|
|
|
|
2018-08-23 12:33:42 +03:00
|
|
|
<ItemGroup>
|
|
|
|
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.4.0" PrivateAssets="All" />
|
|
|
|
</ItemGroup>
|
2018-09-06 23:09:49 +03:00
|
|
|
|
2018-08-23 12:33:42 +03:00
|
|
|
<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />
|
|
|
|
|
|
|
|
</Project>
|