48 lines
1.1 KiB
Groovy
48 lines
1.1 KiB
Groovy
import org.gradle.internal.os.OperatingSystem
|
|
apply plugin: 'java'
|
|
|
|
description = "A utility for doing compile or runtime code generation targeting Android's Dalvik VM"
|
|
|
|
targetCompatibility = '1.7'
|
|
sourceCompatibility = '1.7'
|
|
|
|
repositories {
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
compileOnly project(':dalvikdx')
|
|
}
|
|
|
|
task makeDex(type: Exec) {
|
|
dependsOn jar
|
|
def dexName = "classes.dex"
|
|
workingDir jar.destinationDir
|
|
if (OperatingSystem.current().isWindows()) {
|
|
executable "dx.bat"
|
|
args "--dex", "--output", dexName, "${jar.archiveName}"
|
|
} else {
|
|
executable "bash"
|
|
args rootProject.ext.dxPath.trim(), "--dex", "--output", dexName, "${jar.archiveName}"
|
|
}
|
|
}
|
|
|
|
task dex(type: Copy) {
|
|
dependsOn makeDex
|
|
from (jar.destinationDir) {
|
|
include "classes.dex"
|
|
rename "classes.dex", "eddexmaker.dex"
|
|
}
|
|
destinationDir new File(projectDir, "dex")
|
|
}
|
|
|
|
task dexInJar(type: Jar) {
|
|
dependsOn makeDex
|
|
from "${jar.destinationDir}/classes.dex"
|
|
destinationDir jar.destinationDir
|
|
baseName "eddexmaker"
|
|
onlyIf {
|
|
!jar.state.upToDate || !file(archiveName).exists()
|
|
}
|
|
}
|