gradle set build order on android multi project

Viewed 53

There are AAR libraries that contain jni libraries and APKs that contain AAR libraries.

I would like to build their gradle builds sequentially as shown below.

Project ├─app ├─jni_library └─aar_library

  1. jni library build
  2. aar library build include 1
  3. apk build include 2

Gradle version is 6.1.1 Android gradle plugin version is 4.0.

We tried the solution below to do this, but there was a phenomenon such as a debug build working when building a release.

build.gradle (:app)


debug {
preBuild.dependsOn("aar_library:assembleDebug")
    }

release {
preBuild.dependsOn("aar_library:assembleDebug")
    }

build.gradle (:library1)

debug {
preBuild.dependsOn("jni_library:assembleDebug")
    }

release {
preBuild.dependsOn("jni_library:assembleDebug")
    }
0 Answers
Related