Keep dalvikdx and dexmaker jars up-to-date automatically
This commit is contained in:
parent
2194551c39
commit
e1ccb12eac
|
|
@ -1,14 +1,14 @@
|
|||
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
||||
|
||||
buildscript {
|
||||
|
||||
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:3.3.2'
|
||||
|
||||
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
|
@ -16,6 +16,10 @@ buildscript {
|
|||
}
|
||||
|
||||
allprojects {
|
||||
ext {
|
||||
templateRootPath = project(":edxp-core").projectDir.path + "/template_override/"
|
||||
templateFrameworkPath = templateRootPath + "/system/framework/"
|
||||
}
|
||||
repositories {
|
||||
google()
|
||||
jcenter()
|
||||
|
|
|
|||
|
|
@ -6,3 +6,21 @@ dependencies {
|
|||
|
||||
sourceCompatibility = "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'
|
||||
|
||||
description = "A utility for doing compile or runtime code generation targeting Android's Dalvik VM"
|
||||
|
|
@ -21,10 +9,23 @@ repositories {
|
|||
jcenter()
|
||||
}
|
||||
|
||||
tasks.withType(JavaCompile) {
|
||||
options.compilerArgs += ["-Xep:StringSplitter:OFF"]
|
||||
}
|
||||
|
||||
dependencies {
|
||||
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 {
|
||||
def imlFile = file(project.name + ".iml")
|
||||
println 'Change ' + project.name + '.iml order'
|
||||
try {
|
||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,16 @@
|
|||
import org.gradle.internal.os.OperatingSystem
|
||||
|
||||
apply plugin: 'com.android.library'
|
||||
|
||||
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 {
|
||||
compileSdkVersion 28
|
||||
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 {
|
||||
|
||||
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}") {
|
||||
workingDir '..'
|
||||
commandLine 'sh', 'build.sh', \
|
||||
project.name, \
|
||||
"${project.version}-${nameLowered}", \
|
||||
"${project.extensions['module_name']}"
|
||||
}
|
||||
def variantCapped = variant.name.capitalize()
|
||||
def variantLowered = variant.name.toLowerCase()
|
||||
|
||||
def pushTask = task("push${nameCapped}", type: Exec) {
|
||||
workingDir 'release'
|
||||
def commands = ["adb", "push", "magisk-${project.extensions['module_name']}" +
|
||||
"-${project.version}-${nameLowered}.zip", "/sdcard/"]
|
||||
if (OperatingSystem.current().isWindows()) {
|
||||
commandLine 'cmd', '/c', commands.join(" ")
|
||||
} else {
|
||||
commandLine commands
|
||||
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 '..'
|
||||
commandLine 'sh', 'build.sh', project.name,
|
||||
"${backendLowered}-${project.version}-${variantLowered}", "${module_name}"
|
||||
}
|
||||
|
||||
task("push${backendCapped}${variantCapped}", type: Exec) {
|
||||
dependsOn zipTask
|
||||
workingDir 'release'
|
||||
def commands = ["adb", "push",
|
||||
"magisk-${module_name}-${backendLowered}-${project.version}-${variantLowered}.zip",
|
||||
"/sdcard/"]
|
||||
if (is_windows) {
|
||||
commandLine 'cmd', '/c', commands.join(" ")
|
||||
} else {
|
||||
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 {
|
||||
def imlFile = file(project.name + ".iml")
|
||||
println 'Change ' + project.name + '.iml order'
|
||||
try {
|
||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||
|
|
@ -51,12 +50,13 @@ afterEvaluate {
|
|||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
def nameCapped = variant.name.capitalize()
|
||||
def nameLowered = variant.name.toLowerCase()
|
||||
|
||||
def makeAndCopyTask = task("makeAndCopy${nameCapped}", type: Jar, dependsOn: "assemble${nameCapped}") {
|
||||
from "build/intermediates/dex/${nameLowered}/mergeDex${nameCapped}/out/"
|
||||
destinationDir file("../edxp-core/template_override/system/framework/")
|
||||
def variantNameCapped = variant.name.capitalize()
|
||||
def variantNameLowered = variant.name.toLowerCase()
|
||||
|
||||
task("makeAndCopy${variantNameCapped}", type: Jar, dependsOn: "assemble${variantNameCapped}") {
|
||||
from "${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}/out/"
|
||||
destinationDir file(templateFrameworkPath)
|
||||
baseName "edxp"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ dependencies {
|
|||
|
||||
preBuild.doLast {
|
||||
def imlFile = file(project.name + ".iml")
|
||||
println 'Change ' + project.name + '.iml order'
|
||||
try {
|
||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||
|
|
@ -49,12 +48,13 @@ afterEvaluate {
|
|||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
def nameCapped = variant.name.capitalize()
|
||||
def nameLowered = variant.name.toLowerCase()
|
||||
|
||||
def makeAndCopyTask = task("makeAndCopy${nameCapped}", type: Jar, dependsOn: "assemble${nameCapped}") {
|
||||
from "build/intermediates/dex/${nameLowered}/mergeDex${nameCapped}/out/"
|
||||
destinationDir file("../edxp-core/template_override/system/framework/")
|
||||
def variantNameCapped = variant.name.capitalize()
|
||||
def variantNameLowered = variant.name.toLowerCase()
|
||||
|
||||
task("makeAndCopy${variantNameCapped}", type: Jar, dependsOn: "assemble${variantNameCapped}") {
|
||||
from "${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}/out/"
|
||||
destinationDir file(templateFrameworkPath)
|
||||
baseName "edxp"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,7 +30,6 @@ dependencies {
|
|||
|
||||
preBuild.doLast {
|
||||
def imlFile = file(project.name + ".iml")
|
||||
println 'Change ' + project.name + '.iml order'
|
||||
try {
|
||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||
|
|
@ -50,12 +49,13 @@ afterEvaluate {
|
|||
}
|
||||
|
||||
android.applicationVariants.all { variant ->
|
||||
def nameCapped = variant.name.capitalize()
|
||||
def nameLowered = variant.name.toLowerCase()
|
||||
|
||||
def makeAndCopyTask = task("makeAndCopy${nameCapped}", type: Jar, dependsOn: "assemble${nameCapped}") {
|
||||
from "build/intermediates/dex/${nameLowered}/mergeDex${nameCapped}/out/"
|
||||
destinationDir file("../edxp-core/template_override/system/framework/")
|
||||
def variantNameCapped = variant.name.capitalize()
|
||||
def variantNameLowered = variant.name.toLowerCase()
|
||||
|
||||
task("makeAndCopy${variantNameCapped}", type: Jar, dependsOn: "assemble${variantNameCapped}") {
|
||||
from "${buildDir}/intermediates/dex/${variantNameLowered}/mergeDex${variantNameCapped}/out/"
|
||||
destinationDir file(templateFrameworkPath)
|
||||
baseName "edxp"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ android {
|
|||
// as there doesn't seem to be any way to configure this in Android Studio.
|
||||
preBuild.doLast {
|
||||
def imlFile = file(project.name + ".iml")
|
||||
println 'Change ' + project.name + '.iml order'
|
||||
try {
|
||||
def parsedXml = (new groovy.util.XmlParser()).parse(imlFile)
|
||||
def jdkNode = parsedXml.component[1].orderEntry.find { it.'@type' == 'jdk' }
|
||||
|
|
|
|||
Loading…
Reference in New Issue