diff --git a/build.gradle b/build.gradle index 0910c36..e99c20d 100644 --- a/build.gradle +++ b/build.gradle @@ -4,11 +4,11 @@ plugins { id 'jacoco' id 'maven-publish' id 'pmd' - id 'com.jfrog.bintray' version '1.8.5' - id 'com.github.ben-manes.versions' version '0.28.0' + id 'signing' + id 'com.github.ben-manes.versions' version '0.38.0' id 'net.thauvin.erik.gradle.semver' version '1.0.4' - id 'com.github.spotbugs' version '4.4.4' - id 'org.sonarqube' version '3.0' + id 'com.github.spotbugs' version '4.7.0' + id 'org.sonarqube' version '3.1.1' } import com.github.spotbugs.snom.SpotBugsTask @@ -26,30 +26,25 @@ final def mavenLicenseUrl = 'http://opensource.org/licenses/BSD-3-Clause' final def mavenScmCon = 'https://github.com/ethauvin/semver.git' final def mavenScmDevCon = 'git@github.com:ethauvin/semver.git' -final def pkgLicenses = ['BSD 3-Clause'] -final def pkgIssueTrackerUrl = mavenUrl + '/issues' -final def pkgLabels = ['java', 'kotlin', 'annotation', 'processor', 'semantic', 'version'] - ext.versions = [ - spotbugs: '4.0.6' + spotbugs: '4.2.2' ] repositories { mavenLocal() - jcenter() mavenCentral() } dependencies { - implementation 'com.github.spullara.mustache.java:compiler:0.9.6' + implementation 'com.github.spullara.mustache.java:compiler:0.9.7' - spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.10.1' + spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.11.0' spotbugsPlugins 'com.mebigfatguy.sb-contrib:sb-contrib:7.4.7' compileOnly "com.github.spotbugs:spotbugs-annotations:$versions.spotbugs" testCompileOnly "com.github.spotbugs:spotbugs-annotations:$versions.spotbugs" - testImplementation 'org.testng:testng:7.2.0' + testImplementation 'org.testng:testng:7.4.0' } @@ -60,6 +55,8 @@ tasks.withType(JavaCompile) { java { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 + withSourcesJar() + withJavadocJar() } pmd { @@ -69,60 +66,10 @@ pmd { consoleOutput = true } -bintray { - user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER') - key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_API_KEY') - publications = ['MyPublication'] - dryRun = false - pkg { - repo = 'maven' - name = mavenName - licenses = pkgLicenses - desc = mavenDescription - //released = new Date() - websiteUrl = mavenUrl - issueTrackerUrl = pkgIssueTrackerUrl - vcsUrl = mavenScmCon - labels = pkgLabels - publicDownloadNumbers = true - version { - gpg { sign = true } - } - } -} - -bintrayUpload { - versionName = "$project.version" - versionDesc = "$mavenName $project.version" - versionVcsTag = "$project.version" - versionReleased = new Date() -} - -task javadocJar(type: Jar, dependsOn: javadoc) { - group = 'Build' - description = 'Builds an archive of the javadoc docs.' - archiveClassifier.set('javadoc') - from javadoc.destinationDir -} - -task sourceJar(type: Jar) { - group = 'Build' - description = 'Builds an archive of the source code.' - archiveClassifier.set('sources') - from sourceSets.main.allSource -} - -artifacts { - archives javadocJar - archives sourceJar -} - publishing { publications { - MyPublication(MavenPublication) { + mavenJava(MavenPublication) { from components.java - artifact sourceJar - artifact javadocJar groupId project.group artifactId rootProject.name @@ -134,7 +81,6 @@ publishing { license { name = mavenLicense url = mavenLicenseUrl - distribution = 'repo' } } developers { @@ -142,16 +88,29 @@ publishing { id = 'ethauvin' name = 'Erik C. Thauvin' email = 'erik@thauvin.net' + url = 'https://erik.thauvin.net/' } } scm { connection = "scm:git:" + mavenScmCon developerConnection = "scm:git:" + mavenScmDevCon - url = mavenScmCon + url = mavenUrl } } } } + repositories { + maven { + name = "ossrh" + url = "https://oss.sonatype.org/service/local/staging/deploy/maven2/" + credentials(PasswordCredentials) + } + } +} + +signing { + useGpgCmd() + sign publishing.publications.mavenJava } javadoc { @@ -224,7 +183,6 @@ jacocoTestReport { html.enabled = true xml.enabled = true } - } sonarqube { diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 62d4c05..e708b1c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index bb8b2fc..442d913 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index fbd7c51..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -130,7 +130,7 @@ fi if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then APP_HOME=`cygpath --path --mixed "$APP_HOME"` CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` - + JAVACMD=`cygpath --unix "$JAVACMD"` # We build the pattern for arguments to be converted via cygpath diff --git a/gradlew.bat b/gradlew.bat index 5093609..107acd3 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -40,7 +40,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome set JAVA_EXE=java.exe %JAVA_EXE% -version >NUL 2>&1 -if "%ERRORLEVEL%" == "0" goto init +if "%ERRORLEVEL%" == "0" goto execute echo. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. @@ -54,7 +54,7 @@ goto fail set JAVA_HOME=%JAVA_HOME:"=% set JAVA_EXE=%JAVA_HOME%/bin/java.exe -if exist "%JAVA_EXE%" goto init +if exist "%JAVA_EXE%" goto execute echo. echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% @@ -64,21 +64,6 @@ echo location of your Java installation. goto fail -:init -@rem Get command-line arguments, handling Windows variants - -if not "%OS%" == "Windows_NT" goto win9xME_args - -:win9xME_args -@rem Slurp the command line arguments. -set CMD_LINE_ARGS= -set _SKIP=2 - -:win9xME_args_slurp -if "x%~1" == "x" goto execute - -set CMD_LINE_ARGS=%* - :execute @rem Setup the command line @@ -86,7 +71,7 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* :end @rem End local scope for the variables with windows NT shell