From fa559e6a3237f4a4d12b496b24c368682389eb42 Mon Sep 17 00:00:00 2001 From: Mark Vulfson Date: Mon, 17 Jun 2019 21:51:08 -0700 Subject: [PATCH] feat(gate-bom): publish gate-bom This simplifies dependency resolution downstream --- build.gradle | 84 ++++++++++++++++++++-------------------- gate-bom/gate-bom.gradle | 51 ++++++++++++++++++++++++ settings.gradle | 1 + 3 files changed, 95 insertions(+), 41 deletions(-) create mode 100644 gate-bom/gate-bom.gradle diff --git a/build.gradle b/build.gradle index a92cafa0f7..a1fc99b945 100644 --- a/build.gradle +++ b/build.gradle @@ -17,61 +17,63 @@ buildscript { } allprojects { + group = "com.netflix.spinnaker.gate" apply plugin: 'spinnaker.base-project' if (Boolean.valueOf(enablePublishing)) { apply plugin: 'spinnaker.project' } - apply plugin: 'java-library' - apply plugin: 'groovy' - if ([korkVersion, fiatVersion].find { it.endsWith('-SNAPSHOT') }) { - repositories { - mavenLocal() - } - } + if (name != "gate-bom") { + apply plugin: 'java-library' + apply plugin: 'groovy' - repositories { - maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' } - maven { url 'https://repository.mulesoft.org/releases/' } - } + if ([korkVersion, fiatVersion].find { it.endsWith('-SNAPSHOT') }) { + 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") - compileOnly "org.projectlombok:lombok" - annotationProcessor "org.projectlombok:lombok" - testAnnotationProcessor "org.projectlombok:lombok" + repositories { + maven { url 'https://build.shibboleth.net/nexus/content/repositories/releases/' } + maven { url 'https://repository.mulesoft.org/releases/' } + } - implementation "org.codehaus.groovy:groovy-all" - implementation "net.logstash.logback:logstash-logback-encoder" - runtimeOnly "org.springframework.boot:spring-boot-properties-migrator" - testRuntime "org.springframework.boot:spring-boot-properties-migrator" + 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") + compileOnly "org.projectlombok:lombok" + annotationProcessor "org.projectlombok:lombok" + testAnnotationProcessor "org.projectlombok:lombok" - testImplementation "org.spockframework:spock-core" - testImplementation "org.spockframework:spock-spring" - testImplementation "org.springframework.boot:spring-boot-starter-test" - testImplementation "org.hamcrest:hamcrest-core" - testRuntimeOnly "cglib:cglib-nodep" - testRuntimeOnly "org.objenesis:objenesis" - } + implementation "org.codehaus.groovy:groovy-all" + implementation "net.logstash.logback:logstash-logback-encoder" + runtimeOnly "org.springframework.boot:spring-boot-properties-migrator" + testRuntime "org.springframework.boot:spring-boot-properties-migrator" - configurations.all { - exclude group: 'javax.servlet', module: 'servlet-api' - exclude group: 'javax.servlet', module: 'javax.servlet-api' - } + testImplementation "org.spockframework:spock-core" + testImplementation "org.spockframework:spock-spring" + testImplementation "org.springframework.boot:spring-boot-starter-test" + testImplementation "org.hamcrest:hamcrest-core" + testRuntimeOnly "cglib:cglib-nodep" + testRuntimeOnly "org.objenesis:objenesis" + } - tasks.withType(JavaExec) { - if (System.getProperty('DEBUG', 'false') == 'true') { - jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8184' + configurations.all { + exclude group: 'javax.servlet', module: 'servlet-api' + exclude group: 'javax.servlet', module: 'javax.servlet-api' } - } - group = "com.netflix.spinnaker.gate" + tasks.withType(JavaExec) { + if (System.getProperty('DEBUG', 'false') == 'true') { + jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8184' + } + } - test { - testLogging { - exceptionFormat = 'full' + test { + testLogging { + exceptionFormat = 'full' + } } } } diff --git a/gate-bom/gate-bom.gradle b/gate-bom/gate-bom.gradle new file mode 100644 index 0000000000..047ed14ec1 --- /dev/null +++ b/gate-bom/gate-bom.gradle @@ -0,0 +1,51 @@ +/* + * 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")) + api(platform("com.netflix.spinnaker.fiat:fiat-api:$fiatVersion")) + api(platform("com.netflix.spinnaker.fiat:fiat-core:$fiatVersion")) + + constraints { + rootProject + .subprojects + .findAll { it != project } + .each { api(project(it.path)) } + } +} diff --git a/settings.gradle b/settings.gradle index f4d4f8a2ca..e48ad06b4b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -18,6 +18,7 @@ rootProject.name = "gate" include "gate-core", "gate-basic", + "gate-bom", "gate-iap", "gate-ldap", "gate-oauth2",