Skip to content

Commit 96ec877

Browse files
authored
1.5.0 (#14)
* Added support for java records * #13 - @reflectable on interface throws NPE in annotation processor * update to gradle 8.8
1 parent 41de14d commit 96ec877

15 files changed

Lines changed: 520 additions & 493 deletions

File tree

.github/workflows/publish.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
6+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
7+
8+
name: Publish Central Portal
9+
10+
on:
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- uses: actions/checkout@v3
23+
- name: Set up JDK 17
24+
uses: actions/setup-java@v3
25+
with:
26+
java-version: '17'
27+
distribution: 'temurin'
28+
cache: gradle
29+
- name: Restore gradle.properties
30+
env:
31+
GRADLE_PROPERTIES: ${{ secrets.GRADLE_PROPERTIES }}
32+
shell: bash
33+
run: |
34+
mkdir -p ~/.gradle/
35+
echo "GRADLE_USER_HOME=${HOME}/.gradle" >> $GITHUB_ENV
36+
echo "${GRADLE_PROPERTIES}" > ~/.gradle/gradle.properties
37+
- name: Restore gpg key
38+
env:
39+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
40+
shell: bash
41+
run: |
42+
mkdir /home/runner/.gnupg
43+
echo -n "${{ secrets.GPG_PRIVATE_KEY }}" | base64 --decode > /home/runner/.gnupg/secring.gpg
44+
- name: Execute Gradle publish
45+
run: ./gradlew clean build publish --refresh-dependencies --info
46+
- name: Upload test reports
47+
uses: actions/upload-artifact@v4
48+
if: always()
49+
with:
50+
name: test-reports
51+
path: "**/build/reports/*"
52+
retention-days: 5

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
*.jar
1515
# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
1616
!gradle-wrapper.jar
17+
!./gradle/wrapper/gradle-wrapper.jar
1718
*.war
1819
*.nar
1920
*.ear
@@ -27,3 +28,4 @@ hs_err_pid*
2728
/build/
2829
gradle.properties
2930
/bin/
31+
.idea

LICENSE_SHORT

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright [2020] FormKiQ Inc. Licensed under the Apache License, Version 2.0 (the "License"); you
3+
* may not use this file except in compliance with the License. You may obtain a copy of the License
4+
* at
5+
*
6+
* <p>http://www.apache.org/licenses/LICENSE-2.0
7+
*
8+
* <p>Unless required by applicable law or agreed to in writing, software distributed under the
9+
* License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
10+
* express or implied. See the License for the specific language governing permissions and
11+
* limitations under the License.
12+
*/

build.gradle

Lines changed: 54 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
1+
import com.vanniktech.maven.publish.SonatypeHost
2+
13
plugins {
24
id 'java'
3-
id 'maven-publish'
4-
id 'signing'
55
id 'checkstyle'
6-
id 'com.diffplug.spotless' version '6.17.0'
7-
id 'com.github.spotbugs' version '5.0.14'
8-
id 'com.github.ben-manes.versions' version '0.46.0'
6+
id 'com.vanniktech.maven.publish' version '0.32.0'
7+
id 'com.diffplug.spotless' version '7.0.4'
8+
id 'com.github.spotbugs' version '6.1.13'
9+
id 'com.github.ben-manes.versions' version '0.52.0'
910
}
1011

1112
group 'com.formkiq'
12-
version '1.4.2'
13+
version '1.5.0'
1314

1415
dependencies {
15-
annotationProcessor group: 'com.google.auto.service', name: 'auto-service', version: '1.0.1'
16-
compileOnly group: 'com.google.auto.service', name: 'auto-service', version: '1.0.1'
17-
compileOnly group: 'com.google.auto.service', name: 'auto-service-annotations', version: '1.0.1'
16+
annotationProcessor group: 'com.google.auto.service', name: 'auto-service', version: '1.1.1'
17+
compileOnly group: 'com.google.auto.service', name: 'auto-service', version: '1.1.1'
18+
compileOnly group: 'com.google.auto.service', name: 'auto-service-annotations', version: '1.1.1'
1819

1920
implementation group: 'com.formkiq', name: 'graalvm-annotations', version: '1.2.0'
20-
implementation group: 'com.google.code.gson', name: 'gson', version: '2.10.1'
21+
implementation group: 'com.google.code.gson', name: 'gson', version: '2.13.1'
2122
testImplementation group: 'junit', name: 'junit', version:'4.+'
2223
testImplementation group: 'com.google.testing.compile', name: 'compile-testing', version: '0.21.0'
2324
}
@@ -27,114 +28,73 @@ compileJava {
2728
}
2829

2930
spotless {
30-
java {
31-
googleJavaFormat()
32-
}
31+
java {
32+
eclipse().configFile project.rootProject.file("spotless.eclipseformat.xml")
33+
licenseHeaderFile project.rootProject.file("LICENSE_SHORT")
34+
}
3335
}
3436

3537
spotbugs {
3638
excludeFilter = file("$rootDir/config/gradle/spotbugs-exclude.xml")
3739
}
38-
40+
3941
spotbugsMain {
40-
reports {
41-
html {
42-
enabled = true
42+
reports {
43+
html {
44+
required.set(true)
45+
}
4346
}
44-
}
4547
}
4648

4749
checkstyle {
48-
toolVersion '8.29'
49-
configFile file("config/checkstyle/checkstyle.xml")
50-
configProperties = [project_loc: "${projectDir}"]
51-
ignoreFailures = false
52-
maxWarnings = 0
50+
toolVersion = '10.12.1'
51+
configFile file("config/checkstyle/checkstyle.xml")
52+
configProperties = [project_loc: "${projectDir}"]
53+
maxWarnings = 0
54+
maxErrors = 0
5355
}
5456

5557
repositories {
5658
mavenLocal()
5759
mavenCentral()
5860
}
5961

60-
check {
61-
dependsOn(tasks.publishToMavenLocal)
62-
}
63-
6462
java {
65-
withJavadocJar()
66-
withSourcesJar()
67-
6863
toolchain {
69-
languageVersion.set(JavaLanguageVersion.of(11))
64+
languageVersion.set(JavaLanguageVersion.of(17))
7065
}
7166
}
7267

73-
javadoc {
74-
if(JavaVersion.current().isJava9Compatible()) {
75-
options.addBooleanOption('html5', true)
76-
}
77-
}
78-
79-
artifacts {
80-
archives jar
81-
82-
archives javadocJar
83-
archives sourcesJar
84-
}
68+
mavenPublishing {
8569

86-
afterEvaluate {
87-
tasks.getByName('spotlessCheck').dependsOn(tasks.getByName('spotlessApply'))
88-
}
70+
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
71+
signAllPublications()
8972

90-
publishing {
91-
publications {
92-
mavenJava(MavenPublication) {
93-
from components.java
94-
95-
pom {
96-
name = 'FormKiQ Lambda Runtime Graalvm Annotations'
97-
description = 'Lambda Runtime Graalvm Annotations'
98-
url = 'https://github.com/formkiq/graalvm-annotations-processor'
99-
licenses {
100-
license {
101-
name = 'The Apache License, Version 2.0'
102-
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
103-
}
104-
}
105-
developers {
106-
developer {
107-
id = 'mfriesen'
108-
name = 'Mike Friesen'
109-
email = 'mike@formkiq.com'
110-
}
111-
}
112-
scm {
113-
connection = 'scm:git:git://github.com/formkiq/graalvm-annotations-processor.git'
114-
developerConnection = 'scm:git:ssh://github.com/formkiq/graalvm-annotations-processor.git'
115-
url = 'https://github.com/formkiq/graalvm-annotations-processor.git'
116-
}
73+
pom {
74+
name = "FormKiQ Lambda Runtime Graalvm"
75+
description = "Lambda Runtime Graalvm"
76+
inceptionYear = "2020"
77+
url = "https://github.com/formkiq/lambda-runtime-graalvm"
78+
licenses {
79+
license {
80+
name = "The Apache License, Version 2.0"
81+
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
82+
distribution = "http://www.apache.org/licenses/LICENSE-2.0.txt"
11783
}
118-
}
119-
}
120-
repositories {
121-
maven {
122-
credentials {
123-
username project.repoUser
124-
password project.repoPassword
125-
}
126-
url "https://oss.sonatype.org/service/local/staging/deploy/maven2/"
127-
// url "https://oss.sonatype.org/content/repositories/snapshots/"
128-
}
129-
}
130-
}
131-
132-
signing {
133-
sign publishing.publications.mavenJava
134-
}
135-
136-
check {
137-
dependsOn(tasks.publishToMavenLocal)
84+
}
85+
developers {
86+
developer {
87+
id = 'mfriesen'
88+
name = 'Mike Friesen'
89+
}
90+
}
91+
scm {
92+
url = 'https://github.com/formkiq/lambda-runtime-graalvm.git'
93+
connection = 'scm:git:git://github.com/formkiq/lambda-runtime-graalvm.git'
94+
developerConnection = 'scm:git:ssh://github.com/formkiq/lambda-runtime-graalvm.git'
95+
}
96+
}
13897
}
13998

140-
spotlessJavaCheck.dependsOn spotlessJavaApply
99+
compileJava.dependsOn(tasks.spotlessApply)
100+
check.dependsOn(tasks.publishToMavenLocal)

config/checkstyle/checkstyle.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130
<message key="ws.illegalFollow" value="GenericWhitespace ''{0}'' should followed by whitespace."/>
131131
</module>
132132
<module name="Indentation">
133-
<property name="arrayInitIndent" value="2"/>
133+
<property name="arrayInitIndent" value="4"/>
134134
<property name="basicOffset" value="2"/>
135135
<property name="caseIndent" value="2"/>
136136
<property name="lineWrappingIndentation" value="2" />

config/checkstyle/import-control.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<allow pkg="java.nio.file" />
1717
<allow pkg="java.util" />
1818
<allow pkg="java.lang.reflect" />
19+
<allow pkg="java.nio.charset" />
1920

2021
<allow pkg="javax.annotation.processing" />
2122
<allow pkg="javax.lang.model" />
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
44
networkTimeout=10000
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

spotless.eclipseformat.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@
153153
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
154154
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
155155
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
156-
<setting id="org.eclipse.jdt.core.formatter.alignment_for_MODULE_statements" value="16"/>
156+
<setting id="org.eclipse.jdt.core.formatter.alignment_for_module_statements" value="16"/>
157157
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
158158
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
159159
<setting id="org.eclipse.jdt.core.formatter.comment.align_tags_names_descriptions" value="false"/>

0 commit comments

Comments
 (0)