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

Commit 1e220ec

Browse files
Redthmattleibow
authored andcommitted
Embed .jar's inside nuget not inside dll (#171)
* Switch to InputJar for jar files to embed it inside the nuget package via the targets file. * Add `AndroidXSkipAndroidXMigration` to `AndroidJavaLibrary` and `ProguardConfiguration`
1 parent 840f257 commit 1e220ec

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

source/AndroidXProject.cshtml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@
9696
<ItemGroup>
9797
@foreach (var art in @Model.MavenArtifacts) {
9898
if (art.MavenArtifactPackaging == "aar") {
99-
<None Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId).aar" Pack="True" PackagePath="aar\" />
99+
<None Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId).aar" Pack="True" PackagePath="aar\@(art.MavenGroupId).@(art.MavenArtifactId).aar" />
100+
} else {
101+
<None Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId).jar" Pack="True" PackagePath="jar\@(art.MavenGroupId).@(art.MavenArtifactId).jar" />
100102
}
101103
}
102104
</ItemGroup>
@@ -113,7 +115,7 @@
113115
Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId)\libs\*.jar"
114116
/>
115117
} else {
116-
<EmbeddedJar Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId).jar" />
118+
<InputJar Include="..\..\externals\@(art.MavenGroupId)\@(art.MavenArtifactId).jar" />
117119
}
118120
}
119121
</ItemGroup>

source/AndroidXTargets.cshtml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@
1717
}
1818
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
1919
@if (@Model.MavenArtifacts.Count > 0) {
20+
2021
<ItemGroup>
2122
@foreach (var art in @Model.MavenArtifacts) {
2223
if (art.ProguardFile != null) {
23-
<ProguardConfiguration Include="$(MSBuildThisFileDirectory)..\proguard\proguard.txt" />
24+
<ProguardConfiguration Include="$(MSBuildThisFileDirectory)..\proguard\proguard.txt">
25+
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
26+
</ProguardConfiguration>
2427
}
2528
}
2629
</ItemGroup>
@@ -29,9 +32,13 @@
2932
<ItemGroup>
3033
@foreach (var art in @Model.MavenArtifacts) {
3134
if (art.MavenArtifactPackaging == "aar") {
32-
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\aar\@(art.MavenArtifactId).aar">
35+
<AndroidAarLibrary Include="$(MSBuildThisFileDirectory)..\aar\@(art.MavenGroupId).@(art.MavenArtifactId).aar">
3336
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
3437
</AndroidAarLibrary>
38+
} else {
39+
<AndroidJavaLibrary Include="$(MSBuildThisFileDirectory)..\jar\@(art.MavenGroupId).@(art.MavenArtifactId).jar">
40+
<AndroidXSkipAndroidXMigration>true</AndroidXSkipAndroidXMigration>
41+
</AndroidJavaLibrary>
3542
}
3643
}
3744
</ItemGroup>

0 commit comments

Comments
 (0)