Skip to content

Commit

Permalink
feat(echo-bom): publish echo-bom (#578)
Browse files Browse the repository at this point in the history
publish `echo-bom` so we don't have to specify kork version in projects that depend on echo
thus causing potential misconfigurations with different kork version
  • Loading branch information
marchello2000 committed Jun 17, 2019
1 parent 0fedf9c commit 19b5d15
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 44 deletions.
60 changes: 32 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,18 @@ buildscript {
}

allprojects {
group = "com.netflix.spinnaker.echo"
apply plugin: "spinnaker.base-project"
if (Boolean.valueOf(enablePublishing)) {
apply plugin: "spinnaker.project"
}
group = "com.netflix.spinnaker.echo"
apply plugin: "spinnaker.base-project"
if (Boolean.valueOf(enablePublishing)) {
apply plugin: "spinnaker.project"
}

group = "com.netflix.spinnaker.echo"
if (name != "echo-bom") {
apply plugin: "java-library"
apply plugin: "groovy"
apply plugin: 'jacoco'

group = "com.netflix.spinnaker.echo"

test {
testLogging {
Expand All @@ -51,39 +53,41 @@ allprojects {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8189'
}
}

}
}

subprojects {
if (name != "echo-bom") {
jacoco {
toolVersion = '0.8.3'
toolVersion = '0.8.3'
}

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"
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"

implementation "org.codehaus.groovy:groovy-all"
implementation "com.github.ben-manes.caffeine:guava"
implementation "com.netflix.spectator:spectator-api"
implementation "org.slf4j:slf4j-api"
implementation "net.logstash.logback:logstash-logback-encoder"
implementation "org.springframework.boot:spring-boot-properties-migrator"
implementation "org.codehaus.groovy:groovy-all"
implementation "com.github.ben-manes.caffeine:guava"
implementation "com.netflix.spectator:spectator-api"
implementation "org.slf4j:slf4j-api"
implementation "net.logstash.logback:logstash-logback-encoder"
implementation "org.springframework.boot:spring-boot-properties-migrator"

testImplementation "org.spockframework:spock-core"
testImplementation "org.spockframework:spock-core"

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"
testRuntimeOnly "cglib:cglib-nodep"
testRuntimeOnly "org.objenesis:objenesis"
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"
testRuntimeOnly "cglib:cglib-nodep"
testRuntimeOnly "org.objenesis:objenesis"
}
}
}

defaultTasks ':echo-web:run'
49 changes: 49 additions & 0 deletions echo-bom/echo-bom.gradle
Original file line number Diff line number Diff line change
@@ -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.kork:kork-bom:${korkVersion}"))

constraints {
rootProject
.subprojects
.findAll { it != project }
.each { api(project(it.path)) }
}
}
2 changes: 1 addition & 1 deletion gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# This script will build the project.

GRADLE="./gradlew -I gradle/init-publish.gradle"
GRADLE="./gradlew -PenablePublishing=true"

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
Expand Down
13 changes: 0 additions & 13 deletions gradle/init-publish.gradle

This file was deleted.

2 changes: 1 addition & 1 deletion gradle/installViaTravis.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
# This script will build the project.

GRADLE="./gradlew -I gradle/init-publish.gradle"
GRADLE="./gradlew -PenablePublishing=true"

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Assemble Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ include 'echo-artifacts',
'echo-pubsub-core',
'echo-pubsub-aws',
'echo-pubsub-google',
'echo-test'
'echo-test',
'echo-bom'

rootProject.name = 'echo'

Expand Down

0 comments on commit 19b5d15

Please sign in to comment.