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

fix gradle run #717

Merged
merged 1 commit into from
Jul 21, 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
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
Loading