diff --git a/build.gradle b/build.gradle index bed444bf75..a955ab3191 100644 --- a/build.gradle +++ b/build.gradle @@ -45,49 +45,51 @@ allprojects { } subprojects { - apply plugin: "java-library" + if (name != "orca-bom") { + apply plugin: "java-library" - if ([korkVersion, keikoVersion, fiatVersion].any { it.endsWith("-SNAPSHOT") }) { - logger.info("Enabling mavenLocal") - repositories { - mavenLocal() + if ([korkVersion, keikoVersion, fiatVersion].any { it.endsWith("-SNAPSHOT") }) { + logger.info("Enabling mavenLocal") + repositories { + mavenLocal() + } } - } - dependencies { - implementation(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")) - annotationProcessor(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")) - testAnnotationProcessor(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")) - implementation("org.slf4j:slf4j-api") - } + dependencies { + implementation(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")) + annotationProcessor(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")) + testAnnotationProcessor(platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")) + implementation("org.slf4j:slf4j-api") + } - configurations.all { - exclude group: "javax.servlet", module: "servlet-api" - } + configurations.all { + exclude group: "javax.servlet", module: "servlet-api" + } - test { - testLogging { - exceptionFormat = "full" + test { + testLogging { + exceptionFormat = "full" + } } - } - def licenseExtension = project.extensions.findByName('license') - if (licenseExtension != null) { - licenseExtension.exclude "**/*.json" - licenseExtension.exclude "**/*.md" - licenseExtension.exclude "**/*.yml" - licenseExtension.mapping { - java = "SLASHSTAR_STYLE" - kt = "SLASHSTAR_STYLE" + def licenseExtension = project.extensions.findByName('license') + if (licenseExtension != null) { + licenseExtension.exclude "**/*.json" + licenseExtension.exclude "**/*.md" + licenseExtension.exclude "**/*.yml" + licenseExtension.mapping { + java = "SLASHSTAR_STYLE" + kt = "SLASHSTAR_STYLE" + } } - } - project.afterEvaluate { - //c&p this because NetflixOss reverts it to 1.7 and ends up getting applied last.. - project.plugins.withType(JavaBasePlugin) { - JavaPluginConvention convention = project.convention.getPlugin(JavaPluginConvention) - convention.sourceCompatibility = JavaVersion.VERSION_1_8 - convention.targetCompatibility = JavaVersion.VERSION_1_8 + project.afterEvaluate { + //c&p this because NetflixOss reverts it to 1.7 and ends up getting applied last.. + project.plugins.withType(JavaBasePlugin) { + JavaPluginConvention convention = project.convention.getPlugin(JavaPluginConvention) + convention.sourceCompatibility = JavaVersion.VERSION_1_8 + convention.targetCompatibility = JavaVersion.VERSION_1_8 + } } } } diff --git a/orca-bom/orca-bom.gradle b/orca-bom/orca-bom.gradle new file mode 100644 index 0000000000..bf47dbbed6 --- /dev/null +++ b/orca-bom/orca-bom.gradle @@ -0,0 +1,52 @@ +/* + * 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.kork:kork-bom:$korkVersion")) + + constraints { + api("com.netflix.spinnaker.fiat:fiat-api:$fiatVersion") + api("com.netflix.spinnaker.fiat:fiat-core:$fiatVersion") + + rootProject + .subprojects + .findAll { it != project } + .each { api(project(it.path)) } + } +} diff --git a/settings.gradle b/settings.gradle index 1d4600e9a1..4aa1d28d1b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -48,7 +48,8 @@ include "orca-extensionpoint", "orca-sql", "orca-sql-mysql", "orca-integrations-gremlin", - "orca-integrations-cloudfoundry" + "orca-integrations-cloudfoundry", + "orca-bom" rootProject.name = "orca"