build: switch to Gradle's maven-publish plugin

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-11-07 18:53:06 +05:30
parent e71b3d2583
commit 35f868733c
No known key found for this signature in database
GPG Key ID: 366D7BBAD1031E80
3 changed files with 45 additions and 52 deletions

View File

@ -4,7 +4,6 @@ buildscript {
agpVersion = '4.1.0' agpVersion = '4.1.0'
annotationsVersion = '1.1.0' annotationsVersion = '1.1.0'
appcompatVersion = '1.2.0' appcompatVersion = '1.2.0'
bintrayPluginVersion = '1.8.5'
biometricVersion = '1.1.0-beta01' biometricVersion = '1.1.0-beta01'
collectionVersion = '1.1.0' collectionVersion = '1.1.0'
constraintLayoutVersion = '2.0.2' constraintLayoutVersion = '2.0.2'
@ -19,7 +18,6 @@ buildscript {
kotlinVersion = '1.4.10' kotlinVersion = '1.4.10'
lifecycleRuntimeKtxVersion = '2.3.0-alpha07' lifecycleRuntimeKtxVersion = '2.3.0-alpha07'
materialComponentsVersion = '1.3.0-alpha03' materialComponentsVersion = '1.3.0-alpha03'
mavenPluginVersion = '2.1'
preferenceVersion = '1.1.1' preferenceVersion = '1.1.1'
zxingEmbeddedVersion = '3.6.0' zxingEmbeddedVersion = '3.6.0'
@ -28,8 +26,6 @@ buildscript {
dependencies { dependencies {
classpath "com.android.tools.build:gradle:$agpVersion" classpath "com.android.tools.build:gradle:$agpVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
classpath "com.github.dcendents:android-maven-gradle-plugin:$mavenPluginVersion"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$bintrayPluginVersion"
} }
repositories { repositories {
google() google()

View File

@ -46,6 +46,7 @@ android {
} }
lintOptions { lintOptions {
disable('LongLogTag') disable('LongLogTag')
disable('NewApi') // Desugaring!
} }
} }

View File

@ -1,53 +1,53 @@
apply plugin: 'com.github.dcendents.android-maven' apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
install { afterEvaluate {
repositories.mavenInstaller { publishing {
pom.project { publications {
name 'WireGuard Tunnel Library' release(MavenPublication) {
description 'Embeddable tunnel library for WireGuard for Android' groupId = groupName
url 'https://www.wireguard.com/' artifactId = 'tunnel'
version wireguardVersionName
packaging 'aar' artifact sourcesJar
groupId groupName artifact javadocJar
artifactId 'tunnel'
version wireguardVersionName
licenses { from components.getByName("release")
license {
name 'The Apache Software License, Version 2.0' pom {
url 'http://www.apache.org/licenses/LICENSE-2.0.txt' name = 'WireGuard Tunnel Library'
distribution 'repo' description = 'Embeddable tunnel library for WireGuard for Android'
url = 'https://www.wireguard.com/'
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.zx2c4.com/wireguard-android'
developerConnection = 'scm:git:https://git.zx2c4.com/wireguard-android'
url = 'https://git.zx2c4.com/wireguard-android'
}
developers {
organization {
name = 'WireGuard'
url = 'https://www.wireguard.com/'
}
}
} }
} }
scm {
connection 'scm:git:https://git.zx2c4.com/wireguard-android'
url 'https://git.zx2c4.com/wireguard-android'
}
organization {
name 'WireGuard'
url 'https://www.wireguard.com/'
}
} }
} repositories {
} maven {
name = "bintray"
bintray { url = uri("https://api.bintray.com/maven/wireguard/wireguard-android/wireguard-android/;publish=1;override=0")
user = hasProperty('BINTRAY_USER') ? getProperty('BINTRAY_USER') : System.getenv('BINTRAY_USER') credentials {
key = hasProperty('BINTRAY_KEY') ? getProperty('BINTRAY_KEY') : System.getenv('BINTRAY_KEY') username = hasProperty('BINTRAY_USER') ? getProperty('BINTRAY_USER') : System.getenv('BINTRAY_USER')
password = hasProperty('BINTRAY_KEY') ? getProperty('BINTRAY_KEY') : System.getenv('BINTRAY_KEY')
configurations = [ 'archives' ] }
}
pkg {
repo = 'wireguard-android'
name = 'wireguard-android'
userOrg = 'wireguard'
licenses = [ 'Apache-2.0' ]
vcsUrl = 'https://git.zx2c4.com/wireguard-android'
publish = true
version {
name = wireguardVersionName
} }
} }
} }
@ -68,9 +68,5 @@ android.libraryVariants.all { variant ->
archiveClassifier = 'sources' archiveClassifier = 'sources'
from android.sourceSets.main.java.srcDirs from android.sourceSets.main.java.srcDirs
} }
artifacts {
archives sourcesJar
archives javadocJar
}
} }
} }