Skip to content

Commit

Permalink
Updated dependencies and Gradle wrapper.
Browse files Browse the repository at this point in the history
  • Loading branch information
depryf committed Oct 26, 2023
1 parent 196ce9d commit b2b01e0
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 38 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Build the project and run unit tests

name: integration

on: [ push, pull_request ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '17'
- name: Cache Gradle packages
uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
SEER_API_KEY: ${{ secrets.SEER_API_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
chmod +x gradlew
./gradlew build
34 changes: 34 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Publish to Maven Central

name: publish

on:
release:
types: [ created ]
workflow_dispatch: {}

jobs:
publish:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'
cache: 'gradle'

- name: Publish
run: |
chmod +x gradlew
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
ORG_GRADLE_PROJECT_nexusUsername: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_nexusPassword: ${{ secrets.NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SEER_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SEER_GPG_PASSWORD }}
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

**Version 1.3**

- Updated validation library from version 2.28 to version 3.0.
- Updated naaccr-xml library from version 9.0 to version 9.1.
- Updated validation library from version 2.28 to version 3.2.
- Updated naaccr-xml library from version 9.0 to version 10.1.
- Updated SQLite driver from version 3.39.2.0 to version 3.43.2.1.
- Updated log4j-api from version 2.18.0 to version 2.21.1.

**Version 1.2**

Expand Down
64 changes: 35 additions & 29 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,56 @@ import java.time.Duration
plugins {
id 'java-library'
id 'checkstyle'
id 'com.github.spotbugs' version '5.0.12'
id 'com.github.spotbugs' version '5.2.1'
id 'maven-publish'
id 'signing'
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0' // publish to Maven Central
id 'com.github.ben-manes.versions' version '0.43.0' // check for out-of-date dependencies (run manually)
id 'org.sonatype.gradle.plugins.scan' version '2.5.5' // scan for vulnerabilities
id 'io.github.gradle-nexus.publish-plugin' version '1.3.0' // publish to Maven Central
id 'com.github.ben-manes.versions' version '0.49.0' // check for out-of-date dependencies (run 'dependencyUpdates' manually)
id 'org.sonatype.gradle.plugins.scan' version '2.6.1' // scan for vulnerabilities
}

group = 'com.imsweb'
version = file('VERSION').text.trim()
description = 'This library allows a Genedits Metafile to be translated into Groovy edits that can be executed in the SEER Validation framework.'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

println "Starting build using JDK ${Runtime.version().feature()}"

repositories {
mavenCentral()
}

dependencies {
api 'com.imsweb:validation:3.0'
api 'com.imsweb:naaccr-xml:9.1'
api 'com.imsweb:validation:3.2'
api 'com.imsweb:naaccr-xml:10.1'
api 'com.imsweb:seerutils:5.6'
api 'com.imsweb:staging-algorithm-cs:02.05.50.10'

implementation 'org.apache.commons:commons-lang3:3.12.0'
implementation 'org.apache.commons:commons-lang3:3.13.0'
implementation 'net.sf.squirrel-sql.thirdparty-non-maven:java-cup:0.11a'
implementation 'org.xerial:sqlite-jdbc:3.39.2.0'
implementation 'org.apache.logging.log4j:log4j-api:2.18.0'
implementation 'org.xerial:sqlite-jdbc:3.43.2.1'
implementation 'org.apache.logging.log4j:log4j-api:2.21.1'

testImplementation 'junit:junit:4.13.2'
testImplementation 'com.imsweb:data-generator:1.28'
testImplementation 'org.apache.logging.log4j:log4j-core:2.19.0'
testImplementation 'com.imsweb:data-generator:1.31'
testImplementation 'org.apache.logging.log4j:log4j-core:2.21.1'
}

// enforce UTF-8, display the compilation warnings
tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
}

// the Javadoc was made way too strict in Java 8 and it's not worth the time fixing everything!
tasks.withType(Javadoc) {
tasks.withType(Javadoc).configureEach {
options.addStringOption('Xdoclint:none', '-quiet')
}

// generate javadoc and sources (required by Nexus)
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

withJavadocJar()
withSourcesJar()
}
Expand Down Expand Up @@ -81,12 +81,11 @@ checkstyle {

// spotbugs plugin settings
spotbugs {
ignoreFailures = false
excludeFilter = file('config/spotbugs/spotbugs-exclude.xml')
excludeFilter.set(file('config/spotbugs/spotbugs-exclude.xml'))
}

// use this task to generate the edits parser for Genedits syntax
task generateEditsParser {
tasks.register('generateEditsParser') {
doLast {
// create lexer
javaexec {
Expand Down Expand Up @@ -114,7 +113,7 @@ task generateEditsParser {
}

// use this task to generate the regex parser
task generateRegexParser {
tasks.register('generateRegexParser') {
doLast {
// create lexer
javaexec {
Expand Down Expand Up @@ -152,9 +151,20 @@ ossIndexAudit {
'sonatype-2022-6438'
]
}
check.dependsOn 'ossIndexAudit'

if (project.hasProperty('branch_name') && (project.ext.get('branch_name') == 'master' || project.ext.get('branch_name') == 'main'))
check.dependsOn 'ossIndexAudit'
def isNonStable = { String version ->
def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) }
def regex = /^[0-9,.v-]+(-r)?$/
return (!stableKeyword && !(version ==~ regex)) || version == '021-11'
}

// https://github.com/ben-manes/gradle-versions-plugin
tasks.named("dependencyUpdates").configure {
rejectVersionIf {
isNonStable(it.candidate.version)
}
}

// needed to deploy to Maven Central
publishing {
Expand Down Expand Up @@ -204,6 +214,8 @@ publishing {

// setup JAR signing
signing {
required { !project.version.endsWith('-SNAPSHOT') }

def signingKey = project.findProperty('signing.armored.key') ?: ''
def signingPassword = project.findProperty('signing.armored.password') ?: ''

Expand Down Expand Up @@ -231,15 +243,9 @@ nexusPublishing {
}
}

// don't try to release a snapshot to a non-snapshot repository, that won't work anyway
if (version.endsWith('-SNAPSHOT')) {
gradle.startParameter.excludedTaskNames += 'signMavenJavaPublication'
gradle.startParameter.excludedTaskNames += 'closeAndReleaseSonatypeStagingRepository'
}

// Gradle wrapper, this allows to build the project without having to install Gradle!
wrapper {
gradleVersion = '7.5.1'
gradleVersion = '8.4'
distributionType = Wrapper.DistributionType.ALL
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 6 additions & 0 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ set -- \
org.gradle.wrapper.GradleWrapperMain \
"$@"

# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi

# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
Expand Down
14 changes: 8 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -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 execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +75,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down

0 comments on commit b2b01e0

Please sign in to comment.