From 644f171eda7289e79270d5e5d7ea98748b70f5d2 Mon Sep 17 00:00:00 2001 From: Mark Vulfson Date: Wed, 19 Jun 2019 16:39:03 -0700 Subject: [PATCH] feat(kayenta-bom): publish kayenta-bom (#565) This makes downstream dependencies easier. NOTE: Exposing `orca-bom` which then brings in `kork-bom` --- build.gradle | 115 ++++++++++++----------- gradle.properties | 3 +- kayenta-bom/kayenta-bom.gradle | 49 ++++++++++ kayenta-core/kayenta-core.gradle | 4 +- kayenta-graphite/kayenta-graphite.gradle | 2 +- kayenta-orca/kayenta-orca.gradle | 8 +- kayenta-signalfx/kayenta-signalfx.gradle | 2 +- settings.gradle | 1 + 8 files changed, 119 insertions(+), 65 deletions(-) create mode 100644 kayenta-bom/kayenta-bom.gradle diff --git a/build.gradle b/build.gradle index 9c1ea1d83..7acce30f4 100644 --- a/build.gradle +++ b/build.gradle @@ -37,37 +37,40 @@ allprojects { if (Boolean.valueOf(enablePublishing)) { apply plugin: "spinnaker.project" } - apply plugin: "java-library" - apply plugin: "groovy" - apply plugin: "kotlin" - - def localVersions = [korkVersion, orcaVersion].find { it.endsWith('-SNAPSHOT') } - if (localVersions) { - logger.info("Enabling mavenLocal repo for $localVersions") - repositories { - mavenLocal() + + if (name != "kayenta-bom") { + apply plugin: "java-library" + apply plugin: "groovy" + apply plugin: "kotlin" + + def localVersions = [orcaVersion].find { it.endsWith('-SNAPSHOT') } + if (localVersions) { + logger.info("Enabling mavenLocal repo for $localVersions") + repositories { + mavenLocal() + } } - } - test { - testLogging { - exceptionFormat = "full" + test { + testLogging { + exceptionFormat = "full" + } + minHeapSize = "512m" + maxHeapSize = "512m" } - minHeapSize = "512m" - maxHeapSize = "512m" - } - tasks.withType(JavaExec) { - if (System.getProperty('DEBUG', 'false') == 'true') { - jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8191' + tasks.withType(JavaExec) { + if (System.getProperty('DEBUG', 'false') == 'true') { + jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8191' + } } - } - configurations.all { - exclude group: 'org.mortbay.jetty', module: 'servlet-api' - exclude group: 'javax.servlet', module: 'servlet-api' - exclude group: 'org.slf4j', module: 'slf4j-log4j12' - exclude group: 'org.slf4j', module: 'slf4j-simple' + configurations.all { + exclude group: 'org.mortbay.jetty', module: 'servlet-api' + exclude group: 'javax.servlet', module: 'servlet-api' + exclude group: 'org.slf4j', module: 'slf4j-log4j12' + exclude group: 'org.slf4j', module: 'slf4j-simple' + } } } @@ -84,36 +87,38 @@ subprojects { project -> maven { url "https://dl.bintray.com/spinnaker/spinnaker"} } - dependencies { - implementation platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion") - compileOnly "org.projectlombok:lombok" - annotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion") - annotationProcessor "org.projectlombok:lombok" - testAnnotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion") - testAnnotationProcessor "org.projectlombok:lombok" - testCompileOnly "org.projectlombok:lombok" - - - implementation "org.slf4j:slf4j-api" - implementation "org.springframework.boot:spring-boot-starter-web" - implementation "com.netflix.spinnaker.kork:kork-swagger" - implementation "org.springframework.boot:spring-boot-properties-migrator" - implementation "com.netflix.spinnaker.orca:orca-core:$orcaVersion" - - implementation "com.squareup.retrofit:retrofit" - implementation "com.squareup.retrofit:converter-jackson" - implementation "com.squareup.okhttp:okhttp" - implementation "com.squareup.okhttp:okhttp-urlconnection" - implementation "com.squareup.okhttp:okhttp-apache" - - testImplementation "org.springframework.boot:spring-boot-starter-test" - testImplementation "org.spockframework:spock-core" - testImplementation "org.spockframework:spock-spring" - testImplementation "org.springframework:spring-test" - testImplementation "org.hamcrest:hamcrest-core" - testImplementation "org.codehaus.groovy:groovy-all" - testRuntimeOnly "cglib:cglib-nodep" - testRuntimeOnly "org.objenesis:objenesis" + if (name != "kayenta-bom") { + dependencies { + implementation platform("com.netflix.spinnaker.orca:orca-bom:$orcaVersion") + compileOnly "org.projectlombok:lombok" + annotationProcessor platform("com.netflix.spinnaker.orca:orca-bom:$orcaVersion") + annotationProcessor "org.projectlombok:lombok" + testAnnotationProcessor platform("com.netflix.spinnaker.orca:orca-bom:$orcaVersion") + testAnnotationProcessor "org.projectlombok:lombok" + testCompileOnly "org.projectlombok:lombok" + + + implementation "org.slf4j:slf4j-api" + implementation "org.springframework.boot:spring-boot-starter-web" + implementation "com.netflix.spinnaker.kork:kork-swagger" + implementation "org.springframework.boot:spring-boot-properties-migrator" + implementation "com.netflix.spinnaker.orca:orca-core" + + implementation "com.squareup.retrofit:retrofit" + implementation "com.squareup.retrofit:converter-jackson" + implementation "com.squareup.okhttp:okhttp" + implementation "com.squareup.okhttp:okhttp-urlconnection" + implementation "com.squareup.okhttp:okhttp-apache" + + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "org.spockframework:spock-core" + testImplementation "org.spockframework:spock-spring" + testImplementation "org.springframework:spring-test" + testImplementation "org.hamcrest:hamcrest-core" + testImplementation "org.codehaus.groovy:groovy-all" + testRuntimeOnly "cglib:cglib-nodep" + testRuntimeOnly "org.objenesis:objenesis" + } } } diff --git a/gradle.properties b/gradle.properties index c858d4665..8cc6bb061 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,9 +1,8 @@ #Mon Jun 17 22:31:26 UTC 2019 -orcaVersion=7.3.2 +orcaVersion=7.11.0 kotlinVersion=1.3.20 enablePublishing=false spinnakerGradleVersion=6.0.0 -korkVersion=5.5.2 mathCommonsVersion=3.6.1 keikoVersion=2.10.1 org.gradle.parallel=true diff --git a/kayenta-bom/kayenta-bom.gradle b/kayenta-bom/kayenta-bom.gradle new file mode 100644 index 000000000..d70c1a46d --- /dev/null +++ b/kayenta-bom/kayenta-bom.gradle @@ -0,0 +1,49 @@ +/* + * Copyright 2019 Netflix, Inc. + * + * 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. + */ + +apply plugin: "java-platform" +apply plugin: "maven-publish" + +// without this building the pom fails when using the Nebula publishing plugin +configurations { + create("compileOnly") +} + +javaPlatform { + allowDependencies() +} + + +if (Boolean.valueOf(enablePublishing)) { + publishing { + publications { + nebula(MavenPublication) { + from components.javaPlatform + } + } + } +} + +dependencies { + api(platform("com.netflix.spinnaker.orca:orca-bom:$orcaVersion")) + + constraints { + rootProject + .subprojects + .findAll { it != project } + .each { api(project(it.path)) } + } +} diff --git a/kayenta-core/kayenta-core.gradle b/kayenta-core/kayenta-core.gradle index 14006abb6..77ac63bb0 100644 --- a/kayenta-core/kayenta-core.gradle +++ b/kayenta-core/kayenta-core.gradle @@ -9,8 +9,8 @@ dependencies { implementation "io.springfox:springfox-swagger-ui:2.9.2" implementation "io.springfox:springfox-swagger2:2.9.2" - implementation "com.netflix.spinnaker.orca:orca-core:$orcaVersion" - implementation "com.netflix.spinnaker.orca:orca-retrofit:$orcaVersion" + implementation "com.netflix.spinnaker.orca:orca-core" + implementation "com.netflix.spinnaker.orca:orca-retrofit" implementation "net.lariverosc:jesque-spring:1.0.1" implementation "net.greghaines:jesque:1.3.1" diff --git a/kayenta-graphite/kayenta-graphite.gradle b/kayenta-graphite/kayenta-graphite.gradle index a825364a7..b86c2932c 100644 --- a/kayenta-graphite/kayenta-graphite.gradle +++ b/kayenta-graphite/kayenta-graphite.gradle @@ -183,7 +183,7 @@ dependencies { // Apache 2.0 https://github.com/rest-assured/rest-assured/blob/master/LICENSE integrationTestCompile 'io.rest-assured:rest-assured:3.1.1' - integrationTestAnnotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion") + integrationTestAnnotationProcessor platform("com.netflix.spinnaker.orca:orca-bom:$orcaVersion") integrationTestAnnotationProcessor "org.projectlombok:lombok" integrationTestCompileOnly "org.projectlombok:lombok" } diff --git a/kayenta-orca/kayenta-orca.gradle b/kayenta-orca/kayenta-orca.gradle index 75694f3f7..7a968e3cd 100644 --- a/kayenta-orca/kayenta-orca.gradle +++ b/kayenta-orca/kayenta-orca.gradle @@ -2,13 +2,13 @@ apply from: "$rootDir/gradle/kotlin.gradle" dependencies { implementation "com.netflix.spinnaker.keiko:keiko-spring:$keikoVersion" - implementation "com.netflix.spinnaker.orca:orca-queue:$orcaVersion" - implementation "com.netflix.spinnaker.orca:orca-queue-redis:$orcaVersion" - implementation "com.netflix.spinnaker.orca:orca-redis:$orcaVersion" + implementation "com.netflix.spinnaker.orca:orca-queue" + implementation "com.netflix.spinnaker.orca:orca-queue-redis" + implementation "com.netflix.spinnaker.orca:orca-redis" implementation "org.springframework.boot:spring-boot-starter-actuator" // TODO(duftler): Move these to spinnaker-dependencies. - testImplementation "com.netflix.spinnaker.orca:orca-test:$orcaVersion" + testImplementation "com.netflix.spinnaker.orca:orca-test" testImplementation "com.natpryce:hamkrest" } diff --git a/kayenta-signalfx/kayenta-signalfx.gradle b/kayenta-signalfx/kayenta-signalfx.gradle index 062a30d16..b249abe12 100644 --- a/kayenta-signalfx/kayenta-signalfx.gradle +++ b/kayenta-signalfx/kayenta-signalfx.gradle @@ -126,7 +126,7 @@ dependencies { // Apache 2.0 https://github.com/rest-assured/rest-assured/blob/master/LICENSE integrationTestCompile 'io.rest-assured:rest-assured:3.1.1' - integrationTestAnnotationProcessor platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion") + integrationTestAnnotationProcessor platform("com.netflix.spinnaker.orca:orca-bom:$orcaVersion") integrationTestAnnotationProcessor "org.projectlombok:lombok" integrationTestCompileOnly "org.projectlombok:lombok" } diff --git a/settings.gradle b/settings.gradle index 80321db68..1baca6ccd 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,6 +18,7 @@ rootProject.name="kayenta" include 'kayenta-atlas' include 'kayenta-aws' +include 'kayenta-bom' include 'kayenta-core' include 'kayenta-datadog' include 'kayenta-gcs'