diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml new file mode 100644 index 00000000..6c6fa1c7 --- /dev/null +++ b/.github/workflows/gradle.yml @@ -0,0 +1,31 @@ +name: Build + +on: [push, pull_request] + +jobs: + build: + name: Build + runs-on: ubuntu-latest + env: + CI: true + steps: + - uses: actions/checkout@v1 + - name: Set up JDK 1.8 + uses: actions/setup-java@v1 + with: + java-version: 1.8 + - uses: actions/cache@v1 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - uses: actions/cache@v1 + with: + path: ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradlew') }} + restore-keys: | + ${{ runner.os }}-gradlew- + - uses: eskatos/gradle-command-action@v1 + with: + arguments: build -S diff --git a/README.adoc b/README.adoc index f9de736d..87c20b37 100644 --- a/README.adoc +++ b/README.adoc @@ -7,6 +7,7 @@ :project-version: 3.0.1 image:http://img.shields.io/travis/{project-owner}/{project-name}/master.svg["Build Status (travis)", link="https://travis-ci.org/{project-owner}/{project-name}"] +image:https://github.com/{project-owner}/{project-name}/workflows/Build/badge.svg["Build Status", link="https://github.com/{project-owner}/{project-name}/actions"] image:http://img.shields.io/badge/license-ASL2-blue.svg["ASL2 Licensed", link="http://opensource.org/licenses/ASL2"] image:https://api.bintray.com/packages/{project-owner}/{project-repo}/{project-name}/images/download.svg[link="https://bintray.com/{project-owner}/{project-repo}/{project-name}/_latestVersion"] image:https://img.shields.io/maven-central/v/{project-group}/{project-name}-core.svg[Download, link="https://search.maven.org/#search|ga|1|{project-name}"] diff --git a/build.gradle b/build.gradle index a56a0c1f..f55ba00e 100644 --- a/build.gradle +++ b/build.gradle @@ -16,7 +16,6 @@ * limitations under the License. */ plugins { - id 'org.kordamp.gradle.kordamp-parentpom' id 'org.kordamp.gradle.clirr' } diff --git a/subprojects/guide/guide.gradle b/docs/guide/guide.gradle similarity index 90% rename from subprojects/guide/guide.gradle rename to docs/guide/guide.gradle index 34b54415..9b17f68e 100644 --- a/subprojects/guide/guide.gradle +++ b/docs/guide/guide.gradle @@ -31,7 +31,7 @@ dependencies { asciidoctor { configurations 'asciidoctorExtensions' attributes = [ - 'gradle-version' : project.gradle.gradleVersion, - 'source-highlighter' : 'prettify' + 'gradle-version' : project.gradle.gradleVersion, + 'source-highlighter': 'prettify' ] } diff --git a/subprojects/guide/src/docs/asciidoc/_links.adoc b/docs/guide/src/docs/asciidoc/_links.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/_links.adoc rename to docs/guide/src/docs/asciidoc/_links.adoc diff --git a/subprojects/guide/src/docs/asciidoc/compatibility.adoc b/docs/guide/src/docs/asciidoc/compatibility.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/compatibility.adoc rename to docs/guide/src/docs/asciidoc/compatibility.adoc diff --git a/subprojects/guide/src/docs/asciidoc/configuration.adoc b/docs/guide/src/docs/asciidoc/configuration.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/configuration.adoc rename to docs/guide/src/docs/asciidoc/configuration.adoc diff --git a/subprojects/guide/src/docs/asciidoc/faq.adoc b/docs/guide/src/docs/asciidoc/faq.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/faq.adoc rename to docs/guide/src/docs/asciidoc/faq.adoc diff --git a/subprojects/guide/src/docs/asciidoc/groovy.adoc b/docs/guide/src/docs/asciidoc/groovy.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/groovy.adoc rename to docs/guide/src/docs/asciidoc/groovy.adoc diff --git a/subprojects/guide/src/docs/asciidoc/index.adoc b/docs/guide/src/docs/asciidoc/index.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/index.adoc rename to docs/guide/src/docs/asciidoc/index.adoc diff --git a/subprojects/guide/src/docs/asciidoc/introduction.adoc b/docs/guide/src/docs/asciidoc/introduction.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/introduction.adoc rename to docs/guide/src/docs/asciidoc/introduction.adoc diff --git a/subprojects/guide/src/docs/asciidoc/usage.adoc b/docs/guide/src/docs/asciidoc/usage.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/usage.adoc rename to docs/guide/src/docs/asciidoc/usage.adoc diff --git a/subprojects/guide/src/docs/asciidoc/users.adoc b/docs/guide/src/docs/asciidoc/users.adoc similarity index 100% rename from subprojects/guide/src/docs/asciidoc/users.adoc rename to docs/guide/src/docs/asciidoc/users.adoc diff --git a/subprojects/guide/src/javadoc/overview.html b/docs/guide/src/javadoc/overview.html similarity index 100% rename from subprojects/guide/src/javadoc/overview.html rename to docs/guide/src/javadoc/overview.html diff --git a/subprojects/guide/src/javadoc/resources/css/stylesheet.css b/docs/guide/src/javadoc/resources/css/stylesheet.css similarity index 100% rename from subprojects/guide/src/javadoc/resources/css/stylesheet.css rename to docs/guide/src/javadoc/resources/css/stylesheet.css diff --git a/subprojects/guide/src/resources/css/style.css b/docs/guide/src/resources/css/style.css similarity index 100% rename from subprojects/guide/src/resources/css/style.css rename to docs/guide/src/resources/css/style.css diff --git a/subprojects/guide/src/resources/images/logos/groovy-logo.png b/docs/guide/src/resources/images/logos/groovy-logo.png similarity index 100% rename from subprojects/guide/src/resources/images/logos/groovy-logo.png rename to docs/guide/src/resources/images/logos/groovy-logo.png diff --git a/gradle.properties b/gradle.properties index 0b3bce53..c6593121 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,17 +18,17 @@ group = org.kordamp.json version = 3.0.2-SNAPSHOT -sourceCompatibility = 1.7 -targetCompatibility = 1.7 +sourceCompatibility = 1.8 +targetCompatibility = 1.8 previousVersion = 3.0.1 commonsLangVersion = 3.9 commonsBeanutilsVersion = 1.9.3 junitVersion = 4.13 slf4jVersion = 1.7.30 -kordampPluginVersion = 0.31.2 -kordampPomVersion = 1.10.2 -gitPluginVersion = 0.3.2 +kordampPluginVersion = 0.34.0 +kordampBuildVersion = 1.0.0 +gitPluginVersion = 2.1.3 org.gradle.daemon = true org.gradle.caching = true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index cc4fdc29..490fda85 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 94920145..a4b44297 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.0.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 9618d8d9..62bd9b9c 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. 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" diff --git a/settings.gradle b/settings.gradle index da8b0d81..57adffcd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,26 +22,37 @@ pluginManagement { mavenLocal() } plugins { - id 'org.kordamp.gradle.kordamp-parentpom' version kordampPomVersion - id 'org.kordamp.gradle.clirr' version kordampPluginVersion - id 'org.kordamp.gradle.guide' version kordampPluginVersion - id 'org.ajoberstar.git-publish' version gitPluginVersion + id 'org.kordamp.gradle.clirr' version kordampPluginVersion + id 'org.kordamp.gradle.guide' version kordampPluginVersion + id 'org.ajoberstar.git-publish' version gitPluginVersion } } buildscript { repositories { gradlePluginPortal() + jcenter() mavenLocal() } dependencies { - classpath "org.kordamp.gradle:settings-gradle-plugin:$kordampPluginVersion" + classpath "org.kordamp.gradle:kordamp-parentbuild:$kordampBuildVersion" } } -apply plugin: 'org.kordamp.gradle.settings' +apply plugin: 'org.kordamp.gradle.kordamp-parentbuild' rootProject.name = 'json-lib' -projects { - directories = ['subprojects'] -} +enforce { + rule(enforcer.rules.ExcludeDependencies) { r -> + r.exclude('commons-logging:commons-logging') + r.exclude('org.slf4j:slf4j-compile') + } + rule(enforcer.rules.ForceDependencies) { r -> + r.dependencies.addAll 'xml-apis:xml-apis:2.0.2', + "org.apache.commons:commons-lang3:$commonsLangVersion", + "org.slf4j:slf4j-api:$slf4jVersion", + "junit:junit:$junitVersion", + "commons-beanutils:commons-beanutils:$commonsBeanutilsVersion", + "org.slf4j:jcl-over-slf4j:$slf4jVersion" + } +} \ No newline at end of file diff --git a/subprojects/json-lib-core/json-lib-core.gradle b/subprojects/json-lib-core/json-lib-core.gradle index 052a00ac..46dfa524 100644 --- a/subprojects/json-lib-core/json-lib-core.gradle +++ b/subprojects/json-lib-core/json-lib-core.gradle @@ -21,47 +21,23 @@ plugins { config { clirr { -// enabled = false baseline = [project.group, project.name, project.previousVersion].join(':') } } -configurations.all { - resolutionStrategy.force 'xml-apis:xml-apis:2.0.2', - "org.apache.commons:commons-lang3:$commonsLangVersion", - "org.slf4j:slf4j-api:$slf4jVersion", - "junit:junit:$junitVersion", - "commons-beanutils:commons-beanutils:$commonsBeanutilsVersion", - "org.slf4j:jcl-over-slf4j:$slf4jVersion" -} - dependencies { - def compileExcludingCommonsLogging = { String dependency -> - compile(dependency) { - exclude group: 'commons-logging', module: 'commons-logging' - } - } + api("junit:junit:$junitVersion") + api("commons-beanutils:commons-beanutils:$commonsBeanutilsVersion") + api('org.apache.commons:commons-collections4:4.4') + api("org.apache.commons:commons-lang3:$commonsLangVersion") - def testCompileExcludingCommonsLogging = { String dependency -> - testCompile(dependency) { - exclude group: 'commons-logging', module: 'commons-logging' - } - } - - compile("junit:junit:$junitVersion") - compileExcludingCommonsLogging("commons-beanutils:commons-beanutils:$commonsBeanutilsVersion") - compileExcludingCommonsLogging('org.apache.commons:commons-collections4:4.4') - compileExcludingCommonsLogging("org.apache.commons:commons-lang3:$commonsLangVersion") - - compile("org.slf4j:slf4j-api:$slf4jVersion") - compile("org.slf4j:jcl-over-slf4j:$slf4jVersion") { - exclude group: 'org.slf4j', module: 'slf4j-compile' - } + api("org.slf4j:slf4j-api:$slf4jVersion") + api("org.slf4j:jcl-over-slf4j:$slf4jVersion") // the following should be marked as optional - compileExcludingCommonsLogging('xom:xom:1.3.2') - compileExcludingCommonsLogging('org.kordamp.ezmorph:ezmorph-core:3.0.0') + api('xom:xom:1.3.2') + api('org.kordamp.ezmorph:ezmorph-core:3.0.0') - testCompileExcludingCommonsLogging('xmlunit:xmlunit:1.6') - testCompile('uk.org.lidalia:slf4j-test:1.2.0') + testImplementation('xmlunit:xmlunit:1.6') + testImplementation('uk.org.lidalia:slf4j-test:1.2.0') }