This repository was archived by the owner on Jun 20, 2023. It is now read-only.
Repository navigation
Expand file tree
/
Copy pathAndroidSupportProject.cshtml
More file actions
212 lines (185 loc) · 9.71 KB
/
Copy pathAndroidSupportProject.cshtml
File metadata and controls
212 lines (185 loc) · 9.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
@using System.Linq
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<PropertyGroup>
<TargetFramework>MonoAndroid90</TargetFramework>
<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>
<Authors>Microsoft</Authors>
<Owners>Microsoft</Owners>
<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>
<!-- Include symbol files (*.pdb) in the built .nupkg -->
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<PropertyGroup>
<AndroidClassParser>class-parse</AndroidClassParser>
<AndroidCodegenTarget>XAJavaInterop1</AndroidCodegenTarget>
</PropertyGroup>
<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<TransformFile Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.xml" Condition="Exists('..\..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.xml')" />
}
</ItemGroup>
@*<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<JavaSourceJar Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-sources.jar" Condition="Exists('..\..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-sources.jar')" />
}
</ItemGroup>*@
<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
<_AndroidDocumentationPath Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.txt" Condition="Exists('..\..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)-paramnames.txt')" />
}
</ItemGroup>
<ItemGroup>
<None Include="@(Model.NuGetPackageId).targets" Pack="True" PackagePath="build\$(TargetFramework)" />
</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>
}
<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
if (art.MavenArtifactPackaging == "aar") {
<LibraryProjectZip Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenGroupId).@(art.MavenArtifactId).aar" />
}
}
</ItemGroup>
<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>
<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
if (1==2 && art.MavenArtifactPackaging == "aar") {
<None Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId).aar" Pack="True" PackagePath="aar\" />
}
}
</ItemGroup>
@if (@Model.MavenArtifacts.Count > 0) {
<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
if (art.MavenArtifactPackaging == "aar") {
<InputJar Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)\classes.jar" />
<!-- For those artifacts with lib/ folder -->
<InputJar
Condition="Exists('..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)\libs\')"
Include="..\..\externals\@(art.MavenGroupId).@(art.MavenArtifactId)\libs\*.jar"
/>
} else {
<EmbeddedJar Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenGroupId).@(art.MavenArtifactId).jar" />
}
}
</ItemGroup>
}
<ItemGroup>
<!-- ProjectReference -->
@foreach (var dep in @Model.NuGetDependencies) {
if (dep.IsProjectReference) {
<ProjectReference Include="..\..\generated\@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId)\@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId).csproj" PrivateAssets="none" />
}
}
<!-- some additional fixes -->
@if (@Model.NuGetPackageId == "Xamarin.Android.Support.Transition")
{
<ProjectReference Include="..\com.android.support.support-fragment\com.android.support.support-fragment.csproj" PrivateAssets="none" />
}
</ItemGroup>
<ItemGroup>
<!-- PackageReference -->
@foreach (var dep in @Model.NuGetDependencies) {
if (!dep.IsProjectReference) {
<PackageReference Include="@(dep.NuGetPackageId)" Version="@(dep.NuGetVersion)" />
}
}
</ItemGroup>
@if (@Model.NuGetPackageId == "Xamarin.Android.Support.Annotations")
{
<ItemGroup>
<None Include="..\..\source\buildtasks\support-annotations\bin\$(Configuration)\Xamarin.Android.Support.BuildTasks.dll" Pack="True" PackagePath="build\$(TargetFramework)" />
</ItemGroup>
}
@if (@Model.NuGetPackageId == "Xamarin.Android.Support.Vector.Drawable")
{
<ItemGroup>
<None Include="..\..\source\buildtasks\support-vector-drawable\bin\$(Configuration)\Xamarin.Android.Support.Tasks.VectorDrawable.dll" Pack="True" PackagePath="build\$(TargetFramework)" />
</ItemGroup>
}
@if (1==2 && @Model.NuGetPackageId == "Xamarin.Android.Support.v4")
{
<Target Name="AndroidSupportLibrariesTypeForwardersGenerationWithGenAPI" BeforeTargets="Build">
<Message Text="AndroidSupportLibrariesTypeForwardersGenerationWithGenAPI" ></Message>
<PropertyGroup>
<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>
<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>
<GenAPICommand Condition=" '$(OS)' == 'Windows_NT'">"$(GenAPIPath)"</GenAPICommand>
<GenAPICommand Condition=" '$(OS)' != 'Windows_NT'">mono --runtime=v4.0.30319 "$(GenAPIPath)"</GenAPICommand>
</PropertyGroup>
<ItemGroup>
@foreach (var dep in @Model.NuGetDependencies)
{
if (dep.IsProjectReference)
{
<GenAPIItemBase
Include="$(MSBuildProjectDirectory)\..\@(dep.MavenArtifact.MavenGroupId).@(dep.MavenArtifact.MavenArtifactId)\">
<GenAPIAssembly>$(GenAPIIntermediateOutputPath)@(dep.NuGetPackageId).dll</GenAPIAssembly>
<GenAPICSCode>$(MSBuildProjectDirectory)\Additions\@(dep.NuGetPackageId).cs</GenAPICSCode>
</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
-->
<MakeDir Directories="$(MSBuildProjectDirectory)\Additions" />
<Exec
Command="$(GenAPIPath) -libPath:"$(GenAPILibPaths)" -out:"%(GenAPIItemBase.GenAPICSCode)" -w:TypeForwards "%(GenAPIItemBase.Identity)%(GenAPIItemBase.GenAPIAssembly)""
/>
</Target>
}
</Project>