Skip to content
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

upgrade gradle to 8.5 #1778

Closed
wants to merge 4 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
# Run all jobs
fail-fast: false
matrix:
java: [11, 17]
java: [11, 17, 21]
runs-on: ubuntu-latest
container:
# using the same image which is used by opensearch-build team to build the OpenSearch Distribution
Expand Down
9 changes: 3 additions & 6 deletions build-tools/opensearchplugin-coverage.gradle
Copy link

@reta reta Jan 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please set jmx = false (or just remove it) in this file and add

integTest {
    jacoco {
        jmx = true
    }
}

I hope it will fix the GA error:

 Caused by:
        javax.management.InstanceNotFoundException: org.jacoco:type=Runtime
            at java.management/com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1083)

Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ jacocoTestReport {
sourceDirectories.from = "src/main/kotlin"
classDirectories.from = sourceSets.main.output
reports {
html.enabled = true // human readable
xml.enabled = true // for coverlay
html.required = true // human readable
xml.required = true // for coverlay
}
}

Expand All @@ -64,10 +64,7 @@ allprojects{
jacocoTestReport.dependsOn integTest

testClusters.integTest {
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
// Replacing build with absolute path to fix the error "error opening zip file or JAR manifest missing : /build/tmp/expandedArchives/..../jacocoagent.jar"
jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}".replace('build',"${buildDir}")
} else {
if (!Os.isFamily(Os.FAMILY_WINDOWS)) {
jvmArgs " ${dummyIntegTest.jacoco.getAsJvmArg()}".replace('javaagent:','javaagent:/')
}
systemProperty 'com.sun.management.jmxremote', "true"
Expand Down
18 changes: 15 additions & 3 deletions build-tools/pkgbuild.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* SPDX-License-Identifier: Apache-2.0
*/

apply plugin: 'nebula.ospackage'
apply plugin: 'com.netflix.nebula.ospackage'

// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
afterEvaluate {
Expand Down Expand Up @@ -39,13 +39,25 @@ afterEvaluate {

buildRpm {
arch = 'NOARCH'
archiveName "${packageName}-${version}.rpm"
dependsOn 'assemble'
finalizedBy 'renameRpm'
task renameRpm(type: Copy) {
from("$buildDir/distributions")
into("$buildDir/distributions")
rename "$archiveFileName", "${packageName}-${version}.rpm"
doLast { delete file("$buildDir/distributions/$archiveFileName") }
}
}

buildDeb {
arch = 'amd64'
archiveName "${packageName}-${version}.deb"
dependsOn 'assemble'
finalizedBy 'renameDeb'
task renameDeb(type: Copy) {
from("$buildDir/distributions")
into("$buildDir/distributions")
rename "$archiveFileName", "${packageName}-${version}.deb"
doLast { delete file("$buildDir/distributions/$archiveFileName") }
}
}
}
8 changes: 5 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ buildscript {
classpath "org.opensearch.gradle:build-tools:${opensearch_version}"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlin_version}"
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.22.0"
classpath "org.jacoco:org.jacoco.agent:0.8.8"
classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.23.4"
classpath "org.jacoco:org.jacoco.agent:0.8.11"
}
}

plugins {
id 'nebula.ospackage' version "8.3.0"
id "com.netflix.nebula.ospackage" version "11.6.0"
id "com.dorongold.task-tree" version "1.5"
id 'java-library'
}
Expand Down Expand Up @@ -122,7 +122,9 @@ configurations.testImplementation {
configurations.all {
if (it.state != Configuration.State.UNRESOLVED) return
resolutionStrategy {
force "org.jetbrains.kotlin:kotlin-reflect:${kotlin_version}"
force "org.jetbrains.kotlin:kotlin-stdlib:${kotlin_version}"
force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${kotlin_version}"
force "org.jetbrains.kotlin:kotlin-stdlib-common:${kotlin_version}"
force "com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:${versions.jackson}"
force "org.mockito:mockito-core:${versions.mockito}"
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading