Update gradle to version 6.7
Use the Java Library plugin and switch to the new (non-deprecated)
syntax for declaring dependencies.
Various other cleanups/modernizations in build.gradle.
Change-Id: Ie091964955bc0fb9f3d7fe01572ffe1853b8f109
diff --git a/.gitignore b/.gitignore
index c4feb4c..f5d9e60 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,72 +1,59 @@
-# Created by https://www.gitignore.io
-
-### Maven ###
-target/
-pom.xml.tag
-pom.xml.releaseBackup
-pom.xml.versionsBackup
-pom.xml.next
-release.properties
-
-
-### Java ###
+# Java class files
*.class
-# Mobile Tools for Java (J2ME)
-.mtj.tmp/
-
-# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
-hs_err_pid*
-
-# Linux temporary files
-*~
-
-# Eclipse specific project files
-.classpath
-.project
-.settings
-
-# Netbeans specific project files
-nbactions.xml
-
-# generated files
+# Generated files
bin/
gen/
out/
-obj/
-build/
-app/src/*/libs/
-app/src/*/obj/
+
+# Gradle files
+.gradle
+**/build/
+!src/**/build/
+# Ignore Gradle GUI config
+gradle-app.setting
+# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
+!gradle-wrapper.jar
+# Cache of project
+.gradletasknamecache
# Local configuration file (sdk path, etc)
local.properties
+# Log Files
+*.log
+
+# Android Studio Navigation editor temp files
+.navigation/
+
# Eclipse project files
.classpath
.project
-# OSX files
-.DS_Store
-
-# Windows thumbnail db
-Thumbs.db
-
-# IDEA/Android Studio project files, because
-# the project can be imported from settings.gradle
-.idea
+# IntelliJ
*.iml
-nb-configuration.xml
-
-# Old-style IDEA project files
-*.ipr
-*.iws
-
-# Gradle cache
-.gradle
-gradle.properties
-
-# Sandbox stuff
-_sandbox
+.idea/workspace.xml
+.idea/tasks.xml
+.idea/gradle.xml
+.idea/assetWizardSettings.xml
+.idea/dictionaries
+.idea/libraries
+# Android Studio 3 in .gitignore file.
+.idea/caches
+.idea/modules.xml
+# Comment next line if keeping position of elements in Navigation Editor is relevant for you
+.idea/navEditor.xml
# Emacs stuff
prj.el
+
+# macOS
+.DS_Store
+.AppleDouble
+.LSOverride
+
+# Windows
+Thumbs.db
+Thumbs.db:encryptable
+ehthumbs.db
+ehthumbs_vista.db
diff --git a/AUTHORS.md b/AUTHORS.md
index 0f0b78f..ae52ff4 100644
--- a/AUTHORS.md
+++ b/AUTHORS.md
@@ -8,4 +8,5 @@
* ***(Former Maintainer)*** Andrew Brown <https://github.com/abrown>
* Eric Newberry <https://ericnewberry.com>
* Hans Pabst <https://www.linkedin.com/in/pabst>
+* Davide Pesavento <https://github.com/Pesa>
* Barry Pivitt <https://github.com/brpivitt>
diff --git a/build.gradle b/build.gradle
index 48d82bf..a827935 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,71 +1,53 @@
-buildscript {
- repositories {
- mavenLocal()
- jcenter()
- mavenCentral()
- }
-}
-
plugins {
- id 'java'
- id 'maven'
+ id 'java-library'
+ id 'maven' // TODO: migrate to 'maven-publish'
id 'signing'
//id 'checkstyle'
- id 'org.sonarqube' version '2.8'
- id 'net.saliman.cobertura' version '3.0.0'
+ id 'org.sonarqube' version '3.0'
+ id 'net.saliman.cobertura' version '4.0.0'
}
group = 'net.named-data.jndn-extra'
version = '1.2.0'
-sourceCompatibility = JavaVersion.VERSION_1_8
-targetCompatibility = JavaVersion.VERSION_1_8
-compileJava.options.encoding = 'UTF-8'
-
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven {
- url "https://oss.sonatype.org/content/repositories/releases/"
+ url 'https://oss.sonatype.org/content/repositories/releases'
}
}
-configurations {
- checkstyleConfig
-}
-
dependencies {
- compile 'net.named-data:jndn:0.24'
+ api 'net.named-data:jndn:0.24'
- testCompile 'junit:junit:4.12'
- testRuntime 'org.slf4j:slf4j-api:1.7.30'
-
- checkstyleConfig 'com.puppycrawl.tools:checkstyle:8.23'
+ testImplementation 'junit:junit:4.12'
+ testRuntimeOnly 'org.slf4j:slf4j-api:1.7.30'
}
-task javadocJar(type: Jar) {
- classifier = 'javadoc'
- from javadoc
-}
-
-task sourcesJar(type: Jar) {
- classifier = 'sources'
- from sourceSets.main.allSource
+java {
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
+ withJavadocJar()
+ withSourcesJar()
}
tasks.withType(JavaCompile) {
options.deprecation = true
+ options.encoding = 'UTF-8'
+}
+
+tasks.withType(Javadoc) {
+ options.addBooleanOption('Xdoclint:none', true)
}
tasks.withType(Test) {
- reports.html.destination = file("${reporting.baseDir}/${name}")
- testLogging {
- events "passed", "skipped", "failed"
- showStandardStreams = true
- exceptionFormat = "full"
- }
outputs.upToDateWhen { false }
+ testLogging {
+ events "passed", "failed", "skipped"
+ exceptionFormat "full"
+ }
}
tasks.withType(Checkstyle) {
@@ -75,12 +57,8 @@
}
}
-if (JavaVersion.current().isJava8Compatible()) {
- allprojects {
- tasks.withType(Javadoc) {
- options.addStringOption('Xdoclint:none', '-quiet')
- }
- }
+cobertura {
+ coverageFormats = ['html', 'xml']
}
artifacts {
@@ -148,7 +126,3 @@
}
}
}
-
-cobertura {
- coverageFormats = ['html', 'xml']
-}
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index f3d88b1..e708b1c 100644
--- a/gradle/wrapper/gradle-wrapper.jar
+++ b/gradle/wrapper/gradle-wrapper.jar
Binary files differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 1b16c34..be52383 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.1.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index 2fe81a7..4f906e0 100755
--- a/gradlew
+++ b/gradlew
@@ -82,6 +82,7 @@
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -129,6 +130,7 @@
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 24467a1..ac1b06f 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -29,6 +29,9 @@
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@@ -37,7 +40,7 @@
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.
@@ -51,7 +54,7 @@
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%
@@ -61,28 +64,14 @@
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
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