Skip to content

Commit

Permalink
Upgraded to Gradle v8.5
Browse files Browse the repository at this point in the history
  • Loading branch information
azagniotov committed Jan 23, 2024
1 parent 57aab36 commit f50fd47
Show file tree
Hide file tree
Showing 121 changed files with 358 additions and 139 deletions.
8 changes: 2 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ buildscript {
}
}
}
dependencies {
classpath "org.unbroken-dome.gradle-plugins:gradle-testsets-plugin:4.0.0"
}
}

apply plugin: "java-library"
Expand All @@ -20,8 +17,7 @@ apply plugin: "signing"
apply plugin: "idea"
apply plugin: "eclipse"
apply plugin: "jacoco"
apply plugin: "org.unbroken-dome.test-sets"

apply plugin: "jvm-test-suite"

defaultTasks 'clean', 'test', 'integrationTest', 'functionalTest', 'build'
description = 'Gradle configuration for stubby4j'
Expand All @@ -48,7 +44,7 @@ repositories {

apply from: "$rootDir/conf/gradle/dependencies.gradle"
apply from: "$rootDir/conf/gradle/ide.gradle"
apply from: "$rootDir/conf/gradle/multi-test-source-sets.gradle"
apply from: "$rootDir/conf/gradle/tests.gradle"
apply from: "$rootDir/conf/gradle/jacoco.gradle"
apply from: "$rootDir/conf/gradle/artifacts.gradle"
apply from: "$rootDir/conf/gradle/sonatype.gradle"
18 changes: 1 addition & 17 deletions conf/gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,21 +34,5 @@ dependencies {
println "> Building with default dependencies"
api "org.slf4j:slf4j-api:1.7.30"
}

testImplementation "junit:junit:4.13.1"
testImplementation "org.mockito:mockito-core:${mockitoVersion}"
// https://github.com/mockito/mockito/issues/2231
testImplementation "org.mockito:mockito-inline:${mockitoVersion}"
testImplementation "com.google.truth:truth:1.1.2"
testImplementation "org.eclipse.jetty.http2:http2-client:${jettyVersion}"
testImplementation "org.eclipse.jetty.http2:http2-http-client-transport:${jettyVersion}"

if (project.hasProperty("useNativeJdkAlpnProcessor")) {
testImplementation "org.eclipse.jetty:jetty-alpn-java-client:${jettyVersion}"
} else {
testImplementation "org.eclipse.jetty:jetty-alpn-openjdk8-client:${jettyVersion}"
}

// https://github.com/googleapis/google-http-java-client/issues/167#issuecomment-571987053
testImplementation "com.google.http-client:google-http-client-apache-v2:1.38.1"
}

170 changes: 170 additions & 0 deletions conf/gradle/tests.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
/*
* Copyright (c) 2023 Alexander Zagniotov
*
* 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.
*/

testing {
suites {
test {
useJUnit()
dependencies {
implementation "junit:junit:4.13.1"
implementation "org.mockito:mockito-core:${mockitoVersion}"
// https://github.com/mockito/mockito/issues/2231
implementation "org.mockito:mockito-inline:${mockitoVersion}"
implementation "com.google.truth:truth:1.1.5"
implementation "com.google.http-client:google-http-client-apache-v2:1.38.1"
}
}

integrationTest(JvmTestSuite) {
sources {
resources {
srcDirs += [
"src/main/resources"
]
}
}
useJUnit()
dependencies {
implementation project()
implementation "junit:junit:4.13.1"
implementation "org.mockito:mockito-core:${mockitoVersion}"
// https://github.com/mockito/mockito/issues/2231
implementation "org.mockito:mockito-inline:${mockitoVersion}"
implementation "com.google.truth:truth:1.1.5"

implementation "org.eclipse.jetty.http2:http2-client:${jettyVersion}"
implementation "org.eclipse.jetty.http2:http2-http-client-transport:${jettyVersion}"

if (project.hasProperty("useNativeJdkAlpnProcessor")) {
implementation "org.eclipse.jetty:jetty-alpn-java-client:${jettyVersion}"
} else {
implementation "org.eclipse.jetty:jetty-alpn-openjdk8-client:${jettyVersion}"
}

// https://github.com/googleapis/google-http-java-client/issues/167#issuecomment-571987053
implementation "com.google.http-client:google-http-client-apache-v2:1.38.1"
}

targets {
all {
testTask.configure {
shouldRunAfter(test)
}
}
}
}

functionalTest(JvmTestSuite) {
sources {
resources {
srcDirs += [
"src/main/resources"
]
}
}
useJUnit()
dependencies {
implementation project()
implementation "junit:junit:4.13.1"
implementation "org.mockito:mockito-core:${mockitoVersion}"
// https://github.com/mockito/mockito/issues/2231
implementation "org.mockito:mockito-inline:${mockitoVersion}"
implementation "com.google.truth:truth:1.1.5"

implementation "org.eclipse.jetty.http2:http2-client:${jettyVersion}"
implementation "org.eclipse.jetty.http2:http2-http-client-transport:${jettyVersion}"

if (project.hasProperty("useNativeJdkAlpnProcessor")) {
implementation "org.eclipse.jetty:jetty-alpn-java-client:${jettyVersion}"
} else {
implementation "org.eclipse.jetty:jetty-alpn-openjdk8-client:${jettyVersion}"
}

// https://github.com/googleapis/google-http-java-client/issues/167#issuecomment-571987053
implementation "com.google.http-client:google-http-client-apache-v2:1.38.1"
}

targets {
all {
testTask.configure {
systemProperty "overrideDisabledAlgorithms", "true"
shouldRunAfter(test)
}
}
}
}

loadTest(JvmTestSuite) {
sources {
resources {
srcDirs += [
"src/main/resources"
]
}
}
useJUnit()
dependencies {
implementation project()
implementation "junit:junit:4.13.1"
implementation "org.mockito:mockito-core:${mockitoVersion}"
// https://github.com/mockito/mockito/issues/2231
implementation "org.mockito:mockito-inline:${mockitoVersion}"
implementation "com.google.truth:truth:1.1.5"

implementation "org.eclipse.jetty.http2:http2-client:${jettyVersion}"
implementation "org.eclipse.jetty.http2:http2-http-client-transport:${jettyVersion}"

if (project.hasProperty("useNativeJdkAlpnProcessor")) {
implementation "org.eclipse.jetty:jetty-alpn-java-client:${jettyVersion}"
} else {
implementation "org.eclipse.jetty:jetty-alpn-openjdk8-client:${jettyVersion}"
}

// https://github.com/googleapis/google-http-java-client/issues/167#issuecomment-571987053
implementation "com.google.http-client:google-http-client-apache-v2:1.38.1"
}

targets {
all {
testTask.configure {
shouldRunAfter(test)
}
}
}
}
}
}

tasks.withType(Test).configureEach {
reports.html.required = false
reports.junitXml.required = false
ignoreFailures = false
testLogging {
// showStandardStreams true
events /*"passed", */ "skipped", "failed"
exceptionFormat "full"
showExceptions true
showCauses true
showStackTraces true
}

filter {
if (project.hasProperty("ciRun")) {
excludeTestsMatching "*Flaky*"
}
}
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit f50fd47

Please sign in to comment.