2023-05-02 21:13:18 +02:00
|
|
|
@file:Suppress("UnstableApiUsage")
|
2023-05-05 03:09:38 +02:00
|
|
|
|
2023-05-02 21:13:18 +02:00
|
|
|
import org.gradle.api.tasks.testing.logging.TestLogEvent
|
|
|
|
|
2023-05-03 14:09:11 +02:00
|
|
|
val pkg: String = providers.gradleProperty("wireguardPackageName").get()
|
|
|
|
|
2023-05-02 21:13:18 +02:00
|
|
|
plugins {
|
|
|
|
alias(libs.plugins.android.library)
|
|
|
|
`maven-publish`
|
|
|
|
signing
|
|
|
|
}
|
|
|
|
|
|
|
|
android {
|
|
|
|
compileSdk = 33
|
|
|
|
compileOptions {
|
2023-05-03 14:01:05 +02:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
2023-05-03 14:09:11 +02:00
|
|
|
namespace = "${pkg}.tunnel"
|
2023-05-02 21:13:18 +02:00
|
|
|
defaultConfig {
|
|
|
|
minSdk = 21
|
|
|
|
}
|
|
|
|
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}")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
release {
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
2023-05-03 14:09:11 +02:00
|
|
|
arguments("-DANDROID_PACKAGE_NAME=${pkg}")
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
debug {
|
|
|
|
externalNativeBuild {
|
|
|
|
cmake {
|
2023-05-03 14:09:11 +02:00
|
|
|
arguments("-DANDROID_PACKAGE_NAME=${pkg}.debug")
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
lint {
|
2023-05-03 15:37:06 +02:00
|
|
|
disable += "LongLogTag"
|
|
|
|
disable += "NewApi"
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
|
|
|
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") {
|
2023-05-03 14:09:11 +02:00
|
|
|
groupId = pkg
|
2023-05-02 21:13:18 +02:00
|
|
|
artifactId = "tunnel"
|
|
|
|
version = providers.gradleProperty("wireguardVersionName").get()
|
|
|
|
afterEvaluate {
|
|
|
|
from(components["release"])
|
|
|
|
}
|
|
|
|
pom {
|
|
|
|
name.set("WireGuard Tunnel Library")
|
|
|
|
description.set("Embeddable tunnel library for WireGuard for Android")
|
|
|
|
url.set("https://www.wireguard.com/")
|
|
|
|
|
|
|
|
licenses {
|
|
|
|
license {
|
|
|
|
name.set("The Apache Software License, Version 2.0")
|
|
|
|
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
|
|
|
|
distribution.set("repo")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
scm {
|
|
|
|
connection.set("scm:git:https://git.zx2c4.com/wireguard-android")
|
|
|
|
developerConnection.set("scm:git:https://git.zx2c4.com/wireguard-android")
|
|
|
|
url.set("https://git.zx2c4.com/wireguard-android")
|
|
|
|
}
|
|
|
|
developers {
|
|
|
|
organization {
|
|
|
|
name.set("WireGuard")
|
|
|
|
url.set("https://www.wireguard.com/")
|
|
|
|
}
|
|
|
|
developer {
|
|
|
|
name.set("WireGuard")
|
|
|
|
email.set("team@wireguard.com")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
repositories {
|
|
|
|
maven {
|
|
|
|
name = "sonatype"
|
|
|
|
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
|
|
|
|
credentials {
|
2023-05-03 14:19:19 +02:00
|
|
|
username = providers.environmentVariable("SONATYPE_USER").orNull
|
|
|
|
password = providers.environmentVariable("SONATYPE_PASSWORD").orNull
|
2023-05-02 21:13:18 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
signing {
|
|
|
|
useGpgCmd()
|
|
|
|
sign(publishing.publications)
|
|
|
|
}
|