Skip to content

Commit

Permalink
feat(orca-bom): publish orca-bom (#2995)
Browse files Browse the repository at this point in the history
This simplifies dependency resolution downstream
  • Loading branch information
marchello2000 committed Jun 18, 2019
1 parent 2e07fcc commit 96234c2
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 35 deletions.
70 changes: 36 additions & 34 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
}
Expand Down
52 changes: 52 additions & 0 deletions orca-bom/orca-bom.gradle
Original file line number Diff line number Diff line change
@@ -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)) }
}
}
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 96234c2

Please sign in to comment.