diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index e0467d6..c2f6bb1 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -11,10 +11,6 @@ jobs: with: distribution: 'zulu' java-version: 17 - - name: CopyAars - uses: eskatos/gradle-command-action@v1 - with: - arguments: copyAars - name: Build uses: eskatos/gradle-command-action@v1 with: diff --git a/README.md b/README.md index cbd20b9..1711fe1 100644 --- a/README.md +++ b/README.md @@ -142,9 +142,7 @@ FirebaseDatabase.getInstance().setPersistenceEnabled(false) This library is built with Gradle. -Run `./gradlew build` to build, the first time you run build it will fail as it requires the output of the custom `copyAars` and `extractClasses` -gradle tasks to be present in the build folder before the project will successfully compile. These tasks extract the jar files from the -Firebase Android library AAR files to the `build/jar` folder and run on `./gradlew build`. +Run `./gradlew build` to build the library locally. ### Implementation details diff --git a/build.gradle.kts b/build.gradle.kts index 3dc9c2e..1fc57d7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,20 +41,16 @@ val copyAars by tasks.registering(Copy::class) { into("build/aar") } -val extractClasses by tasks.creating { +val extractClasses by tasks.registering(Copy::class) { dependsOn(copyAars) - val aarFileTree = fileTree("build/aar") - - aarFileTree.forEach { aarFile: File -> - - dependsOn( - tasks.create(aarFile.name, Copy::class) { - from(zipTree(aarFile)) - include("classes.jar") - rename("classes.jar", aarFile.nameWithoutExtension + ".jar") - into("build/jar") - } - ) + configurations["aar"].forEach { aarFile -> + copy { + from(zipTree(aarFile)) + include("classes.jar") + fileMode = 0b01110110000 + rename("classes.jar", aarFile.nameWithoutExtension + ".jar") + into("build/jar") + } } }