Keep dalvikdx and dexmaker jars up-to-date automatically
This commit is contained in:
parent
2194551c39
commit
e1ccb12eac
|
|
@ -16,6 +16,10 @@ buildscript {
|
||||||
}
|
}
|
||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
|
ext {
|
||||||
|
templateRootPath = project(":edxp-core").projectDir.path + "/template_override/"
|
||||||
|
templateFrameworkPath = templateRootPath + "/system/framework/"
|
||||||
|
}
|
||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
jcenter()
|
jcenter()
|
||||||
|
|
|
||||||
|
|
@ -6,3 +6,21 @@ dependencies {
|
||||||
|
|
||||||
sourceCompatibility = "7"
|
sourceCompatibility = "7"
|
||||||
targetCompatibility = "7"
|
targetCompatibility = "7"
|
||||||
|
|
||||||
|
|
||||||
|
task dexInJar(type: Jar) {
|
||||||
|
dependsOn jar
|
||||||
|
doFirst {
|
||||||
|
exec {
|
||||||
|
workingDir jar.destinationDir
|
||||||
|
executable "dx"
|
||||||
|
args "--dex", "--output", "classes.dex", "${jar.archiveName}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
from "${jar.destinationDir}/classes.dex"
|
||||||
|
destinationDir jar.destinationDir
|
||||||
|
baseName "eddalvikdx"
|
||||||
|
onlyIf {
|
||||||
|
!jar.state.upToDate || !file(archiveName).exists()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,15 +1,3 @@
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
maven {
|
|
||||||
url "https://plugins.gradle.org/m2/"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath "net.ltgt.gradle:gradle-errorprone-plugin:0.0.13"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
apply plugin: "net.ltgt.errorprone"
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
|
|
||||||
description = "A utility for doing compile or runtime code generation targeting Android's Dalvik VM"
|
description = "A utility for doing compile or runtime code generation targeting Android's Dalvik VM"
|
||||||
|
|
@ -21,10 +9,23 @@ repositories {
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile) {
|
|
||||||
options.compilerArgs += ["-Xep:StringSplitter:OFF"]
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly project(':dalvikdx')
|
compileOnly project(':dalvikdx')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task dexInJar(type: Jar) {
|
||||||
|
dependsOn jar
|
||||||
|
doFirst {
|
||||||
|
exec {
|
||||||
|
workingDir jar.destinationDir
|
||||||
|
executable "dx"
|
||||||
|
args "--dex", "--output", "classes.dex", "${jar.archiveName}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
from "${jar.destinationDir}/classes.dex"
|
||||||
|
destinationDir jar.destinationDir
|
||||||
|
baseName "eddexmaker"
|
||||||
|
onlyIf {
|
||||||
|
!jar.state.upToDate || !file(archiveName).exists()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@ dependencies {
|
||||||
|
|
||||||
preBuild.doLast {
|
preBuild.doLast {
|
||||||
def imlFile = file(project.name + ".iml")
|
def imlFile = file(project.name + ".iml")
|
||||||
println 'Change ' + project.name + '.iml order'
|
|
||||||
try {
|
try {
|
||||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,16 @@
|
||||||
import org.gradle.internal.os.OperatingSystem
|
import org.gradle.internal.os.OperatingSystem
|
||||||
|
|
||||||
apply plugin: 'com.android.library'
|
apply plugin: 'com.android.library'
|
||||||
|
|
||||||
version "v0.3.1.6_beta-SNAPSHOT"
|
version "v0.3.1.6_beta-SNAPSHOT"
|
||||||
extensions["module_name"] = "EdXposed"
|
|
||||||
|
ext {
|
||||||
|
module_name = "EdXposed"
|
||||||
|
jar_dest_dir = "${projectDir}/template_override/system/framework/"
|
||||||
|
is_windows = OperatingSystem.current().isWindows()
|
||||||
|
backends = ["Yahfa", "Sandhook", "Whale"]
|
||||||
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
compileSdkVersion 28
|
compileSdkVersion 28
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
|
|
@ -21,78 +30,68 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
task copyDalvikdxJar {
|
||||||
|
def jarTask = tasks.getByPath(':dalvikdx:dexInJar')
|
||||||
|
dependsOn jarTask
|
||||||
|
doLast {
|
||||||
|
copy {
|
||||||
|
from jarTask
|
||||||
|
into jar_dest_dir
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onlyIf {
|
||||||
|
!jarTask.state.upToDate || !file(jar_dest_dir + jarTask.archiveName).exists()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
task copyDexmakerJar {
|
||||||
|
def jarTask = tasks.getByPath(':dexmaker:dexInJar')
|
||||||
|
dependsOn jarTask
|
||||||
|
doLast {
|
||||||
|
copy {
|
||||||
|
from jarTask
|
||||||
|
into jar_dest_dir
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onlyIf {
|
||||||
|
!jarTask.state.upToDate || !file(jar_dest_dir + jarTask.archiveName).exists()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
|
|
||||||
android.libraryVariants.all { variant ->
|
android.libraryVariants.all { variant ->
|
||||||
def nameCapped = variant.name.capitalize()
|
|
||||||
def nameLowered = variant.name.toLowerCase()
|
|
||||||
|
|
||||||
def zipTask = task("zip${nameCapped}", type: Exec, dependsOn: ":edxp-yahfa:makeAndCopy${nameCapped}") {
|
def variantCapped = variant.name.capitalize()
|
||||||
|
def variantLowered = variant.name.toLowerCase()
|
||||||
|
|
||||||
|
backends.each { backend ->
|
||||||
|
|
||||||
|
def backendCapped = backend.capitalize()
|
||||||
|
def backendLowered = backend.toLowerCase()
|
||||||
|
|
||||||
|
def zipTask = task("zip${backendCapped}${variantCapped}", type: Exec) {
|
||||||
|
dependsOn copyDalvikdxJar, copyDexmakerJar
|
||||||
|
dependsOn tasks.getByPath(":edxp-${backendLowered}:makeAndCopy${variantCapped}")
|
||||||
workingDir '..'
|
workingDir '..'
|
||||||
commandLine 'sh', 'build.sh', \
|
commandLine 'sh', 'build.sh', project.name,
|
||||||
project.name, \
|
"${backendLowered}-${project.version}-${variantLowered}", "${module_name}"
|
||||||
"${project.version}-${nameLowered}", \
|
|
||||||
"${project.extensions['module_name']}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def pushTask = task("push${nameCapped}", type: Exec) {
|
task("push${backendCapped}${variantCapped}", type: Exec) {
|
||||||
|
dependsOn zipTask
|
||||||
workingDir 'release'
|
workingDir 'release'
|
||||||
def commands = ["adb", "push", "magisk-${project.extensions['module_name']}" +
|
def commands = ["adb", "push",
|
||||||
"-${project.version}-${nameLowered}.zip", "/sdcard/"]
|
"magisk-${module_name}-${backendLowered}-${project.version}-${variantLowered}.zip",
|
||||||
if (OperatingSystem.current().isWindows()) {
|
"/sdcard/"]
|
||||||
|
if (is_windows) {
|
||||||
commandLine 'cmd', '/c', commands.join(" ")
|
commandLine 'cmd', '/c', commands.join(" ")
|
||||||
} else {
|
} else {
|
||||||
commandLine commands
|
commandLine commands
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pushTask.dependsOn(zipTask)
|
|
||||||
|
|
||||||
|
|
||||||
zipTask = task("zipSandhook${nameCapped}", type: Exec, dependsOn: ":edxp-sandhook:makeAndCopy${nameCapped}") {
|
|
||||||
workingDir '..'
|
|
||||||
commandLine 'sh', 'build.sh', \
|
|
||||||
project.name, \
|
|
||||||
"Sandhook-${project.version}-${nameLowered}", \
|
|
||||||
"${project.extensions['module_name']}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
pushTask = task("pushSandhook${nameCapped}", type: Exec) {
|
|
||||||
workingDir 'release'
|
|
||||||
def commands = ["adb", "push", "magisk-${project.extensions['module_name']}-Sandhook" +
|
|
||||||
"-${project.version}-${nameLowered}.zip", "/sdcard/"]
|
|
||||||
if (OperatingSystem.current().isWindows()) {
|
|
||||||
commandLine 'cmd', '/c', commands.join(" ")
|
|
||||||
} else {
|
|
||||||
commandLine commands
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pushTask.dependsOn(zipTask)
|
|
||||||
|
|
||||||
zipTask = task("zipWhale${nameCapped}", type: Exec, dependsOn: ":edxp-whale:makeAndCopy${nameCapped}") {
|
|
||||||
workingDir '..'
|
|
||||||
commandLine 'sh', 'build.sh', \
|
|
||||||
project.name, \
|
|
||||||
"Whale-${project.version}-${nameLowered}", \
|
|
||||||
"${project.extensions['module_name']}"
|
|
||||||
}
|
|
||||||
|
|
||||||
pushTask = task("pushWhale${nameCapped}", type: Exec) {
|
|
||||||
workingDir 'release'
|
|
||||||
def commands = ["adb", "push", "magisk-${project.extensions['module_name']}-Whale" +
|
|
||||||
"-${project.version}-${nameLowered}.zip", "/sdcard/"]
|
|
||||||
if (OperatingSystem.current().isWindows()) {
|
|
||||||
commandLine 'cmd', '/c', commands.join(" ")
|
|
||||||
} else {
|
|
||||||
commandLine commands
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pushTask.dependsOn(zipTask)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -31,7 +31,6 @@ dependencies {
|
||||||
|
|
||||||
preBuild.doLast {
|
preBuild.doLast {
|
||||||
def imlFile = file(project.name + ".iml")
|
def imlFile = file(project.name + ".iml")
|
||||||
println 'Change ' + project.name + '.iml order'
|
|
||||||
try {
|
try {
|
||||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||||
|
|
@ -51,12 +50,13 @@ afterEvaluate {
|
||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
def nameCapped = variant.name.capitalize()
|
|
||||||
def nameLowered = variant.name.toLowerCase()
|
|
||||||
|
|
||||||
def makeAndCopyTask = task("makeAndCopy${nameCapped}", type: Jar, dependsOn: "assemble${nameCapped}") {
|
def variantNameCapped = variant.name.capitalize()
|
||||||
from "build/intermediates/dex/${nameLowered}/mergeDex${nameCapped}/out/"
|
def variantNameLowered = variant.name.toLowerCase()
|
||||||
destinationDir file("../edxp-core/template_override/system/framework/")
|
|
||||||
|
task("makeAndCopy${variantNameCapped}", type: Jar, dependsOn: "assemble${variantNameCapped}") {
|
||||||
|
from "${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}/out/"
|
||||||
|
destinationDir file(templateFrameworkPath)
|
||||||
baseName "edxp"
|
baseName "edxp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ dependencies {
|
||||||
|
|
||||||
preBuild.doLast {
|
preBuild.doLast {
|
||||||
def imlFile = file(project.name + ".iml")
|
def imlFile = file(project.name + ".iml")
|
||||||
println 'Change ' + project.name + '.iml order'
|
|
||||||
try {
|
try {
|
||||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||||
|
|
@ -49,12 +48,13 @@ afterEvaluate {
|
||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
def nameCapped = variant.name.capitalize()
|
|
||||||
def nameLowered = variant.name.toLowerCase()
|
|
||||||
|
|
||||||
def makeAndCopyTask = task("makeAndCopy${nameCapped}", type: Jar, dependsOn: "assemble${nameCapped}") {
|
def variantNameCapped = variant.name.capitalize()
|
||||||
from "build/intermediates/dex/${nameLowered}/mergeDex${nameCapped}/out/"
|
def variantNameLowered = variant.name.toLowerCase()
|
||||||
destinationDir file("../edxp-core/template_override/system/framework/")
|
|
||||||
|
task("makeAndCopy${variantNameCapped}", type: Jar, dependsOn: "assemble${variantNameCapped}") {
|
||||||
|
from "${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}/out/"
|
||||||
|
destinationDir file(templateFrameworkPath)
|
||||||
baseName "edxp"
|
baseName "edxp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,6 @@ dependencies {
|
||||||
|
|
||||||
preBuild.doLast {
|
preBuild.doLast {
|
||||||
def imlFile = file(project.name + ".iml")
|
def imlFile = file(project.name + ".iml")
|
||||||
println 'Change ' + project.name + '.iml order'
|
|
||||||
try {
|
try {
|
||||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||||
|
|
@ -50,12 +49,13 @@ afterEvaluate {
|
||||||
}
|
}
|
||||||
|
|
||||||
android.applicationVariants.all { variant ->
|
android.applicationVariants.all { variant ->
|
||||||
def nameCapped = variant.name.capitalize()
|
|
||||||
def nameLowered = variant.name.toLowerCase()
|
|
||||||
|
|
||||||
def makeAndCopyTask = task("makeAndCopy${nameCapped}", type: Jar, dependsOn: "assemble${nameCapped}") {
|
def variantNameCapped = variant.name.capitalize()
|
||||||
from "build/intermediates/dex/${nameLowered}/mergeDex${nameCapped}/out/"
|
def variantNameLowered = variant.name.toLowerCase()
|
||||||
destinationDir file("../edxp-core/template_override/system/framework/")
|
|
||||||
|
task("makeAndCopy${variantNameCapped}", type: Jar, dependsOn: "assemble${variantNameCapped}") {
|
||||||
|
from "${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}/out/"
|
||||||
|
destinationDir file(templateFrameworkPath)
|
||||||
baseName "edxp"
|
baseName "edxp"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,6 @@ android {
|
||||||
// as there doesn't seem to be any way to configure this in Android Studio.
|
// as there doesn't seem to be any way to configure this in Android Studio.
|
||||||
preBuild.doLast {
|
preBuild.doLast {
|
||||||
def imlFile = file(project.name + ".iml")
|
def imlFile = file(project.name + ".iml")
|
||||||
println 'Change ' + project.name + '.iml order'
|
|
||||||
try {
|
try {
|
||||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue