diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index b3fe2bc..d21cba4 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1 +1,2 @@ patreon: aalmiray +github: aalmiray diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 6c6fa1c..b74524b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -1,3 +1,21 @@ +# +# SPDX-License-Identifier: Apache-2.0 +# +# Copyright 2013-2021 Andres Almiray +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + name: Build on: [push, pull_request] @@ -9,23 +27,26 @@ jobs: env: CI: true steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2.3.4 + - name: Set up JDK 1.8 - uses: actions/setup-java@v1 + uses: actions/setup-java@v1.4.3 with: java-version: 1.8 - - uses: actions/cache@v1 + + - uses: actions/cache@v2.1.4 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }} restore-keys: | ${{ runner.os }}-gradle- - - uses: actions/cache@v1 + + - uses: actions/cache@v2.1.4 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 + + - name: Build + run: ./gradlew build -S diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index e65fa27..0000000 --- a/.travis.yml +++ /dev/null @@ -1,21 +0,0 @@ -language: java - -jdk: openjdk8 - -install: true - -before_cache: - - rm -f $HOME/.gradle/caches/modules-2/modules-2.lock - -cache: - directories: - - $HOME/.m2/ - - $HOME/.gradle/caches/ - - $HOME/.gradle/wrapper/ - -before_script: - - ./gradlew --version - -script: ./gradlew build -S - -env: TERM=dumb diff --git a/README.adoc b/README.adoc index 4862fe3..8a88e84 100644 --- a/README.adoc +++ b/README.adoc @@ -2,19 +2,14 @@ :author: Andres Almiray :linkattrs: :project-owner: kordamp -:project-repo: maven :project-name: gipsy :project-group: org.kordamp.gipsy -:project-version: 0.6.0 +:project-version: 1.0.0 image::media/gipsy-logo.png[] -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}.svg[Download, link="https://search.maven.org/#search|ga|1|{project-name}"] -image:https://img.shields.io/badge/donations-Patreon-orange.svg[link="https://www.patreon.com/user?u=6609318"] +image:https://img.shields.io/maven-central/v/{project-group}/{project-name}.svg[Download, link="https://search.maven.org/#search|ga|1|g:{project-group}"] --- @@ -53,7 +48,7 @@ A basic implementation of such service may be as follows ---- package com.acme -@org.kordamp.jipsy.ServiceProviderFor(Calculator) +@org.kordamp.jipsy.annotations.ServiceProviderFor(Calculator) class BasicCalculator implements Calculator { double add(double a, double b) { a + b } } @@ -76,8 +71,8 @@ Et voilĂ ! There are no additional sources to be touched nor files to be created Gipsy requires the following dependencies - - jipsy-{version} - - groovy-all-2.5.6 + - jipsy-processor-{version} + - groovy-all-3.0.7 Gipsy can be downloaded directly from https://bintray.com/kordamp/kordamp/gipsy[Bintray] or configure it via Maven or Gradle. @@ -97,7 +92,7 @@ Gipsy can be downloaded directly from https://bintray.com/kordamp/kordamp/gipsy[ ---- dependencies { annotationProcessor '{project-group}:{project-name}:{version}' - compileOnly '{project-group}:{project-name}:{version}' + compileOnly 'org.kordamp.jipsy:jipsy-annotations:{version}' } ---- diff --git a/build.gradle b/build.gradle index ed63bd9..a7ba85b 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,21 +59,20 @@ idea { } } +repositories { + mavenLocal() +} + dependencies { - api "org.kordamp.jipsy:jipsy:${project.version}" + api "org.kordamp.jipsy:jipsy-processor:${project.version}" + annotationProcessor "org.kordamp.jipsy:jipsy-processor:${project.version}" compileOnly "org.codehaus.groovy:groovy:${groovyVersion}" testImplementation "org.codehaus.groovy:groovy:${groovyVersion}" - testImplementation 'junit:junit:4.13' + testImplementation 'junit:junit:4.13.2' } compileJava { doFirst { options.compilerArgs = ['-proc:none'] } -} - -jar { - manifest { - attributes('Automatic-Module-Name': 'org.kordamp.gipsy') - } -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 8166cd4..583ae29 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# Copyright 2013-2020 Andres Almiray +# Copyright 2013-2021 Andres Almiray # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,14 +16,14 @@ # limitations under the License. # -version = 0.6.0 +version = 1.0.0 group = org.kordamp.gipsy -groovyVersion = 2.5.11 +groovyVersion = 3.0.7 sourceCompatibility = 1.8 targetCompatibility = 1.8 -kordampPluginVersion = 0.34.0 -kordampBuildVersion = 1.0.0 +kordampPluginVersion = 0.44.0 +kordampBuildVersion = 2.3.0 gitPluginVersion = 2.1.3 org.gradle.daemon = true diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 490fda8..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 a4b4429..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.3-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 2fe81a7..4f906e0 100755 --- a/gradlew +++ b/gradlew @@ -82,6 +82,7 @@ esac 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 @@ 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 62bd9b9..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,28 +64,14 @@ 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 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 diff --git a/settings.gradle b/settings.gradle index a459e84..4b299fd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,8 +17,8 @@ */ pluginManagement { repositories { - jcenter() gradlePluginPortal() + mavenCentral() mavenLocal() } } @@ -26,7 +26,7 @@ pluginManagement { buildscript { repositories { gradlePluginPortal() - jcenter() + mavenCentral() mavenLocal() } dependencies { diff --git a/src/main/java/org/kordamp/gipsy/transform/AbstractASTTransformation.java b/src/main/java/org/kordamp/gipsy/transform/AbstractASTTransformation.java index 72d7800..e253eac 100644 --- a/src/main/java/org/kordamp/gipsy/transform/AbstractASTTransformation.java +++ b/src/main/java/org/kordamp/gipsy/transform/AbstractASTTransformation.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/AbstractFileInitializer.java b/src/main/java/org/kordamp/gipsy/transform/AbstractFileInitializer.java index ecdd5c5..d9c0331 100644 --- a/src/main/java/org/kordamp/gipsy/transform/AbstractFileInitializer.java +++ b/src/main/java/org/kordamp/gipsy/transform/AbstractFileInitializer.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/AbstractFilePersistence.java b/src/main/java/org/kordamp/gipsy/transform/AbstractFilePersistence.java index 33e5cd8..b393d0e 100644 --- a/src/main/java/org/kordamp/gipsy/transform/AbstractFilePersistence.java +++ b/src/main/java/org/kordamp/gipsy/transform/AbstractFilePersistence.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/DefaultFileInitializer.java b/src/main/java/org/kordamp/gipsy/transform/DefaultFileInitializer.java index bdf61c4..3c737d5 100644 --- a/src/main/java/org/kordamp/gipsy/transform/DefaultFileInitializer.java +++ b/src/main/java/org/kordamp/gipsy/transform/DefaultFileInitializer.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/DefaultMessager.java b/src/main/java/org/kordamp/gipsy/transform/DefaultMessager.java index 7ee9cc7..83a7544 100644 --- a/src/main/java/org/kordamp/gipsy/transform/DefaultMessager.java +++ b/src/main/java/org/kordamp/gipsy/transform/DefaultMessager.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/GipsyASTTransformation.java b/src/main/java/org/kordamp/gipsy/transform/GipsyASTTransformation.java index a225231..779041a 100644 --- a/src/main/java/org/kordamp/gipsy/transform/GipsyASTTransformation.java +++ b/src/main/java/org/kordamp/gipsy/transform/GipsyASTTransformation.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/service/ServicePersistence.java b/src/main/java/org/kordamp/gipsy/transform/service/ServicePersistence.java index ee30a10..53dc225 100644 --- a/src/main/java/org/kordamp/gipsy/transform/service/ServicePersistence.java +++ b/src/main/java/org/kordamp/gipsy/transform/service/ServicePersistence.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/service/ServiceProviderASTTransformation.java b/src/main/java/org/kordamp/gipsy/transform/service/ServiceProviderASTTransformation.java index 661c0fe..ad1e821 100644 --- a/src/main/java/org/kordamp/gipsy/transform/service/ServiceProviderASTTransformation.java +++ b/src/main/java/org/kordamp/gipsy/transform/service/ServiceProviderASTTransformation.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,7 +26,7 @@ import org.codehaus.groovy.transform.ASTTransformation; import org.codehaus.groovy.transform.GroovyASTTransformation; import org.kordamp.gipsy.transform.GipsyASTTransformation; -import org.kordamp.jipsy.ServiceProviderFor; +import org.kordamp.jipsy.annotations.ServiceProviderFor; import org.kordamp.jipsy.processor.CheckResult; import org.kordamp.jipsy.processor.LogLocation; import org.kordamp.jipsy.processor.Persistence; @@ -100,24 +100,24 @@ protected void handleAnnotations(ClassNode classNode, List annot @Override protected void writeData() { // if (data.isModified()) { - if (data.services().isEmpty()) { - logger.note(LogLocation.LOG_FILE, "Writing output"); + if (data.services().isEmpty()) { + logger.note(LogLocation.LOG_FILE, "Writing output"); + try { + persistence.delete(); + } catch (IOException e) { + logger.warning(LogLocation.LOG_FILE, "An error occurred while deleting data file"); + } + } else { + logger.note(LogLocation.LOG_FILE, "Writing output"); + for (Service service : data.services()) { try { - persistence.delete(); + persistence.write(service.getName(), service.toProviderNamesList()); } catch (IOException e) { - logger.warning(LogLocation.LOG_FILE, "An error occurred while deleting data file"); - } - } else { - logger.note(LogLocation.LOG_FILE, "Writing output"); - for (Service service : data.services()) { - try { - persistence.write(service.getName(), service.toProviderNamesList()); - } catch (IOException e) { - // TODO print out error - } + // TODO print out error } - persistence.writeLog(); } + persistence.writeLog(); + } // } } diff --git a/src/main/java/org/kordamp/gipsy/transform/type/TypePersistence.java b/src/main/java/org/kordamp/gipsy/transform/type/TypePersistence.java index 75b808f..03ec170 100644 --- a/src/main/java/org/kordamp/gipsy/transform/type/TypePersistence.java +++ b/src/main/java/org/kordamp/gipsy/transform/type/TypePersistence.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/src/main/java/org/kordamp/gipsy/transform/type/TypeProviderASTTransformation.java b/src/main/java/org/kordamp/gipsy/transform/type/TypeProviderASTTransformation.java index 31b497f..b54640f 100644 --- a/src/main/java/org/kordamp/gipsy/transform/type/TypeProviderASTTransformation.java +++ b/src/main/java/org/kordamp/gipsy/transform/type/TypeProviderASTTransformation.java @@ -1,7 +1,7 @@ /* * SPDX-License-Identifier: Apache-2.0 * - * Copyright 2013-2020 Andres Almiray + * Copyright 2013-2021 Andres Almiray * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -26,8 +26,8 @@ import org.codehaus.groovy.transform.ASTTransformation; import org.codehaus.groovy.transform.GroovyASTTransformation; import org.kordamp.gipsy.transform.GipsyASTTransformation; -import org.kordamp.jipsy.ServiceProviderFor; -import org.kordamp.jipsy.TypeProviderFor; +import org.kordamp.jipsy.annotations.ServiceProviderFor; +import org.kordamp.jipsy.annotations.TypeProviderFor; import org.kordamp.jipsy.processor.CheckResult; import org.kordamp.jipsy.processor.LogLocation; import org.kordamp.jipsy.processor.Persistence;