forked from ReVanced/revanced-manager-downloaders
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
111 lines (95 loc) · 3.73 KB
/
build.gradle.kts
File metadata and controls
111 lines (95 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
import com.android.build.gradle.AppExtension
import com.android.build.gradle.internal.api.ApkVariantOutputImpl
import org.gradle.plugins.signing.SigningExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.parcelize) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose.compiler) apply false
}
subprojects {
repositories {
google()
mavenCentral()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/registry")
credentials {
username = providers.gradleProperty("gpr.user")
.getOrElse(System.getenv("GITHUB_ACTOR"))
password =
providers.gradleProperty("gpr.key").getOrElse(System.getenv("GITHUB_TOKEN"))
}
}
}
if (project.path.startsWith(":downloaders:")) {
apply(plugin = "com.android.application")
apply(plugin = "org.jetbrains.kotlin.android")
apply(plugin = "maven-publish")
apply(plugin = "signing")
dependencies {
"compileOnly"(rootProject.libs.plugin.api)
}
configure<AppExtension> {
compileSdkVersion(35)
defaultConfig {
minSdk = 26
targetSdk = 35
versionName = version.toString()
versionCode = versionName!!.filter { it.isDigit() }.toInt()
}
buildTypes {
getByName("release") {
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
val keystoreFile = file("${rootDir}/keystore.jks")
signingConfig =
if (keystoreFile.exists()) {
signingConfigs.create("release") {
storeFile = keystoreFile
storePassword = System.getenv("KEYSTORE_PASSWORD")
keyAlias = System.getenv("KEYSTORE_ENTRY_ALIAS")
keyPassword = System.getenv("KEYSTORE_ENTRY_PASSWORD")
}
} else {
signingConfigs.getByName("debug")
}
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
applicationVariants.all {
outputs.all {
this as ApkVariantOutputImpl
outputFileName = "revanced-manager-${project.name}-downloader-$version.apk"
}
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "17"
}
}
tasks.register("assembleReleaseSignApk") {
dependsOn("assembleRelease")
val apk = layout.buildDirectory.file("outputs/apk/release/revanced-manager-${project.name}-downloader-$version.apk")
inputs.file(apk).withPropertyName("input")
outputs.file(apk.map { it.asFile.resolveSibling("${it.asFile.name}.asc") })
doLast {
project.configure<SigningExtension> {
useGpgCmd()
sign(*inputs.files.files.toTypedArray())
}
}
}
tasks.named("publish") {
dependsOn("assembleReleaseSignApk")
}
}
}