Skip to content

Commit 4370059

Browse files
committed
gradle: reabstract package name
Signed-off-by: Jason A. Donenfeld <[email protected]>
1 parent ef2ca95 commit 4370059

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

gradle.properties

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
wireguardVersionCode=501
2+
wireguardVersionName=1.0.20230502
3+
wireguardPackageName=com.wireguard.android
4+
15
# When configured, Gradle will run in incubating parallel mode.
26
# This option should only be used with decoupled projects. More details, visit
37
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
@@ -63,9 +67,6 @@ android.suppressUnsupportedOptionWarnings=android.keepWorkerActionServicesBetwee
6367
android.enableAppCompileTimeRClass,\
6468
android.suppressUnsupportedOptionWarnings
6569

66-
wireguardVersionCode=501
67-
wireguardVersionName=1.0.20230502
68-
6970
# OSSRH sometimes struggles with slow deployments, so this makes Gradle
7071
# more tolerant to those delays.
7172
systemProp.org.gradle.internal.http.connectionTimeout=500000

tunnel/build.gradle.kts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
@file:Suppress("UnstableApiUsage")
22
import org.gradle.api.tasks.testing.logging.TestLogEvent
33

4+
val pkg: String = providers.gradleProperty("wireguardPackageName").get()
5+
46
plugins {
57
alias(libs.plugins.android.library)
68
`maven-publish`
@@ -13,7 +15,7 @@ android {
1315
sourceCompatibility = JavaVersion.VERSION_17
1416
targetCompatibility = JavaVersion.VERSION_17
1517
}
16-
namespace = "com.wireguard.android.tunnel"
18+
namespace = "${pkg}.tunnel"
1719
defaultConfig {
1820
minSdk = 21
1921
}
@@ -37,14 +39,14 @@ android {
3739
release {
3840
externalNativeBuild {
3941
cmake {
40-
arguments("-DANDROID_PACKAGE_NAME=com.wireguard.android")
42+
arguments("-DANDROID_PACKAGE_NAME=${pkg}")
4143
}
4244
}
4345
}
4446
debug {
4547
externalNativeBuild {
4648
cmake {
47-
arguments("-DANDROID_PACKAGE_NAME=com.wireguard.android.debug")
49+
arguments("-DANDROID_PACKAGE_NAME=${pkg}.debug")
4850
}
4951
}
5052
}
@@ -71,7 +73,7 @@ dependencies {
7173
publishing {
7274
publications {
7375
register<MavenPublication>("release") {
74-
groupId = "com.wireguard.android"
76+
groupId = pkg
7577
artifactId = "tunnel"
7678
version = providers.gradleProperty("wireguardVersionName").get()
7779
afterEvaluate {

ui/build.gradle.kts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
33
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
44

5+
val pkg: String = providers.gradleProperty("wireguardPackageName").get()
6+
57
plugins {
68
alias(libs.plugins.android.application)
79
alias(libs.plugins.kotlin.android)
@@ -15,9 +17,9 @@ android {
1517
dataBinding = true
1618
viewBinding = true
1719
}
18-
namespace = "com.wireguard.android"
20+
namespace = pkg
1921
defaultConfig {
20-
applicationId = "com.wireguard.android"
22+
applicationId = pkg
2123
minSdk = 21
2224
targetSdk = 33
2325
versionCode = providers.gradleProperty("wireguardVersionCode").get().toInt()

0 commit comments

Comments
 (0)