From 39e36e2c2517b1edd50255af9404bc006c72ee48 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 29 Sep 2023 17:37:07 -0400 Subject: [PATCH 1/4] modify build file for publishing --- build.gradle | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) diff --git a/build.gradle b/build.gradle index d9574306..6872549e 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,9 @@ plugins { id 'application' + id 'java-library' + id 'maven-publish' + id 'signing' id 'com.diffplug.spotless' version '6.18.0' id 'org.checkerframework' version '0.6.27' id("net.ltgt.errorprone") version "2.0.2" @@ -78,3 +81,69 @@ spotless { compileJava.dependsOn 'spotlessApply' check.dependsOn requireJavadoc + +// This groupId is just for temporal use +group = 'njit.edu' +version = '1.0' + + + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + mavenJava(MavenPublication) { + artifactId = 'Specimin' + from components.java + versionMapping { + usage('java-api') { + fromResolutionOf('runtimeClasspath') + } + usage('java-runtime') { + fromResolutionResult() + } + } + pom { + name = 'Specimin' + description = 'A specification minimizer for Java language' + url = '' + licenses { + license { + name = 'The Apache License, Version 2.0' + url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' + } + } + developers { + developer { + // I am not sure which id and email you would like to use + id = '' + name = 'Martin Kellogg' + email = '' + } + } + scm { + connection = 'scm:git:git@github.com:kelloggm/specimin.git' + developerConnection = 'scm:git:git@github.com:kelloggm/specimin.git' + url = '' + } + } + } + } + repositories { + maven { + // I think ultimately these urls should be the Maven repos, though I have no ideas how to create those repos + def releasesRepoUrl = layout.buildDirectory.dir('.') + def snapshotsRepoUrl = layout.buildDirectory.dir('.') + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + } + } +} + +javadoc { + if(JavaVersion.current().isJava9Compatible()) { + options.addBooleanOption('html5', true) + } +} From 2fda7201e125fbac2aecf3d8fdfb4e3671620feb Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Oct 2023 19:50:01 -0400 Subject: [PATCH 2/4] do local maven publishing --- build.gradle | 50 ++++++++------------------------------------------ 1 file changed, 8 insertions(+), 42 deletions(-) diff --git a/build.gradle b/build.gradle index 6872549e..ef02aab6 100644 --- a/build.gradle +++ b/build.gradle @@ -13,6 +13,7 @@ plugins { repositories { // Use Maven Central for resolving dependencies. mavenCentral() + mavenLocal() } application { @@ -93,51 +94,16 @@ java { withSourcesJar() } +// Add `mavenLocal()` in `repositories`, then run `./gradlew publishToMavenLocal` +// to publish Specimin to your local Maven repository. publishing { publications { - mavenJava(MavenPublication) { - artifactId = 'Specimin' + maven(MavenPublication) { + groupId = 'edu.njit.jerse' + artifactId = 'specimin' + version = '0.1' + from components.java - versionMapping { - usage('java-api') { - fromResolutionOf('runtimeClasspath') - } - usage('java-runtime') { - fromResolutionResult() - } - } - pom { - name = 'Specimin' - description = 'A specification minimizer for Java language' - url = '' - licenses { - license { - name = 'The Apache License, Version 2.0' - url = 'http://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - developers { - developer { - // I am not sure which id and email you would like to use - id = '' - name = 'Martin Kellogg' - email = '' - } - } - scm { - connection = 'scm:git:git@github.com:kelloggm/specimin.git' - developerConnection = 'scm:git:git@github.com:kelloggm/specimin.git' - url = '' - } - } - } - } - repositories { - maven { - // I think ultimately these urls should be the Maven repos, though I have no ideas how to create those repos - def releasesRepoUrl = layout.buildDirectory.dir('.') - def snapshotsRepoUrl = layout.buildDirectory.dir('.') - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl } } } From 1e5a28b62859ca9f15585f954cb6aab91cfe1836 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 2 Oct 2023 19:52:36 -0400 Subject: [PATCH 3/4] clarify the comments --- build.gradle | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index ef02aab6..736b98a4 100644 --- a/build.gradle +++ b/build.gradle @@ -94,8 +94,7 @@ java { withSourcesJar() } -// Add `mavenLocal()` in `repositories`, then run `./gradlew publishToMavenLocal` -// to publish Specimin to your local Maven repository. +// Run `./gradlew publishToMavenLocal` to publish Specimin to your local Maven repository. publishing { publications { maven(MavenPublication) { From 70fb00b4196da9ade2858ba6b423af2d8f44e25a Mon Sep 17 00:00:00 2001 From: Martin Kellogg Date: Tue, 3 Oct 2023 10:21:59 -0400 Subject: [PATCH 4/4] Remove unused code --- build.gradle | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.gradle b/build.gradle index 736b98a4..8aa2af4c 100644 --- a/build.gradle +++ b/build.gradle @@ -83,12 +83,6 @@ spotless { compileJava.dependsOn 'spotlessApply' check.dependsOn requireJavadoc -// This groupId is just for temporal use -group = 'njit.edu' -version = '1.0' - - - java { withJavadocJar() withSourcesJar()