Skip to content

Commit 35f8687

Browse files
committed
build: switch to Gradle's maven-publish plugin
Signed-off-by: Harsh Shandilya <[email protected]>
1 parent e71b3d2 commit 35f8687

File tree

3 files changed

+45
-52
lines changed

3 files changed

+45
-52
lines changed

build.gradle

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ buildscript {
44
agpVersion = '4.1.0'
55
annotationsVersion = '1.1.0'
66
appcompatVersion = '1.2.0'
7-
bintrayPluginVersion = '1.8.5'
87
biometricVersion = '1.1.0-beta01'
98
collectionVersion = '1.1.0'
109
constraintLayoutVersion = '2.0.2'
@@ -19,7 +18,6 @@ buildscript {
1918
kotlinVersion = '1.4.10'
2019
lifecycleRuntimeKtxVersion = '2.3.0-alpha07'
2120
materialComponentsVersion = '1.3.0-alpha03'
22-
mavenPluginVersion = '2.1'
2321
preferenceVersion = '1.1.1'
2422
zxingEmbeddedVersion = '3.6.0'
2523

@@ -28,8 +26,6 @@ buildscript {
2826
dependencies {
2927
classpath "com.android.tools.build:gradle:$agpVersion"
3028
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
31-
classpath "com.github.dcendents:android-maven-gradle-plugin:$mavenPluginVersion"
32-
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintrayPluginVersion"
3329
}
3430
repositories {
3531
google()

tunnel/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ android {
4646
}
4747
lintOptions {
4848
disable('LongLogTag')
49+
disable('NewApi') // Desugaring!
4950
}
5051
}
5152

tunnel/publish.gradle

Lines changed: 44 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,53 @@
1-
apply plugin: 'com.github.dcendents.android-maven'
2-
apply plugin: 'com.jfrog.bintray'
1+
apply plugin: 'maven-publish'
32

4-
install {
5-
repositories.mavenInstaller {
6-
pom.project {
7-
name 'WireGuard Tunnel Library'
8-
description 'Embeddable tunnel library for WireGuard for Android'
9-
url 'https://www.wireguard.com/'
3+
afterEvaluate {
4+
publishing {
5+
publications {
6+
release(MavenPublication) {
7+
groupId = groupName
8+
artifactId = 'tunnel'
9+
version wireguardVersionName
1010

11-
packaging 'aar'
12-
groupId groupName
13-
artifactId 'tunnel'
14-
version wireguardVersionName
11+
artifact sourcesJar
12+
artifact javadocJar
1513

16-
licenses {
17-
license {
18-
name 'The Apache Software License, Version 2.0'
19-
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
20-
distribution 'repo'
14+
from components.getByName("release")
15+
16+
pom {
17+
name = 'WireGuard Tunnel Library'
18+
description = 'Embeddable tunnel library for WireGuard for Android'
19+
url = 'https://www.wireguard.com/'
20+
21+
licenses {
22+
license {
23+
name = 'The Apache Software License, Version 2.0'
24+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
25+
distribution = 'repo'
26+
}
27+
}
28+
scm {
29+
connection = 'scm:git:https://git.zx2c4.com/wireguard-android'
30+
developerConnection = 'scm:git:https://git.zx2c4.com/wireguard-android'
31+
url = 'https://git.zx2c4.com/wireguard-android'
32+
}
33+
developers {
34+
organization {
35+
name = 'WireGuard'
36+
url = 'https://www.wireguard.com/'
37+
}
38+
}
2139
}
2240
}
23-
scm {
24-
connection 'scm:git:https://git.zx2c4.com/wireguard-android'
25-
url 'https://git.zx2c4.com/wireguard-android'
26-
}
27-
organization {
28-
name 'WireGuard'
29-
url 'https://www.wireguard.com/'
30-
}
3141
}
32-
}
33-
}
34-
35-
bintray {
36-
user = hasProperty('BINTRAY_USER') ? getProperty('BINTRAY_USER') : System.getenv('BINTRAY_USER')
37-
key = hasProperty('BINTRAY_KEY') ? getProperty('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
38-
39-
configurations = [ 'archives' ]
40-
41-
pkg {
42-
repo = 'wireguard-android'
43-
name = 'wireguard-android'
44-
userOrg = 'wireguard'
45-
licenses = [ 'Apache-2.0' ]
46-
vcsUrl = 'https://git.zx2c4.com/wireguard-android'
47-
publish = true
48-
49-
version {
50-
name = wireguardVersionName
42+
repositories {
43+
maven {
44+
name = "bintray"
45+
url = uri("https://api.bintray.com/maven/wireguard/wireguard-android/wireguard-android/;publish=1;override=0")
46+
credentials {
47+
username = hasProperty('BINTRAY_USER') ? getProperty('BINTRAY_USER') : System.getenv('BINTRAY_USER')
48+
password = hasProperty('BINTRAY_KEY') ? getProperty('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
49+
}
50+
}
5151
}
5252
}
5353
}
@@ -68,9 +68,5 @@ android.libraryVariants.all { variant ->
6868
archiveClassifier = 'sources'
6969
from android.sourceSets.main.java.srcDirs
7070
}
71-
artifacts {
72-
archives sourcesJar
73-
archives javadocJar
74-
}
7571
}
7672
}

0 commit comments

Comments
 (0)