Skip to content

Commit 1da8981

Browse files
author
Mark Han
authored
Swap Wupdigital Publishing Plugin for Vanniktech (#244)
* Remove extra space in circle ci restore_cache checksum * Fix markdownlint errors * Disable daemon to prevent looping behavior in publish task - from readme of vanniktech/gradle-maven-publish-plugin * Remove extra deploy step in .yml * Swap out gradle maven publish plugin: wupdigital -> vanniktech * remove PORG prefixes, only needed if using env variable (not when -P passing) * Add mavenCentral to second repositories block * Adjust quotes in apply plugin * Update circleCI env variables for vanniktech plugin * Update AGP and Gradle to fix moshi resolution problem * Remove redundancy gradle.properties * Migrate to vanniktech plugin
1 parent 80c1e3c commit 1da8981

File tree

5 files changed

+45
-42
lines changed

5 files changed

+45
-42
lines changed

.circleci/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ jobs:
6969
if [ "${CIRCLE_BRANCH}" == "develop" ]; then
7070
echo "$MAVEN_CENTRAL_SEC_RING" | base64 -d > $HOME/secring.gpg
7171
gpg --import --batch $HOME/secring.gpg
72-
./gradlew clean publish -Psonatype.username="$SONATYPE_USERNAME" -Psonatype.password="$SONATYPE_PASSWORD" -Psigning.keyId=0E7A8B89 -Psigning.password="$MAVEN_CENTRAL_KEY_PASSPHRASE" -Psigning.secretKeyRingFile=$HOME/secring.gpg -Porg.gradle.parallel=false -Porg.gradle.daemon=false
72+
./gradlew publish -PORG_GRADLE_PROJECT_mavenCentralUsername="$SONATYPE_USERNAME" -PORG_GRADLE_PROJECT_mavenCentralPassword="$SONATYPE_PASSWORD" -Psigning.keyId=0E7A8B89 -Psigning.password="$MAVEN_CENTRAL_KEY_PASSPHRASE" -Psigning.secretKeyRingFile=$HOME/secring.gpg -Porg.gradle.parallel=false -Porg.gradle.daemon=false
7373
fi
7474
7575
workflows:

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,19 @@ buildscript {
2020

2121
repositories {
2222
google()
23-
jcenter()
23+
mavenCentral()
2424
}
2525

2626
dependencies {
27-
classpath 'com.android.tools.build:gradle:4.1.3'
28-
classpath 'digital.wup:android-maven-publish:3.6.2'
27+
classpath 'com.android.tools.build:gradle:7.3.1'
28+
classpath 'com.vanniktech:gradle-maven-publish-plugin:0.22.0'
2929
}
3030
}
3131

3232
allprojects {
3333
repositories {
3434
google()
35-
jcenter()
35+
mavenCentral()
3636
}
3737
}
3838

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ org.gradle.parallel=true
1818
# enable after fix https://github.com/gradle/gradle/issues/4848
1919
org.gradle.configureondemand=false
2020
android.useAndroidX=true
21-
android.enableJetifier=true
21+
android.enableJetifier=true
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Thu May 09 15:48:22 EDT 2019
1+
#Thu Oct 27 17:02:53 EDT 2022
22
distributionBase=GRADLE_USER_HOME
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
34
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
5-
zipStoreBase=GRADLE_USER_HOME
65
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

publish.gradle

+36-33
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
apply plugin: 'signing'
2-
apply plugin: 'digital.wup.android-maven-publish'
2+
apply plugin: 'com.vanniktech.maven.publish'
33

44
task sourcesJar(type: Jar) {
55
classifier = 'sources'
@@ -19,38 +19,45 @@ task javadocsJar(type: Jar) {
1919
def siteUrl = 'https://github.com/willowtreeapps/Hyperion-Android'
2020
def gitUrl = 'https://github.com/willowtreeapps/Hyperion-Android.git'
2121

22-
publishing {
23-
publications {
24-
lib(MavenPublication) {
25-
from components.android
26-
artifact sourcesJar
27-
artifact javadocsJar
22+
group = project.libraryGroup
23+
version = project.libraryVersion
2824

29-
pom {
30-
name = project.name
31-
description = 'App Debugging & Inspection Tool for Android'
32-
url = siteUrl
33-
licenses {
34-
license {
35-
name = 'The Apache Software License, Version 2.0'
36-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
37-
distribution = 'repo'
38-
}
39-
}
40-
developers {
41-
developer {
42-
id = 'kritarie'
43-
name = 'Sean Amos'
44-
}
45-
}
46-
scm {
47-
connection = gitUrl
48-
developerConnection = gitUrl
49-
url = siteUrl
50-
}
25+
mavenPublishing {
26+
// // True enables both closing and releasing the plugin https://github.com/vanniktech/gradle-maven-publish-plugin/blob/master/docs/central.md
27+
// ./gradlew publishAllPublicationsToMavenCentral
28+
// ./gradlew closeAndReleaseRepository
29+
// publishToMavenCentral("DEFAULT", true) to do both
30+
publishToMavenCentral("DEFAULT")
31+
signAllPublications()
32+
pom {
33+
// from components.android
34+
// artifact sourcesJar
35+
// artifact javadocsJar
36+
name = project.name
37+
description = 'App Debugging & Inspection Tool for Android'
38+
url = siteUrl
39+
licenses {
40+
license {
41+
name = 'The Apache Software License, Version 2.0'
42+
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
43+
distribution = 'repo'
44+
}
45+
}
46+
developers {
47+
developer {
48+
id = 'kritarie'
49+
name = 'Sean Amos'
5150
}
5251
}
52+
scm {
53+
connection = gitUrl
54+
developerConnection = gitUrl
55+
url = siteUrl
56+
}
5357
}
58+
}
59+
60+
publishing {
5461
repositories {
5562
maven {
5663
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
@@ -62,8 +69,4 @@ publishing {
6269
}
6370
}
6471
}
65-
}
66-
67-
signing {
68-
sign publishing.publications.lib
6972
}

0 commit comments

Comments
 (0)