-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* introduce gradle build scripts * ignore license report * fixed tests & configured GitHub action * fixed gradle workflow * fixed gradle workflow * finish deploy stage * added license formatter * add nexus publish plugin * trying to fix format * fixed header format issue * fixed workflow * small fixes for GitHub actions * fixed sonatype publish * allow tests to be run in both maven and gradle
- Loading branch information
Showing
126 changed files
with
1,537 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,7 @@ jobs: | |
|
||
# Initializes the CodeQL tools for scanning. | ||
- name: Initialize CodeQL | ||
uses: github/codeql-action/init@v1 | ||
uses: github/codeql-action/init@v2 | ||
with: | ||
languages: ${{ matrix.language }} | ||
# If you wish to specify custom queries, you can do so here or in a config file. | ||
|
@@ -50,6 +50,8 @@ jobs: | |
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 11 | ||
- name: Setup Gradle | ||
uses: gradle/[email protected] | ||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java). | ||
# If this step fails, then you should remove it and run the build manually (see below) | ||
#- name: Autobuild | ||
|
@@ -66,8 +68,8 @@ jobs: | |
# make bootstrap | ||
# make release | ||
- run: | | ||
mvn clean install | ||
./gradlew build --scan | ||
- name: Perform CodeQL Analysis | ||
uses: github/codeql-action/analyze@v1 | ||
uses: github/codeql-action/analyze@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: dependency-review | ||
on: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: 'Dependency Review' | ||
uses: actions/dependency-review-action@v3 | ||
with: | ||
retry-on-snapshot-warnings: true | ||
retry-on-snapshot-warnings-timeout: 600 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
# This workflow will build a Java project with Maven | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven | ||
|
||
name: Java CI with Maven | ||
name: Java CI with Gradle | ||
|
||
on: | ||
push: | ||
branches: [ master ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
permissions: | ||
pull-requests: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
@@ -19,14 +22,13 @@ jobs: | |
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
- name: Setup Gradle | ||
uses: gradle/gradle-build-action@v2.11.1 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Build with Maven | ||
run: mvn --batch-mode --update-snapshots install | ||
generate-job-summary: 'true' # Valid values are 'always' (default), 'never', and 'on-failure' | ||
dependency-graph: generate | ||
- name: Execute Gradle build | ||
run: ./gradlew build --scan | ||
|
||
deploy: | ||
runs-on: ubuntu-latest | ||
|
@@ -42,17 +44,12 @@ jobs: | |
server-id: ossrh | ||
server-username: MAVEN_USERNAME | ||
server-password: MAVEN_PASSWORD | ||
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | ||
- name: Cache Maven packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.m2/repository | ||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }} | ||
restore-keys: ${{ runner.os }}-m2 | ||
- name: Setup Gradle | ||
uses: gradle/[email protected] | ||
- name: Publish Snapshot package | ||
run: mvn --batch-mode -D skipTests --activate-profiles signgpg --no-transfer-progress deploy | ||
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }} | ||
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} | ||
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }} | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.MAVEN_GPG_PASSPHRASE }} # env variable for GPG private key passphrase |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import java.util.* | ||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This project uses @Incubating APIs which are subject to change. | ||
*/ | ||
|
||
plugins { | ||
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build. | ||
`kotlin-dsl` | ||
} | ||
|
||
dependencies { | ||
implementation(libs.com.benjaminsproule.license) | ||
} | ||
|
||
repositories { | ||
// Use the plugin portal to apply community plugins in convention plugins. | ||
gradlePluginPortal() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dependencyResolutionManagement { | ||
versionCatalogs { | ||
create("libs") { | ||
from(files("../gradle/libs.versions.toml")) | ||
} | ||
} | ||
} |
99 changes: 99 additions & 0 deletions
99
build-logic/src/main/kotlin/de.brendamour.java-conventions.gradle.kts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
import java.util.* | ||
|
||
/* | ||
* This file was generated by the Gradle 'init' task. | ||
* | ||
* This project uses @Incubating APIs which are subject to change. | ||
*/ | ||
|
||
plugins { | ||
`java-library` | ||
`maven-publish` | ||
`jvm-test-suite` | ||
signing | ||
id("com.benjaminsproule.license") | ||
} | ||
|
||
repositories { | ||
mavenLocal() | ||
maven { | ||
url = uri("https://repo.maven.apache.org/maven2/") | ||
} | ||
|
||
maven { | ||
url = uri("https://maven.restlet.talend.com") | ||
} | ||
} | ||
|
||
group = "de.brendamour" | ||
version = "0.4.0-SNAPSHOT" | ||
extra["isReleaseVersion"] = !version.toString().endsWith("SNAPSHOT") | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
publishing { | ||
publications.create<MavenPublication>("maven") { | ||
from(components["java"]) | ||
|
||
pom { | ||
description = "Java Library for Apple PassBook Web Service API (PARENT POM)" | ||
url.set("https://github.com/drallgood/jpasskit") | ||
inceptionYear.set("2012") | ||
licenses { | ||
license { | ||
name.set("The Apache License, Version 2.0") | ||
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt") | ||
} | ||
} | ||
developers { | ||
developer { | ||
id.set("patrice") | ||
name.set("Patrice Brend'amour") | ||
email.set("[email protected]") | ||
url.set("https://brendamour.net") | ||
timezone.set("Europe/Vienna") | ||
} | ||
} | ||
scm { | ||
connection.set("scm:https://github.com/drallgood/jpasskit.git") | ||
developerConnection.set("scm:[email protected]:drallgood/jpasskit.git") | ||
url.set("https://github.com/drallgood/jpasskit") | ||
} | ||
} | ||
} | ||
} | ||
|
||
signing { | ||
if (project.hasProperty("signingKey")) { | ||
useInMemoryPgpKeys(properties["signingKey"].toString(), properties["signingPassword"].toString()) | ||
} else { | ||
useGpgCmd() | ||
} | ||
sign(publishing.publications["maven"]) | ||
} | ||
|
||
tasks.withType<JavaCompile>() { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
tasks.withType<Javadoc>() { | ||
options.encoding = "UTF-8" | ||
} | ||
|
||
tasks.register<Wrapper>("wrapper") { | ||
gradleVersion = "8.5" | ||
} | ||
tasks.register("prepareKotlinBuildScriptModel"){} | ||
|
||
license { | ||
header = project.file("header.txt") | ||
skipExistingHeaders = true | ||
ext.set("year", Calendar.getInstance().get(Calendar.YEAR)) | ||
ext.set("owner", "Patrice Brend'amour") | ||
ext.set("email", "[email protected]") | ||
excludes(arrayListOf("*pom.xml","*.checkstyle","**/*.cer","**/*.pem","**/*.p12","**/*.ignored_file","site/*","**/*.json","**/*.png")) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
plugins { | ||
alias(libs.plugins.io.github.gradle.nexus.publish.plugin) | ||
} | ||
|
||
nexusPublishing { | ||
repositories { | ||
sonatype { | ||
/*stagingProfileId.set()*/ | ||
packageGroup = "de.brendamour" | ||
} | ||
} | ||
} | ||
|
||
//do not generate extra load on Nexus with new staging repository if signing fails | ||
val initializeSonatypeStagingRepository by tasks.existing | ||
subprojects { | ||
initializeSonatypeStagingRepository { | ||
shouldRunAfter(tasks.withType<Sign>()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# This file was generated by the Gradle 'init' task. | ||
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format | ||
|
||
[versions] | ||
com-eatthepath-pushy = "0.15.2" | ||
com-fasterxml-jackson-core-jackson-databind = "2.16.1" | ||
com-fasterxml-jackson-datatype-jackson-datatype-jsr310 = "2.16.1" | ||
com-google-guava-guava = "33.0.0-jre" | ||
commons-codec-commons-codec = "1.16.0" | ||
commons-io-commons-io = "2.15.1" | ||
org-apache-commons-commons-lang3 = "3.14.0" | ||
org-apache-logging-log4j-log4j-slf4j-impl = "2.22.1" | ||
org-assertj-assertj-core = "3.24.2" | ||
org-bouncycastle-bcpkix-jdk15on = "1.70" | ||
org-mockito-mockito-core = "5.8.0" | ||
org-restlet-jse-org-restlet = "2.4.3" | ||
org-restlet-jse-org-restlet-ext-simple = "2.4.3" | ||
org-slf4j-slf4j-api = "2.0.9" | ||
org-testng-testng = "7.9.0" | ||
com-benjaminsproule-license = "0.16.2" | ||
io-github-gradle-nexus-publish-plugin = "1.3.0" | ||
|
||
[libraries] | ||
com-eatthepath-pushy = { module = "com.eatthepath:pushy", version.ref = "com-eatthepath-pushy" } | ||
com-fasterxml-jackson-core-jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "com-fasterxml-jackson-core-jackson-databind" } | ||
com-fasterxml-jackson-datatype-jackson-datatype-jsr310 = { module = "com.fasterxml.jackson.datatype:jackson-datatype-jsr310", version.ref = "com-fasterxml-jackson-datatype-jackson-datatype-jsr310" } | ||
com-google-guava-guava = { module = "com.google.guava:guava", version.ref = "com-google-guava-guava" } | ||
commons-codec-commons-codec = { module = "commons-codec:commons-codec", version.ref = "commons-codec-commons-codec" } | ||
commons-io-commons-io = { module = "commons-io:commons-io", version.ref = "commons-io-commons-io" } | ||
org-apache-commons-commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "org-apache-commons-commons-lang3" } | ||
org-apache-logging-log4j-log4j-slf4j-impl = { module = "org.apache.logging.log4j:log4j-slf4j-impl", version.ref = "org-apache-logging-log4j-log4j-slf4j-impl" } | ||
org-assertj-assertj-core = { module = "org.assertj:assertj-core", version.ref = "org-assertj-assertj-core" } | ||
org-bouncycastle-bcpkix-jdk15on = { module = "org.bouncycastle:bcpkix-jdk15on", version.ref = "org-bouncycastle-bcpkix-jdk15on" } | ||
org-mockito-mockito-core = { module = "org.mockito:mockito-core", version.ref = "org-mockito-mockito-core" } | ||
org-restlet-jse-org-restlet = { module = "org.restlet.jse:org.restlet", version.ref = "org-restlet-jse-org-restlet" } | ||
org-restlet-jse-org-restlet-ext-simple = { module = "org.restlet.jse:org.restlet.ext.simple", version.ref = "org-restlet-jse-org-restlet-ext-simple" } | ||
org-slf4j-slf4j-api = { module = "org.slf4j:slf4j-api", version.ref = "org-slf4j-slf4j-api" } | ||
org-testng-testng = { module = "org.testng:testng", version.ref = "org-testng-testng" } | ||
com-benjaminsproule-license = { module = "com.benjaminsproule.license:com.benjaminsproule.license.gradle.plugin", version.ref = "com-benjaminsproule-license" } | ||
|
||
[plugins] | ||
io-github-gradle-nexus-publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "io-github-gradle-nexus-publish-plugin" } |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.