Skip to content

Issue #148: Update Gradle to 7+ #149

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CommanderTestingContainer
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
FROM alpine:3.10
FROM alpine:3.17.2

RUN apk add --update bash ca-certificates openjdk8 openjdk8-jre-base nss git "gradle=5.4.1-r0" && \
RUN apk add --update bash ca-certificates openjdk8 openjdk8-jre-base nss git gradle && \
rm -rf /var/cache/apk/*

RUN git clone --single-branch --branch main https://github.com/RESOStandards/web-api-commander.git
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM gradle:6.9.2-jdk8 AS builder
FROM gradle:8.0.2-jdk8 AS builder

WORKDIR /home/gradle/project

Expand Down
6 changes: 2 additions & 4 deletions GradleDockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
FROM gradle:6.9.2-jdk8 AS builder
FROM alpine:3.17.2

FROM alpine:3.14.8

RUN apk add --update bash ca-certificates openjdk8-jre-base nss git gradle && \
RUN apk add --update bash ca-certificates openjdk8-jre-base nss git gradle && \
rm -rf /var/cache/apk/*

RUN git clone --single-branch --branch main https://github.com/RESOStandards/web-api-commander.git
Expand Down
109 changes: 53 additions & 56 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
// Apply the java plugin to add support for Java
id 'java'
id 'java-library'

// Apply the application plugin to add support for building an application
id 'application'
Expand All @@ -13,48 +13,46 @@ targetCompatibility = 1.8
compileJava.options.encoding = 'UTF-8'

repositories {
// Use jcenter for resolving your dependencies.
// You can declare any Maven/Ivy/file repository here.
mavenCentral()
}

dependencies {
compile 'com.google.guava:guava:31.1-jre'
compile 'com.google.inject:guice:5.1.0'
compile 'commons-cli:commons-cli:1.5.0'
implementation 'com.google.guava:guava:31.1-jre'
implementation 'com.google.inject:guice:5.1.0'
implementation 'commons-cli:commons-cli:1.5.0'

compile 'org.apache.logging.log4j:log4j-api:2.18.0'
compile 'org.apache.logging.log4j:log4j-slf4j-impl:2.18.0'
compile 'org.apache.logging.log4j:log4j-1.2-api:2.18.0'
compile 'org.apache.logging.log4j:log4j-core:2.18.0'
implementation 'org.apache.logging.log4j:log4j-api:2.18.0'
implementation 'org.apache.logging.log4j:log4j-slf4j-impl:2.18.0'
implementation 'org.apache.logging.log4j:log4j-1.2-api:2.18.0'
implementation 'org.apache.logging.log4j:log4j-core:2.18.0'

compile 'org.apache.olingo:odata-client-api:4.9.0'
compile 'org.apache.olingo:odata-commons-core:4.9.0'
compile 'org.apache.olingo:odata-client-core:4.9.0'
implementation 'org.apache.olingo:odata-client-api:4.9.0'
implementation 'org.apache.olingo:odata-commons-core:4.9.0'
implementation 'org.apache.olingo:odata-client-core:4.9.0'

compile 'org.apache.poi:poi:5.2.2'
compile 'org.apache.poi:poi-ooxml:5.2.2'
implementation 'org.apache.poi:poi:5.2.2'
implementation 'org.apache.poi:poi-ooxml:5.2.2'

compile 'io.rest-assured:rest-assured:5.1.1'
compile 'io.rest-assured:json-path:5.1.1'
compile 'io.rest-assured:json-schema-validator:5.1.1'
implementation 'io.rest-assured:rest-assured:5.1.1'
implementation 'io.rest-assured:json-path:5.1.1'
implementation 'io.rest-assured:json-schema-validator:5.1.1'

compile 'io.cucumber:cucumber-java8:7.1.0'
compile 'io.cucumber:cucumber-java:7.1.0'
compile 'io.cucumber:cucumber-junit:7.1.0'
compile 'io.cucumber:cucumber-guice:7.1.0'
compile 'io.cucumber:cucumber-core:7.1.0'
implementation 'io.cucumber:cucumber-java8:7.1.0'
implementation 'io.cucumber:cucumber-java:7.1.0'
implementation 'io.cucumber:cucumber-junit:7.1.0'
implementation 'io.cucumber:cucumber-guice:7.1.0'
implementation 'io.cucumber:cucumber-core:7.1.0'

//TODO: choose one schema validator between this and rest-assured
compile 'com.networknt:json-schema-validator:1.0.70'
compile 'com.google.code.gson:gson:2.9.0'
compile 'org.apache.commons:commons-text:1.9'
implementation 'com.networknt:json-schema-validator:1.0.70'
implementation 'com.google.code.gson:gson:2.9.0'
implementation 'org.apache.commons:commons-text:1.9'

}

configurations {
cucumberRuntime {
extendsFrom compile
extendsFrom implementation
}
}

Expand All @@ -63,17 +61,16 @@ jar {
attributes "Main-Class": mainClassName
}

duplicatesStrategy = DuplicatesStrategy.EXCLUDE

from {
configurations.compile.collect { it.isDirectory() ? it : zipTree(it) }
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
exclude 'META-INF/*.RSA'
exclude 'META-INF/*.SF'
exclude 'META-INF/*.DSA'
}


// don't suppress warnings or deprecation notices
tasks.withType(JavaCompile) {
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-Xlint:unchecked'
options.deprecation = true
}
Expand All @@ -87,21 +84,21 @@ final String certOutputDir = 'build' + File.separator + 'certification',
certReportsDir = certOutputDir + File.separator + 'reports',
certResultsDir = certOutputDir + File.separator + 'results'

task prepareCertificationEnvironment() {
doLast {
def folder = new File(certOutputDir)
if (folder.exists()) {
delete certOutputDir
}
tasks.register('prepareCertificationEnvironment') {
doLast {
def folder = new File(certOutputDir)
if (folder.exists()) {
delete certOutputDir
}

mkdir certOutputDir
mkdir cucumberJsonPath
mkdir certReportsDir
mkdir certResultsDir
}
}

task testWebApiCore_2_0_0() {
tasks.register('testWebApiCore_2_0_0') {
group = 'RESO Certification'
description = 'Web API Core 2.0.0 Acceptance Tests' +
'\nExample: ' +
Expand All @@ -116,7 +113,7 @@ task testWebApiCore_2_0_0() {
dependsOn jar, prepareCertificationEnvironment
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
mainClass = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
systemProperties = System.getProperties()

Expand All @@ -137,7 +134,7 @@ task testWebApiCore_2_0_0() {
}
}

task testDataDictionary_1_7() {
tasks.register('testDataDictionary_1_7') {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Acceptance Tests' +
'\nRESOScript Example:' +
Expand Down Expand Up @@ -178,13 +175,13 @@ task testDataDictionary_1_7() {
}

argsArray.addAll(
'--plugin',
'json:' + cucumberJsonPath + '/' + reportName + '.json',
'--plugin',
'html:' + certReportsDir + '/' + reportName + '.html',
'--glue',
'org.reso.certification.stepdefs#DataDictionary',
'src/main/java/org/reso/certification/features/data-dictionary/v1-7-0'
'--plugin',
'json:' + cucumberJsonPath + '/' + reportName + '.json',
'--plugin',
'html:' + certReportsDir + '/' + reportName + '.html',
'--glue',
'org.reso.certification.stepdefs#DataDictionary',
'src/main/java/org/reso/certification/features/data-dictionary/v1-7-0'
)

if (systemProperties.hasProperty('cucumber.filter.tags')) {
Expand All @@ -197,7 +194,7 @@ task testDataDictionary_1_7() {
}
}

task testDataAvailability_1_7() {
tasks.register('testDataAvailability_1_7') {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Data Availability Tests' +
'\nExample:' +
Expand All @@ -210,7 +207,7 @@ task testDataAvailability_1_7() {
dependsOn jar
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
mainClass = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
systemProperties = System.getProperties()

Expand Down Expand Up @@ -239,7 +236,7 @@ task testDataAvailability_1_7() {
}
}

task testIdxPayload_1_7() {
tasks.register('testIdxPayload_1_7') {
group = 'RESO Certification'
description = 'Data Dictionary 1.7 Payloads Sampling Tests' +
'\nExample:' +
Expand All @@ -252,7 +249,7 @@ task testIdxPayload_1_7() {
dependsOn jar
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
mainClass = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
systemProperties = System.getProperties()

Expand All @@ -271,12 +268,12 @@ task testIdxPayload_1_7() {
}
}

task testDataDictionaryReferenceMetadata_1_7() {
tasks.register('testDataDictionaryReferenceMetadata_1_7') {
description = 'Runs Data Dictionary tests against reference metadata'
dependsOn jar
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
mainClass = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
System.setProperty('pathToMetadata', 'src/main/resources/RESODataDictionary-1.7.xml')
systemProperties = System.getProperties()
Expand All @@ -298,7 +295,7 @@ test {
dependsOn assemble, compileTestJava, testDataDictionaryReferenceMetadata_1_7
doLast {
javaexec {
main = "io.cucumber.core.cli.Main"
mainClass = "io.cucumber.core.cli.Main"
classpath = configurations.cucumberRuntime + sourceSets.main.output + sourceSets.test.output
args = [
'--plugin',
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
org.gradle.jvmargs=-Xmx28g
org.gradle.warning.mode=all
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-6.9.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists