Update AGP

This commit is contained in:
topjohnwu 2024-06-10 17:13:04 -07:00
parent c99fbab72e
commit 6a68ae3869
4 changed files with 13 additions and 10 deletions

View File

@ -6,7 +6,7 @@ import java.net.URL
plugins {
id("java")
id("maven-publish")
id("com.android.library") version "8.1.1" apply false
id("com.android.library") version "8.4.2" apply false
}
val dlPackageList by tasks.registering {
@ -24,8 +24,8 @@ val dlPackageList by tasks.registering {
// Strip out empty lines
val packageList = bos.toString("UTF-8").replace("\n+".toRegex(), "\n")
rootProject.buildDir.mkdirs()
File(rootProject.buildDir, "package-list").outputStream().use {
rootProject.layout.buildDirectory.asFile.get().mkdirs()
rootProject.layout.buildDirectory.file("package-list").get().asFile.outputStream().use {
it.writer().write(packageList)
it.write("\n".toByteArray())
}
@ -39,11 +39,12 @@ val javadoc = (tasks["javadoc"] as Javadoc).apply {
exclude("**/internal/**")
(options as StandardJavadocDocletOptions).apply {
linksOffline = listOf(JavadocOfflineLink(
"https://developer.android.com/reference/", rootProject.buildDir.path))
"https://developer.android.com/reference/",
rootProject.layout.buildDirectory.asFile.get().path))
isNoDeprecated = true
addBooleanOption("-ignore-source-errors").value = true
}
setDestinationDir(File(rootProject.buildDir, "javadoc"))
setDestinationDir(rootProject.layout.buildDirectory.dir("javadoc").get().asFile)
}
val javadocJar by tasks.registering(Jar::class) {

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@ -18,10 +18,12 @@ android {
}
android.libraryVariants.all {
val jarTask = tasks.register("create${name.capitalize()}MainJar") {
val variantName = name
val variantCapped = variantName.replaceFirstChar { it.uppercaseChar() }
val jarTask = tasks.register("create${variantCapped}MainJar") {
doLast {
val classDir = Paths.get(buildDir.path, "intermediates",
"javac", this@all.name, "classes",
val classDir = Paths.get(layout.buildDirectory.get().asFile.path, "intermediates",
"javac", variantName, "compile${variantCapped}JavaWithJavac", "classes",
"com", "topjohnwu", "superuser", "internal")
val classFiles = Files.list(classDir).use { stream ->
@ -40,7 +42,7 @@ android.libraryVariants.all {
if (Files.notExists(output.parent))
Files.createDirectories(output.parent)
val pgConf = File(buildDir, "mainJar.pro")
val pgConf = layout.buildDirectory.file("mainJar.pro").get().asFile
PrintStream(pgConf.outputStream()).use {
it.println("-keep class com.topjohnwu.superuser.internal.RootServerMain")

Binary file not shown.