Skip to content

Commit

Permalink
Build r8 together with moe
Browse files Browse the repository at this point in the history
  • Loading branch information
Berstanio committed Jul 21, 2022
1 parent dd1ccc5 commit 89e1cd7
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ if (!rootProject.hasProperty('moe.tools.sdk.mac_only')) {
//////////////////////////////////////////////////////////////////////////
// Prebuild dex files
//////////////////////////////////////////////////////////////////////////

def r8Jar = gradle.includedBuild("r8").projectDir.absolutePath + "/build/libs/r8.jar"
task processDexDesugaredJDK(type: JavaExec) {
classpath = project.files("/Users/berstanio/R8/r8/build/libs/r8.jar")
dependsOn(gradle.includedBuild("r8").task(":r8"))

classpath = project.files(r8Jar)
ext.dexOutput = file("${buildDir}/moe-desugared-dex.jar")

main 'com.android.tools.r8.L8'
Expand All @@ -68,7 +70,9 @@ task processDexDesugaredJDK(type: JavaExec) {
}

task processDexCore(type: JavaExec) {
classpath = project.files("/Users/berstanio/R8/r8/build/libs/r8.jar")
dependsOn(gradle.includedBuild("r8").task(":r8"))

classpath = project.files(r8Jar)
ext.dexOutput = file("${buildDir}/moe-core-dex.jar")

main 'com.android.tools.r8.D8'
Expand All @@ -79,7 +83,9 @@ task processDexCore(type: JavaExec) {
}

task processDexiOS(type: JavaExec) {
classpath = project.files("/Users/berstanio/R8/r8/build/libs/r8.jar")
dependsOn(gradle.includedBuild("r8").task(":r8"))

classpath = project.files(r8Jar)
ext.dexOutput = file("${buildDir}/moe-ios-dex.jar")

main 'com.android.tools.r8.D8'
Expand All @@ -91,7 +97,9 @@ task processDexiOS(type: JavaExec) {
}

task processDexiOSJUnit(type: JavaExec) {
classpath = project.files("/Users/berstanio/R8/r8/build/libs/r8.jar")
dependsOn(gradle.includedBuild("r8").task(":r8"))

classpath = project.files(r8Jar)
ext.dexOutput = file("${buildDir}/moe-ios-junit-dex.jar")

main 'com.android.tools.r8.D8'
Expand Down Expand Up @@ -194,7 +202,7 @@ def getSDKCopySpec() {
rename 'moe.generator.natjgen.jar', 'wrapnatjgen.jar'
}

from files('/Users/berstanio/R8/r8/build/libs/') {
from files(gradle.includedBuild("r8").projectDir.absolutePath + "/build/libs/") {
include 'r8.jar'
}

Expand Down

0 comments on commit 89e1cd7

Please sign in to comment.