Fix manager import patch build
This commit is contained in:
parent
6dda688adb
commit
14f1d046ab
|
|
@ -69,13 +69,13 @@ androidComponents.onVariants { variant ->
|
||||||
dependsOn("assemble$variantCapped")
|
dependsOn("assemble$variantCapped")
|
||||||
from("$buildDir/intermediates/dex/$variantLowered/mergeDex$variantCapped/classes.dex")
|
from("$buildDir/intermediates/dex/$variantLowered/mergeDex$variantCapped/classes.dex")
|
||||||
rename("classes.dex", "lsp.dex")
|
rename("classes.dex", "lsp.dex")
|
||||||
into("${rootProject.projectDir}/out/dexes")
|
into("${rootProject.projectDir}/out/assets/dex")
|
||||||
}
|
}
|
||||||
|
|
||||||
task<Copy>("copySo$variantCapped") {
|
task<Copy>("copySo$variantCapped") {
|
||||||
dependsOn("assemble$variantCapped")
|
dependsOn("assemble$variantCapped")
|
||||||
from("$buildDir/intermediates/merged_native_libs/$variantLowered/out/lib")
|
from("$buildDir/intermediates/merged_native_libs/$variantLowered/out/lib")
|
||||||
into("${rootProject.projectDir}/out/so")
|
into("${rootProject.projectDir}/out/assets/so")
|
||||||
}
|
}
|
||||||
|
|
||||||
task("copy$variantCapped") {
|
task("copy$variantCapped") {
|
||||||
|
|
@ -89,12 +89,12 @@ androidComponents.onVariants { variant ->
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(project(":daemon-service"))
|
compileOnly(projects.hiddenapiStubs)
|
||||||
implementation(project(":lspcore"))
|
implementation(projects.daemonService)
|
||||||
implementation(project(":hiddenapi-bridge"))
|
implementation(projects.lspcore)
|
||||||
compileOnly(project(":hiddenapi-stubs"))
|
implementation(projects.hiddenapiBridge)
|
||||||
implementation(project(":share"))
|
implementation(projects.share)
|
||||||
implementation(project(":imanager"))
|
implementation(projects.imanager)
|
||||||
|
|
||||||
implementation("com.google.code.gson:gson:2.8.9")
|
implementation("com.google.code.gson:gson:2.8.9")
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ androidComponents.onVariants { variant ->
|
||||||
dependsOn("assemble$variantCapped")
|
dependsOn("assemble$variantCapped")
|
||||||
from("$buildDir/intermediates/dex/$variantLowered/mergeDex$variantCapped/classes.dex")
|
from("$buildDir/intermediates/dex/$variantLowered/mergeDex$variantCapped/classes.dex")
|
||||||
rename("classes.dex", "loader.dex")
|
rename("classes.dex", "loader.dex")
|
||||||
into("${rootProject.projectDir}/out/dexes")
|
into("${rootProject.projectDir}/out/assets/dex")
|
||||||
}
|
}
|
||||||
|
|
||||||
task("copy$variantCapped") {
|
task("copy$variantCapped") {
|
||||||
|
|
@ -55,6 +55,7 @@ androidComponents.onVariants { variant ->
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
|
compileOnly(projects.hiddenapiStubs)
|
||||||
|
|
||||||
implementation("de.upb.cs.swt:axml:2.1.2")
|
implementation("de.upb.cs.swt:axml:2.1.2")
|
||||||
compileOnly(project(":hiddenapi-stubs"))
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ tasks.register<Delete>("clean") {
|
||||||
listOf("Debug", "Release").forEach { variant ->
|
listOf("Debug", "Release").forEach { variant ->
|
||||||
tasks.register("build$variant") {
|
tasks.register("build$variant") {
|
||||||
description = "Build LSPatch with $variant"
|
description = "Build LSPatch with $variant"
|
||||||
dependsOn(tasks.getByPath(":patch:build$variant"))
|
dependsOn(projects.patchJar.dependencyProject.tasks["build$variant"])
|
||||||
|
dependsOn(projects.manager.dependencyProject.tasks["build$variant"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,38 @@ android {
|
||||||
composeOptions {
|
composeOptions {
|
||||||
kotlinCompilerExtensionVersion = composeVersion
|
kotlinCompilerExtensionVersion = composeVersion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets["main"].assets.srcDirs(
|
||||||
|
projects.patch.dependencyProject.projectDir.resolve("src/main/assets"),
|
||||||
|
rootProject.projectDir.resolve("out/assets")
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
afterEvaluate {
|
||||||
|
android.applicationVariants.forEach { variant ->
|
||||||
|
val variantLowered = variant.name.toLowerCase()
|
||||||
|
val variantCapped = variant.name.capitalize()
|
||||||
|
|
||||||
|
task<Copy>("copy${variantCapped}Assets") {
|
||||||
|
dependsOn(":appstub:copy$variantCapped")
|
||||||
|
dependsOn(":app:copyRiru$variantCapped")
|
||||||
|
tasks["merge${variantCapped}Assets"].dependsOn(this)
|
||||||
|
|
||||||
|
into("$buildDir/intermediates/assets/$variantLowered/merge${variantCapped}Assets")
|
||||||
|
from("${rootProject.projectDir}/out/assets")
|
||||||
|
}
|
||||||
|
|
||||||
|
task<Copy>("build$variantCapped") {
|
||||||
|
dependsOn(tasks["assemble$variantCapped"])
|
||||||
|
from(variant.outputs.map { it.outputFile })
|
||||||
|
into("${rootProject.projectDir}/out")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compileOnly(project(":patch"))
|
implementation(projects.imanager)
|
||||||
implementation(project(":imanager"))
|
implementation(projects.patch)
|
||||||
|
|
||||||
implementation("androidx.core:core-ktx:1.7.0")
|
implementation("androidx.core:core-ktx:1.7.0")
|
||||||
implementation("androidx.activity:activity-compose:1.5.0-alpha01")
|
implementation("androidx.activity:activity-compose:1.5.0-alpha01")
|
||||||
|
|
@ -70,5 +97,4 @@ dependencies {
|
||||||
implementation("com.google.accompanist:accompanist-navigation-animation:0.24.2-alpha")
|
implementation("com.google.accompanist:accompanist-navigation-animation:0.24.2-alpha")
|
||||||
implementation("com.google.accompanist:accompanist-swiperefresh:0.24.2-alpha")
|
implementation("com.google.accompanist:accompanist-swiperefresh:0.24.2-alpha")
|
||||||
implementation("com.google.android.material:material:1.5.0")
|
implementation("com.google.android.material:material:1.5.0")
|
||||||
//implementation("dev.rikka.rikkax.material:material:2.1.0")
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
/build
|
||||||
|
|
@ -0,0 +1,51 @@
|
||||||
|
val androidSourceCompatibility: JavaVersion by rootProject.extra
|
||||||
|
val androidTargetCompatibility: JavaVersion by rootProject.extra
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id("java-library")
|
||||||
|
}
|
||||||
|
|
||||||
|
java {
|
||||||
|
sourceCompatibility = androidSourceCompatibility
|
||||||
|
targetCompatibility = androidTargetCompatibility
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
implementation(projects.patch)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.jar {
|
||||||
|
archiveBaseName.set("lspatch")
|
||||||
|
destinationDirectory.set(file("${rootProject.projectDir}/out"))
|
||||||
|
manifest {
|
||||||
|
attributes("Main-Class" to "org.lsposed.patch.LSPatch")
|
||||||
|
}
|
||||||
|
dependsOn(configurations.runtimeClasspath)
|
||||||
|
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
||||||
|
|
||||||
|
into("assets") {
|
||||||
|
from(projects.patch.dependencyProject.projectDir.resolve("src/main/assets"))
|
||||||
|
from("${rootProject.projectDir}/out/assets")
|
||||||
|
}
|
||||||
|
|
||||||
|
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "META-INF/*.MF", "META-INF/*.txt", "META-INF/versions/**")
|
||||||
|
}
|
||||||
|
|
||||||
|
val jar = tasks.jar.get()
|
||||||
|
|
||||||
|
tasks.register("buildDebug") {
|
||||||
|
jar.dependsOn(":appstub:copyDebug")
|
||||||
|
jar.dependsOn(":app:copyRiruDebug")
|
||||||
|
dependsOn(tasks.build)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.register("buildRelease") {
|
||||||
|
jar.dependsOn(":appstub:copyRelease")
|
||||||
|
jar.dependsOn(":app:copyRiruRelease")
|
||||||
|
dependsOn(tasks.build)
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks["build"].doLast {
|
||||||
|
println("Build to " + jar.archiveFile)
|
||||||
|
println("Try \'java -jar " + jar.archiveFileName + "\' find more help")
|
||||||
|
}
|
||||||
|
|
@ -12,57 +12,15 @@ java {
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation(fileTree("dir" to "libs", "include" to listOf("*.jar")))
|
implementation(fileTree("dir" to "libs", "include" to listOf("*.jar")))
|
||||||
implementation(project(":axmlprinter"))
|
implementation(projects.apkzlib)
|
||||||
implementation(project(":share"))
|
implementation(projects.axmlprinter)
|
||||||
implementation(project(":apkzlib"))
|
implementation(projects.share)
|
||||||
|
|
||||||
implementation("commons-io:commons-io:2.11.0")
|
implementation("commons-io:commons-io:2.11.0")
|
||||||
implementation("com.beust:jcommander:1.82")
|
implementation("com.beust:jcommander:1.82")
|
||||||
implementation("com.google.code.gson:gson:2.8.9")
|
implementation("com.google.code.gson:gson:2.8.9")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.jar {
|
|
||||||
archiveBaseName.set("lspatch")
|
|
||||||
destinationDirectory.set(file("${rootProject.projectDir}/out"))
|
|
||||||
manifest {
|
|
||||||
attributes("Main-Class" to "org.lsposed.patch.LSPatch")
|
|
||||||
}
|
|
||||||
dependsOn(configurations.runtimeClasspath)
|
|
||||||
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
|
|
||||||
|
|
||||||
from("src/main") {
|
|
||||||
include("assets/**")
|
|
||||||
}
|
|
||||||
|
|
||||||
into("assets/dex") {
|
|
||||||
from("${rootProject.projectDir}/out/dexes")
|
|
||||||
}
|
|
||||||
|
|
||||||
into("assets/so") {
|
|
||||||
from("${rootProject.projectDir}/out/so")
|
|
||||||
}
|
|
||||||
|
|
||||||
exclude("META-INF/*.SF", "META-INF/*.DSA", "META-INF/*.RSA", "META-INF/*.MF", "META-INF/*.txt", "META-INF/versions/**")
|
|
||||||
}
|
|
||||||
|
|
||||||
val jar = tasks.jar.get()
|
|
||||||
|
|
||||||
tasks.register("buildDebug") {
|
|
||||||
jar.dependsOn(":appstub:copyDebug")
|
|
||||||
jar.dependsOn(":app:copyRiruDebug")
|
|
||||||
dependsOn(tasks.build)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks.register("buildRelease") {
|
|
||||||
jar.dependsOn(":appstub:copyRelease")
|
|
||||||
jar.dependsOn(":app:copyRiruRelease")
|
|
||||||
dependsOn(tasks.build)
|
|
||||||
}
|
|
||||||
|
|
||||||
tasks["build"].doLast {
|
|
||||||
println("Build to " + jar.archiveFile)
|
|
||||||
println("Try \'java -jar " + jar.archiveFileName + "\' find more help")
|
|
||||||
}
|
|
||||||
|
|
||||||
sourceSets["main"].resources {
|
sourceSets["main"].resources {
|
||||||
srcDirs("src/main/java")
|
srcDirs("src/main/java")
|
||||||
include("**/*.*")
|
include("**/*.*")
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
rootProject.name = "LSPatch"
|
rootProject.name = "LSPatch"
|
||||||
|
|
||||||
|
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
||||||
|
|
||||||
include(":daemon-service")
|
include(":daemon-service")
|
||||||
include(":hiddenapi-bridge")
|
include(":hiddenapi-bridge")
|
||||||
include(":hiddenapi-stubs")
|
include(":hiddenapi-stubs")
|
||||||
|
|
@ -21,4 +23,5 @@ include(":axmlprinter")
|
||||||
include(":imanager")
|
include(":imanager")
|
||||||
include(":manager")
|
include(":manager")
|
||||||
include(":patch")
|
include(":patch")
|
||||||
|
include(":patch-jar")
|
||||||
include(":share")
|
include(":share")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue