Skip to content
This repository has been archived by the owner on Jun 20, 2023. It is now read-only.

Package proguard configs in the Target Framework folder #209

Open
wants to merge 3 commits into
base: AndroidX
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions source/AndroidXProject.cshtml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@using System.Linq
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="MSBuild.Sdk.Extras/2.0.54">
<PropertyGroup>
<TargetFramework>MonoAndroid90</TargetFramework>
<IsBindingProject>true</IsBindingProject>
Expand Down Expand Up @@ -69,14 +69,14 @@
</ItemGroup>

<ItemGroup>
<None Include="@(Model.NuGetPackageId).targets" Pack="True" PackagePath="build\$(TargetFramework)" />
<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\" />
<None Include="..\..\@(art.ProguardFile)" Pack="True" PackagePath="proguard\$(TargetFramework)\" />
}
}
</ItemGroup>
Expand Down Expand Up @@ -171,10 +171,4 @@
</ItemGroup>
}

<ItemGroup>
<PackageReference Include="MSBuild.Sdk.Extras" Version="1.6.68" PrivateAssets="All" />
</ItemGroup>

<Import Project="$(MSBuildSDKExtrasTargets)" Condition="Exists('$(MSBuildSDKExtrasTargets)')" />

</Project>
4 changes: 3 additions & 1 deletion source/AndroidXTargets.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
@using System.Xml.Linq
@functions
{
public static string GetTargetFrameworkVersion() { return "monoandroid90"; }

public static void RemoveXmlns(XElement e)
{
e.Name = e.Name.LocalName;
Expand All @@ -21,7 +23,7 @@
<ItemGroup>
@foreach (var art in @Model.MavenArtifacts) {
if (art.ProguardFile != null) {
<ProguardConfiguration Include="$(MSBuildThisFileDirectory)..\..\proguard\proguard.txt">
<ProguardConfiguration Include="$(MSBuildThisFileDirectory)..\..\proguard\@(GetTargetFrameworkVersion())\proguard.txt">
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
</ProguardConfiguration>
}
Expand Down