diff --git a/MAVEN-REPO.md b/MAVEN-REPO.md index 3e13994..2cc6ec6 100644 --- a/MAVEN-REPO.md +++ b/MAVEN-REPO.md @@ -24,24 +24,35 @@ Extract secret key for the Gradle signing plugin: $ gpg2 --export-secret-keys > secring.gpg ``` -## Build and publish to Central Repository +## Gradle build and publish to Central Repository + +> NOTE: The build has been updated to allow snapshots to be published. These appear to be automatically available. Ensure full build passes: ```bash -$ ./gradlew clean test javadoc assemble -<...lots of stuff, primarily Javadoc issues...> -BUILD SUCCESSFUL in 3s -13 actionable tasks: 13 executed + ./gradlew clean build + +BUILD SUCCESSFUL in 8s +91 actionable tasks: 91 executed ``` -Upload: +Publish: ```bash -$ ./gradlew uploadArchives +$ ./gradlew publish -BUILD SUCCESSFUL in 10s -10 actionable tasks: 1 executed, 9 up-to-date +BUILD SUCCESSFUL in 8s +2 actionable tasks: 2 executed +``` + +The can also be combined: + +```bash +$ ./gradlew clean build publish + +BUILD SUCCESSFUL in 16s +93 actionable tasks: 93 executed ``` Then follow "releasing the deployment" below. @@ -52,6 +63,7 @@ Just a reminder! # References -* http://central.sonatype.org/pages/gradle.html +* http://central.sonatype.org/pages/gradle.html (NOTE: Documentation is out of date) * http://central.sonatype.org/pages/releasing-the-deployment.html +* https://docs.gradle.org/current/userguide/publishing_maven.html * For all the other little pieces, Google is your friend. ;-) diff --git a/app/ac-cli/build.gradle b/app/ac-cli/build.gradle index 5e6e126..3eed5f5 100644 --- a/app/ac-cli/build.gradle +++ b/app/ac-cli/build.gradle @@ -23,6 +23,8 @@ application { } bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'ac' manifest { attributes 'Implementation-Title': "AppleCommander 'ac'", 'Implementation-Version': archiveVersion diff --git a/app/ac-swing/build.gradle b/app/ac-swing/build.gradle index 2a37f93..d49fcaa 100644 --- a/app/ac-swing/build.gradle +++ b/app/ac-swing/build.gradle @@ -16,6 +16,8 @@ application { } bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'swing-ui' manifest { attributes 'Implementation-Title': 'AppleCommander (Swing)', 'Implementation-Version': archiveVersion diff --git a/app/ac-swt-linux-aarch64/build.gradle b/app/ac-swt-linux-aarch64/build.gradle index b71fb4c..95aae48 100644 --- a/app/ac-swt-linux-aarch64/build.gradle +++ b/app/ac-swt-linux-aarch64/build.gradle @@ -20,6 +20,8 @@ application { } bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'linux-aarch64' manifest { attributes 'Implementation-Title': 'AppleCommander (Linux Arm)', 'Implementation-Version': archiveVersion diff --git a/app/ac-swt-linux-x86_64/build.gradle b/app/ac-swt-linux-x86_64/build.gradle index e509d9e..37beebd 100644 --- a/app/ac-swt-linux-x86_64/build.gradle +++ b/app/ac-swt-linux-x86_64/build.gradle @@ -20,6 +20,8 @@ application { } bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'linux-x86_64' manifest { attributes 'Implementation-Title': 'AppleCommander (Linux)', 'Implementation-Version': archiveVersion diff --git a/app/ac-swt-macosx-aarch64/build.gradle b/app/ac-swt-macosx-aarch64/build.gradle index 75e2bc1..c612bda 100644 --- a/app/ac-swt-macosx-aarch64/build.gradle +++ b/app/ac-swt-macosx-aarch64/build.gradle @@ -20,6 +20,8 @@ application { } bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'macosx-aarch64' manifest { attributes 'Implementation-Title': 'AppleCommander (Mac Arm)', 'Implementation-Version': archiveVersion diff --git a/app/ac-swt-macosx-x86_64/build.gradle b/app/ac-swt-macosx-x86_64/build.gradle index 92dc68c..5dc7277 100644 --- a/app/ac-swt-macosx-x86_64/build.gradle +++ b/app/ac-swt-macosx-x86_64/build.gradle @@ -20,6 +20,8 @@ application { } bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'macosx-x86_64' manifest { attributes 'Implementation-Title': 'AppleCommander (Mac)', 'Implementation-Version': archiveVersion diff --git a/app/ac-swt-win32-x86_64/build.gradle b/app/ac-swt-win32-x86_64/build.gradle index 14ed0ec..7a4feda 100644 --- a/app/ac-swt-win32-x86_64/build.gradle +++ b/app/ac-swt-win32-x86_64/build.gradle @@ -20,6 +20,8 @@ application { } bootJar { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'win32-x86_64' manifest { attributes 'Implementation-Title': 'AppleCommander (Windows)', 'Implementation-Version': archiveVersion diff --git a/gradle.properties b/gradle.properties index b5b20b4..9c8469d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # Universal AppleCommander version number. Used for: # - Naming JAR file. # - The build will insert this into a file that is read at run time as well. -version=1.7.0pre +version=1.7.0-SNAPSHOT # Dependency versions shkVersion=1.2.2 @@ -13,7 +13,3 @@ antVersion=1.8.2 commonsLang3Version=3.7 commonsCsvVersion=1.8 gsonVersion=2.8.6 - -# Maven Central Repository G and A of GAV coordinate. :-) -group=net.sf.applecommander -archivesBaseName=AppleCommander diff --git a/lib/ac-api/build.gradle b/lib/ac-api/build.gradle index 5852756..1d20ba3 100644 --- a/lib/ac-api/build.gradle +++ b/lib/ac-api/build.gradle @@ -1,5 +1,7 @@ plugins { id 'java-library' + id 'maven-publish' + id 'signing' } repositories { @@ -15,6 +17,8 @@ dependencies { } tasks.withType(Jar) { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'api' manifest { attributes 'Implementation-Title': 'AppleCommander', 'Implementation-Version': archiveVersion @@ -32,3 +36,51 @@ java { withSourcesJar() withJavadocJar() } + +signing { + sign configurations.archives +} + +publishing { + publications { + mavenJava(MavenPublication) { + from components.java + pom { + groupId = "net.sf.applecommander" + artifactId = "AppleCommander" + name = 'AppleCommander' + description = 'AppleCommander is a general utility for Apple II disk images.' + url = 'https://applecommander.github.io/' + licenses { + license { + name = 'The GNU General Public License (GPL) Version 2, June 1991' + url = 'https://www.gnu.org/licenses/gpl-2.0.html' + } + } + developers { + developer { + id = 'robgreene' + name = 'Rob Greene' + email = 'robgreene@gmail.com' + } + } + scm { + connection = 'scm:git:https://github.com/AppleCommander/AppleCommander.git' + developerConnection = 'scm:git:git@github.com:AppleCommander/AppleCommander.git' + url = 'https://github.com/AppleCommander/AppleCommander' + } + } + repositories { + maven { + def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2" + def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots/" + url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl + credentials { + username = findProperty('ossrhUsername') + password = findProperty('ossrhPassword') + } + } + } + } + } +} diff --git a/lib/ac-swt-common/build.gradle b/lib/ac-swt-common/build.gradle index 881529d..50bc60d 100644 --- a/lib/ac-swt-common/build.gradle +++ b/lib/ac-swt-common/build.gradle @@ -41,3 +41,8 @@ test { } } } + +tasks.withType(Jar) { + archiveBaseName = 'AppleCommander' + archiveAppendix = 'swt-common' +}