Skip to content

Commit

Permalink
chore(gradle): Convert orca to use kork-bom (#2860)
Browse files Browse the repository at this point in the history
* chore(BOM): Make orca use kork-bom

* Use `kork-bom`
* Remove dependence on `netflix.servo`
* Fixed a bunch of `TODOs` in gradle files along the way
  • Loading branch information
marchello2000 authored Apr 24, 2019
1 parent b73775d commit fedf50d
Show file tree
Hide file tree
Showing 59 changed files with 536 additions and 454 deletions.
93 changes: 28 additions & 65 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,91 +15,48 @@
*/

buildscript {
ext {
korkVersion = "4.0.2"
keikoVersion = "2.10.0"
}
repositories {
jcenter()
maven { url "https://spinnaker.bintray.com/gradle" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.netflix.spinnaker.gradle:spinnaker-dev-plugin:5.2.2"
classpath "com.netflix.nebula:nebula-kotlin-plugin:$kotlinVersion"
classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlinVersion"
classpath "com.netflix.nebula:nebula-kotlin-plugin:1.3.30"
classpath "org.jetbrains.kotlin:kotlin-allopen:1.3.30"
}
}

allprojects {
apply plugin: "spinnaker.base-project"
apply plugin: "java"
apply plugin: "java-library"
group = "com.netflix.spinnaker.orca"

ext {
spinnakerDependenciesVersion = '1.41.0'
if (project.hasProperty('spinnakerDependenciesVersion')) {
spinnakerDependenciesVersion = project.property('spinnakerDependenciesVersion')
}
}

def checkLocalVersions = [spinnakerDependenciesVersion: spinnakerDependenciesVersion]
if (ext.has('versions')) {
def extVers = ext.get('versions')
if (extVers instanceof Map) {
checkLocalVersions.putAll(extVers)
}
}

def localVersions = checkLocalVersions.findAll { it.value.endsWith('-SNAPSHOT') }
if (localVersions) {
logger.info("Enabling mavenLocal repo for $localVersions")
repositories {
mavenLocal()
}
}

spinnaker {
dependenciesVersion = spinnakerDependenciesVersion
}

test {
testLogging {
exceptionFormat = 'full'
}
}

configurations.all {
exclude group: "javax.servlet", module: "servlet-api"
exclude group: "org.slf4j", module: "slf4j-log4j12"
exclude group: "org.slf4j", module: "slf4j-simple"
resolutionStrategy {
force "org.antlr:antlr-runtime:3.5.2"
eachDependency {
if (it.requested.group.startsWith("com.fasterxml.jackson")) {
it.useVersion spinnaker.version('jackson')
}
if (it.requested.group == "com.netflix.rxjava" && it.requested.name == "rxjava-core") {
it.useTarget group: "io.reactivex", name: "rxjava", version: spinnaker.version("rxJava")
}
if (it.requested.group == "asm" || it.requested.group == "org.ow2.asm") {
it.useTarget group: "org.ow2.asm", name: "asm-all", version: "5.0.3"
}
if (it.requested.group == "cglib" || it.requested.name == "cglib") {
it.useTarget group: "cglib", name: "cglib", version: "3.1"
}
if (it.requested.group == "antlr") {
it.useTarget group: "org.antlr", name: it.requested.name, version: "3.5.2"
}
if (it.requested.group == "org.apache.xbean") {
it.useVersion "4.1"
}
}

def useLocalMaven = korkVersion.endsWith('-SNAPSHOT')
if (useLocalMaven) {
logger.info("Enabling mavenLocal")
repositories {
mavenLocal()
}
}

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

subprojects {
def licenseExtension = project.extensions.findByName('license')
if (licenseExtension != null) {
Expand All @@ -112,13 +69,19 @@ subprojects {
}
}

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
}
//c&p this because NetflixOss reverts it to 1.7 and ends up getting applied last..
project.plugins.withType(JavaPlugin) {
JavaPluginConvention convention = project.convention.getPlugin(JavaPluginConvention)
convention.sourceCompatibility = JavaVersion.VERSION_1_8
convention.targetCompatibility = JavaVersion.VERSION_1_8
}
repositories {
jcenter()
}
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")
}
}

Expand Down
7 changes: 0 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,3 @@
# limitations under the License.
#
org.gradle.parallel=true

kotlinVersion=1.2.41
junitVersion=1.2.0
jupiterVersion=5.0.2
junitLegacyVersion=4.12.0
spekVersion=1.1.5
keikoVersion=2.9.8
9 changes: 6 additions & 3 deletions gradle/groovy.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@
apply plugin: "groovy"

dependencies {
compile spinnaker.dependency("groovy")
spinnaker.group("spockBase")
testCompile spinnaker.dependency("groovy")
implementation "org.codehaus.groovy:groovy-all"

testImplementation "org.spockframework:spock-core"
testImplementation "cglib:cglib-nodep"
testImplementation "org.objenesis:objenesis"
testImplementation "org.codehaus.groovy:groovy-all"
}
17 changes: 8 additions & 9 deletions gradle/init-publish.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
initscript {
repositories {
mavenLocal()
jcenter()
maven { url 'https://dl.bintray.com/spinnaker/gradle/' }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.netflix.spinnaker.gradle:spinnaker-gradle-project:5.2.1'
}
repositories {
jcenter()
maven { url 'https://dl.bintray.com/spinnaker/gradle/' }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.netflix.spinnaker.gradle:spinnaker-gradle-project:5.2.1'
}
}

// Can't use the plugin ID (spinnaker.project) on init scripts for some reason.
Expand Down
16 changes: 1 addition & 15 deletions gradle/kotlin.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,9 @@
apply plugin: "nebula.kotlin"
apply plugin: "kotlin-spring"

configurations.all {
resolutionStrategy {
eachDependency { details ->
if (details.requested.group == "org.jetbrains.kotlin") {
details.useVersion kotlinVersion
}
}
}
}

compileKotlin {
kotlinOptions {
languageVersion = "1.2"
languageVersion = "1.3"
jvmTarget = "1.8"
}
}

kapt {
mapDiagnosticLocations = true
}
22 changes: 11 additions & 11 deletions gradle/spek.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@ repositories {
}

dependencies {
testCompile "org.junit.platform:junit-platform-runner:$junitVersion"
testCompile "org.jetbrains.spek:spek-api:$spekVersion"
testCompile "org.jetbrains.spek:spek-subject-extension:$spekVersion"
testCompile "com.nhaarman:mockito-kotlin:1.5.0"
testCompile "org.assertj:assertj-core:3.9.0"
testCompile "org.junit.jupiter:junit-jupiter-api:$jupiterVersion"
testImplementation "org.junit.platform:junit-platform-runner"
testImplementation "org.jetbrains.spek:spek-api"
testImplementation "org.jetbrains.spek:spek-subject-extension"
testImplementation "com.nhaarman:mockito-kotlin"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit.jupiter:junit-jupiter-api"

testRuntime "org.junit.platform:junit-platform-launcher:$junitVersion"
testRuntime "org.junit.jupiter:junit-jupiter-engine:$jupiterVersion"
testRuntime "org.junit.vintage:junit-vintage-engine:$junitLegacyVersion"
testRuntime "org.jetbrains.spek:spek-junit-platform-engine:$spekVersion"
testCompile "io.strikt:strikt-core:0.11.5"
testRuntime "org.junit.platform:junit-platform-launcher"
testRuntime "org.junit.jupiter:junit-jupiter-engine"
testRuntime "org.junit.vintage:junit-vintage-engine"
testRuntime "org.jetbrains.spek:spek-junit-platform-engine"
testImplementation "io.strikt:strikt-core"
}

test {
Expand Down
6 changes: 4 additions & 2 deletions gradle/spock.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@
apply plugin: "groovy"

dependencies {
spinnaker.group("spockBase")
testCompile spinnaker.dependency("groovy")
testImplementation "org.spockframework:spock-core"
testImplementation "cglib:cglib-nodep"
testImplementation "org.objenesis:objenesis"
testImplementation "org.codehaus.groovy:groovy-all"
}

tasks.compileGroovy.enabled = false
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
18 changes: 17 additions & 1 deletion gradlew
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#!/usr/bin/env sh

#
# Copyright 2015 the original author or authors.
#
# 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.
#

##############################################################################
##
## Gradle start up script for UN*X
Expand Down Expand Up @@ -28,7 +44,7 @@ APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
Expand Down
18 changes: 17 additions & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem http://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
Expand All @@ -14,7 +30,7 @@ set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
Expand Down
18 changes: 12 additions & 6 deletions orca-applications/orca-applications.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@
apply from: "$rootDir/gradle/groovy.gradle"

dependencies {
compile project(":orca-clouddriver")
compile project(":orca-front50")
compile project(":orca-retrofit")
compileOnly spinnaker.dependency('lombok')
annotationProcessor spinnaker.dependency('lombok')
testCompile project(":orca-test-groovy")
implementation project(":orca-core")
implementation project(":orca-clouddriver")
implementation project(":orca-front50")
implementation project(":orca-retrofit")

implementation "com.netflix.spinnaker.kork:kork-core"

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

testImplementation project(":orca-test-groovy")
}
23 changes: 15 additions & 8 deletions orca-bakery/orca-bakery.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,19 @@
apply from: "$rootDir/gradle/groovy.gradle"

dependencies {
compile project(":orca-retrofit")
compile project(":orca-front50")
spinnaker.group('jackson')
compile spinnaker.dependency('jacksonGuava')
compileOnly spinnaker.dependency('lombok')
annotationProcessor spinnaker.dependency("lombok")
testCompile project(":orca-test-groovy")
testCompile "com.github.tomakehurst:wiremock:2.15.0"
implementation project(":orca-core")
implementation project(":orca-retrofit")
implementation project(":orca-front50")

implementation "org.springframework:spring-beans"

implementation "com.netflix.spinnaker.kork:kork-exceptions"
implementation "com.netflix.spinnaker.kork:kork-artifacts"

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

testImplementation project(":orca-test-groovy")
testImplementation "com.github.tomakehurst:wiremock:2.15.0"
}
Loading

0 comments on commit fedf50d

Please sign in to comment.