Skip to content

Commit bf5aa8c

Browse files
committed
save jar files in project's main build/libs and remove version
1 parent c457650 commit bf5aa8c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

processing/buildSrc/src/main/groovy/ImportAar.groovy

+7-5
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ class ImportAar implements Plugin<Project> {
186186
class ExtractAarJarsTask extends org.gradle.api.DefaultTask {
187187
@TaskAction
188188
void extractJars() {
189-
File outputDir = new File(project.buildDir, 'libs')
189+
//File outputDir = new File(project.buildDir, 'libs')
190+
File outputDir = new File(System.getProperty("user.dir"), "build/libs")
190191
outputDir.mkdirs()
191192

192193
// Configuration compileClasspath = project.configurations.getByName('implementation')
@@ -202,10 +203,11 @@ class ExtractAarJarsTask extends org.gradle.api.DefaultTask {
202203
ZipFile zipFile = new ZipFile(aarFile)
203204
zipFile.entries().each { entry ->
204205
if (entry.name.endsWith('.jar')) {
205-
println "Classes JAR found: ${entry}"
206-
String aarName = aarFile.name.replace(".aar", "")
207-
208-
File jarOutput = new File(outputDir, "${aarName}.jar")
206+
println "Classes JAR found: ${entry}"
207+
String aarName = aarFile.name.replace(".aar", "")
208+
String jarName = "${aarName}.jar".replaceFirst(/-\d+(\.\d+)*(?=\.jar$)/, '')
209+
210+
File jarOutput = new File(outputDir, jarName)
209211
jarOutput.parentFile.mkdirs()
210212

211213
// Write the JAR file to the output directory

0 commit comments

Comments
 (0)