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

Commit 8c6c055

Browse files
authored
Move the targets files into sub-folders (#181)
- this will prevent installation into unsupported projects - the TargetFramework is not set for Pack in multitargeting packages, so just use a normal, single target framework - throw in an extra pretty print for the targets so users don't think we are animals in the xml files :)
1 parent 063acff commit 8c6c055

File tree

4 files changed

+13
-5
lines changed

4 files changed

+13
-5
lines changed

build.cake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,14 @@ Task("binderate")
9999

100100
StartProcess("dotnet", "./util/binderator/android-binderator.dll --config=\""
101101
+ MakeAbsolute(configFile).FullPath + "\" --basepath=\"" + MakeAbsolute(basePath).FullPath + "\"");
102+
103+
// format the targets file so they are pretty in the package
104+
var targetsFiles = GetFiles("generated/**/*.targets");
105+
var xmlns = (XNamespace)"http://schemas.microsoft.com/developer/msbuild/2003";
106+
foreach (var targets in targetsFiles) {
107+
var xdoc = XDocument.Load(targets.FullPath);
108+
xdoc.Save(targets.FullPath);
109+
}
102110
});
103111

104112
Task("libs")

source/AndroidXProject.cshtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@using System.Linq
22
<Project Sdk="Microsoft.NET.Sdk">
33
<PropertyGroup>
4-
<TargetFrameworks>MonoAndroid90</TargetFrameworks>
4+
<TargetFramework>MonoAndroid90</TargetFramework>
55
<IsBindingProject>true</IsBindingProject>
66
@if (!string.IsNullOrEmpty(Model.AssemblyName)) {
77
<AssemblyName>@(Model.AssemblyName)</AssemblyName>

source/AndroidXTargets.cshtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<ItemGroup>
2222
@foreach (var art in @Model.MavenArtifacts) {
2323
if (art.ProguardFile != null) {
24-
<ProguardConfiguration Include="$(MSBuildThisFileDirectory)..\proguard\proguard.txt">
24+
<ProguardConfiguration Include="$(MSBuildThisFileDirectory)..\..\proguard\proguard.txt">
2525
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
2626
</ProguardConfiguration>
2727
}
@@ -37,11 +37,11 @@
3737
}
3838

3939
if (art.MavenArtifactPackaging == "aar") {
40-
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\aar\@(art.MavenGroupId).@(art.MavenArtifactId).aar">
40+
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\..\aar\@(art.MavenGroupId).@(art.MavenArtifactId).aar">
4141
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
4242
</AndroidAarLibrary>
4343
} else {
44-
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\jar\@(art.MavenGroupId).@(art.MavenArtifactId).jar">
44+
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\..\jar\@(art.MavenGroupId).@(art.MavenArtifactId).jar">
4545
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
4646
</AndroidJavaLibrary>
4747
}

source/androidx.multidex/multidex/merge.targets

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
</PropertyGroup>
77

88
<ItemGroup Condition="'$(AndroidEnableMultiDex)' == 'true'">
9-
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\aar\androidx.multidex.multidex.aar">
9+
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\..\aar\androidx.multidex.multidex.aar">
1010
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
1111
</AndroidAarLibrary>
1212
</ItemGroup>

0 commit comments

Comments
 (0)