Files
wirevpn/tunnel/build.gradle.kts
T
Hermes (for frank) 646e617476
release / build (release) Canceled after 0s
Rebrand WireGuard Android to Wire VPN
- Rename package and all Java/Kotlin sources: com.wireguard.android -> page.onram.wirevpn
- applicationId -> page.onram.wirevpn, version 1.0.20260910 (520)
- New launcher icon: dark circle, white padlock with bold W
- App name 'Wire VPN' in all locales; remove donate preference
- Release signing from KEYSTORE_* env vars (CI)
- F-Droid v2: scripts/fdroid_metadata.py
- GitHub/Gitea Actions workflow: auto-build signed APK + F-Droid
  metadata/signature on every new release, attach to the release
- README + NOTICE (license inventory)
2026-09-12 17:04:15 +00:00

138 lines
4.2 KiB
Kotlin

@file:Suppress("UnstableApiUsage")
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.gradle.api.tasks.bundling.Zip
val pkg: String = providers.gradleProperty("wireguardPackageName").get()
plugins {
alias(libs.plugins.android.library)
`maven-publish`
}
android {
compileSdk = 36
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
namespace = "${pkg}.tunnel"
defaultConfig {
minSdk = 24
}
externalNativeBuild {
cmake {
path("tools/CMakeLists.txt")
}
}
testOptions.unitTests.all {
it.testLogging { events(TestLogEvent.PASSED, TestLogEvent.SKIPPED, TestLogEvent.FAILED) }
}
buildTypes {
all {
externalNativeBuild {
cmake {
targets("libwg-go.so", "libwg.so", "libwg-quick.so")
arguments("-DGRADLE_USER_HOME=${project.gradle.gradleUserHomeDir}")
arguments("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON")
}
}
}
release {
externalNativeBuild {
cmake {
arguments("-DANDROID_PACKAGE_NAME=${pkg}")
}
}
}
debug {
externalNativeBuild {
cmake {
arguments("-DANDROID_PACKAGE_NAME=${pkg}.debug")
}
}
}
}
lint {
disable += "LongLogTag"
disable += "NewApi"
}
publishing {
singleVariant("release") {
withJavadocJar()
withSourcesJar()
}
}
}
dependencies {
implementation(libs.androidx.annotation)
implementation(libs.androidx.collection)
compileOnly(libs.jsr305)
testImplementation(libs.junit)
}
publishing {
publications {
register<MavenPublication>("release") {
groupId = pkg
artifactId = "tunnel"
version = providers.gradleProperty("wireguardVersionName").get()
afterEvaluate {
from(components["release"])
}
pom {
name = "Wire VPN Tunnel Library"
description = "Embeddable tunnel library for Wire VPN for Android"
url = "https://git.obahan.xyz/frank/wirevpn"
licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
distribution = "repo"
}
}
scm {
connection = "scm:git:https://git.obahan.xyz/frank/wirevpn.git"
developerConnection = "scm:git:https://git.obahan.xyz/frank/wirevpn.git"
url = "https://git.obahan.xyz/frank/wirevpn"
}
developers {
organization {
name = "Wire VPN"
url = "https://git.obahan.xyz/frank/wirevpn"
}
developer {
name = "Wire VPN"
email = "frank@onram.page"
}
}
}
}
}
repositories {
maven {
name = "SonatypeUpload"
setUrl(layout.buildDirectory.dir("sonatype"))
}
}
}
val releasePublication = publishing.publications.named("release").get() as MavenPublication
val mavenGroupPath = releasePublication.groupId.replace('.', '/')
val mavenArtifactId = releasePublication.artifactId
val mavenVersion = releasePublication.version
tasks.register<Zip>("zipReleasePublication") {
dependsOn(tasks.named("publishReleasePublicationToSonatypeUploadRepository"))
group = "distribution"
description = "Zips the release publication in Maven repository layout."
val sourceDir = layout.buildDirectory.dir("sonatype/${mavenGroupPath}/${mavenArtifactId}/${mavenVersion}")
from(sourceDir)
archiveFileName.set("${mavenArtifactId}-${mavenVersion}-maven.zip")
destinationDirectory.set(layout.buildDirectory.dir("distributions"))
into("${mavenGroupPath}/${mavenArtifactId}/${mavenVersion}")
}