Skip to content

Commit

Permalink
fix gradle run (#717)
Browse files Browse the repository at this point in the history
Signed-off-by: Hailong Cui <[email protected]>
  • Loading branch information
Hailong-am authored Jul 21, 2023
1 parent 6e1e2e5 commit 8efd279
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
3 changes: 3 additions & 0 deletions notifications/build-tools/merged-coverage.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ allprojects {

task jacocoReport(type: JacocoReport, group: 'verification') {
description = 'Generates an aggregate report from all subprojects'
onlyIf {
gradle.taskGraph.hasTask("jacocoTestReport")
}
gradle.projectsEvaluated {
subprojects.each {
jacocoReport.dependsOn it.tasks.withType(JacocoReport)
Expand Down
6 changes: 3 additions & 3 deletions notifications/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ buildscript {
classpath "org.jetbrains.kotlin:kotlin-allopen:${kotlin_version}"
// TODO: enable detekt only when snakeyaml vulnerability is fixed
// classpath "io.gitlab.arturbosch.detekt:detekt-gradle-plugin:1.17.1"
classpath "org.jacoco:org.jacoco.agent:0.8.5"
classpath "org.jacoco:org.jacoco.agent:0.8.7"
}
}

Expand Down Expand Up @@ -83,7 +83,7 @@ dependencies {

task ktlint(type: JavaExec, group: "verification") {
description = "Check Kotlin code style."
main = "com.pinterest.ktlint.Main"
mainClass = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "notifications/**/*.kt", "core/**/*.kt", "core-spi/**/*.kt"
// to generate report in checkstyle format prepend following args:
Expand All @@ -93,7 +93,7 @@ task ktlint(type: JavaExec, group: "verification") {

task ktlintFormat(type: JavaExec, group: "formatting") {
description = "Fix Kotlin code style deviations."
main = "com.pinterest.ktlint.Main"
mainClass = "com.pinterest.ktlint.Main"
classpath = configurations.ktlint
args "-F", "notifications/**/*.kt", "core/**/*.kt", "core-spi/**/*.kt"
// https://github.com/pinterest/ktlint/issues/1391
Expand Down
2 changes: 0 additions & 2 deletions notifications/core-spi/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ repositories {
}

apply plugin: 'opensearch.java'
apply plugin: 'opensearch.testclusters'
apply plugin: 'opensearch.java-rest-test'
apply plugin: 'org.jetbrains.kotlin.jvm'
apply plugin: 'org.jetbrains.kotlin.plugin.allopen'

Expand Down
13 changes: 5 additions & 8 deletions notifications/core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,6 @@ publishing {
}
}

task integTest(type: RestIntegTestTask) {
description = "Run tests against a cluster that has security enabled"
testClassesDirs = sourceSets.test.output.classesDirs
classpath = sourceSets.test.runtimeClasspath
systemProperty 'tests.security.manager', 'false'
}

tasks.named("check").configure { dependsOn(integTest) }
check.dependsOn jacocoTestReport

// turn off javadoc as it barfs on Kotlin code
Expand All @@ -107,6 +99,11 @@ test {
systemProperty 'tests.security.manager', 'false'
}

// disable for core, we don't need to run test cluster
run {
onlyIf { false }
}

//TODO: see if this can be only set at top level and apply to subprojects, or we remove from top project if possible
configurations.all {
if (it.state != Configuration.State.UNRESOLVED) return
Expand Down

0 comments on commit 8efd279

Please sign in to comment.