Skip to content

Commit

Permalink
feat(clouddriver-bom): publish clouddriver-bom (#3794)
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 c4bb59f commit a841e9d
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 28 deletions.
57 changes: 30 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,40 +47,43 @@ allprojects {
if (Boolean.valueOf(enablePublishing)) {
apply plugin: 'spinnaker.project'
}
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'nebula.kotlin'

sourceSets.main.java.srcDirs = []
sourceSets.main.groovy.srcDirs += ["src/main/java"]
if (name != "clouddriver-bom") {
apply plugin: 'java-library'
apply plugin: 'groovy'
apply plugin: 'nebula.kotlin'

dependencies {
implementation platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")
sourceSets.main.java.srcDirs = []
sourceSets.main.groovy.srcDirs += ["src/main/java"]

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"
}
dependencies {
implementation platform("com.netflix.spinnaker.kork:kork-bom:$korkVersion")

test {
testLogging {
exceptionFormat = 'full'
if (project.hasProperty('slowTest')) {
long slow = 250
try {
slow = Long.parseLong(project.property('slowTest'))
} catch (Exception ex) {
}
afterTest { desc, result ->
long duration = result.getEndTime() - result.getStartTime()
if (duration > slow) {
logger.warn("test exceeded $slow ms: $desc.className :: $desc.name ($duration milliseconds)")
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"
}

test {
testLogging {
exceptionFormat = 'full'
if (project.hasProperty('slowTest')) {
long slow = 250
try {
slow = Long.parseLong(project.property('slowTest'))
} catch (Exception ex) {
}
afterTest { desc, result ->
long duration = result.getEndTime() - result.getStartTime()
if (duration > slow) {
logger.warn("test exceeded $slow ms: $desc.className :: $desc.name ($duration milliseconds)")
}
}
}
minHeapSize = "512m"
maxHeapSize = "512m"
}
minHeapSize = "512m"
maxHeapSize = "512m"
}
}
}
Expand Down
52 changes: 52 additions & 0 deletions clouddriver-bom/clouddriver-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 @@ -47,7 +47,8 @@ include 'cats:cats-core',
'clouddriver-sql',
'clouddriver-sql-mysql',
'clouddriver-web',
'clouddriver-scattergather'
'clouddriver-scattergather',
'clouddriver-bom'
include(*gradle.ext.includedCloudProviderProjects)

def setBuildFile(project) {
Expand Down

0 comments on commit a841e9d

Please sign in to comment.