Skip to content

Commit

Permalink
feat(front50-bom): publish front50-bom (#547)
Browse files Browse the repository at this point in the history
* feat(front50-bom): publish front50-bom

This simplifies dependency resolution downstream
  • Loading branch information
marchello2000 committed Jun 18, 2019
1 parent c33a3f4 commit e2ba054
Show file tree
Hide file tree
Showing 9 changed files with 102 additions and 51 deletions.
57 changes: 29 additions & 28 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,47 +29,48 @@ buildscript {
}

allprojects { project ->
group = "com.netflix.spinnaker.front50"
apply plugin: 'spinnaker.base-project'
if (Boolean.valueOf(enablePublishing)) {
apply plugin: "spinnaker.project"
}
apply plugin: 'java-library'
apply plugin: 'groovy'

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

test {
testLogging {
exceptionFormat = 'full'
test {
testLogging {
exceptionFormat = 'full'
}
}
}

tasks.withType(JavaExec) {
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8180'
tasks.withType(JavaExec) {
if (System.getProperty('DEBUG', 'false') == 'true') {
jvmArgs '-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8180'
}
}
}

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")
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.codehaus.groovy:groovy-all"
implementation "net.logstash.logback:logstash-logback-encoder"
implementation("org.codehaus.groovy:groovy-all")
implementation("net.logstash.logback:logstash-logback-encoder")

compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"
compileOnly("org.projectlombok:lombok")
annotationProcessor("org.projectlombok:lombok")
testAnnotationProcessor("org.projectlombok:lombok")

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.spockframework:spock-core")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.spockframework:spock-spring")
testImplementation("org.springframework:spring-test")
testImplementation("org.hamcrest:hamcrest-core")
testRuntimeOnly("cglib:cglib-nodep")
testRuntimeOnly("org.objenesis:objenesis")
}
}
}

Expand Down
52 changes: 52 additions & 0 deletions front50-bom/front50-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)) }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ public interface ItemDAO<T> {
/**
* It can be expensive to refresh a bucket containing a large number of objects.
*
* <p>When {@code refresh} is false, the most recently cached set of objects will be returned.
* @param refresh true to refresh
* @return When {@code refresh} is false, the most recently cached set of objects will be
* returned. *
*/
Collection<T> all(boolean refresh);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface StorageService {
/** Check to see if the bucket exists, creating it if it is not there. */
void ensureBucketExists();

/** Returns true if the storage service supports versioning. */
/** @return true if the storage service supports versioning. */
boolean supportsVersioning();

default boolean supportsEventing(ObjectType objectType) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public interface PipelineValidator {
/**
* @param pipeline the pipeline being modified
* @param errors specific validation errors for {@param pipeline}
* @param errors specific validation errors for @param pipeline
*/
void validate(Pipeline pipeline, Errors errors);
}
6 changes: 3 additions & 3 deletions gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/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]"
$GRADLE -Prelease.useLastTag=true build
$GRADLE build
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
$GRADLE -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" build snapshot --stacktrace
Expand All @@ -23,6 +23,6 @@ elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
esac
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
$GRADLE -Prelease.useLastTag=true build
$GRADLE build
fi

14 changes: 0 additions & 14 deletions gradle/init-publish.gradle

This file was deleted.

4 changes: 2 additions & 2 deletions 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 All @@ -11,7 +11,7 @@ elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
$GRADLE -Prelease.travisci=true assemble
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Assemble Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
$GRADLE -Prelease.travisci=true -Prelease.useLastTag=true assemble
$GRADLE -Prelease.travisci=true assemble
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
$GRADLE assemble
Expand Down
12 changes: 11 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,17 @@

rootProject.name = "front50"

include 'front50-web', 'front50-core', 'front50-gcs', 'front50-redis', 'front50-s3', 'front50-test', 'front50-migrations', 'front50-azure', 'front50-swift', 'front50-oracle'
include 'front50-web',
'front50-core',
'front50-gcs',
'front50-redis',
'front50-s3',
'front50-test',
'front50-migrations',
'front50-azure',
'front50-swift',
'front50-oracle',
'front50-bom'

def setBuildFile(project) {
project.buildFileName = "${project.name}.gradle"
Expand Down

0 comments on commit e2ba054

Please sign in to comment.