Skip to content

Commit

Permalink
Revert "chore(clouddriver/oracle): Get the Oracle API jar from Maven. (
Browse files Browse the repository at this point in the history
…#3695)" (#3756)

This reverts commit 6a1be53.
  • Loading branch information
robzienert committed Jun 6, 2019
1 parent a9a8b2a commit be87697
Show file tree
Hide file tree
Showing 3 changed files with 124 additions and 5 deletions.
60 changes: 59 additions & 1 deletion clouddriver-artifacts/clouddriver-artifacts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,63 @@ test {
useJUnitPlatform()
}

class DownloadTask extends DefaultTask {
@Input
String sourceUrl

@OutputFile
File target

@TaskAction
void download() {
ant.get(src: sourceUrl, dest: target)
}
}

final File sdkDownloadLocation = project.file('build/sdkdownload')
final File sdkLocation = project.file('build/oci-java-sdk')

// Oracle BMCS SDK isn't published to any maven repo (yet!), so we manually download, unpack and add to compile/runtime deps
// https://github.com/oracle/oci-java-sdk/issues/25
task fetchSdk(type: DownloadTask) {
sourceUrl = 'https://github.com/oracle/oci-java-sdk/releases/download/v1.3.2/oci-java-sdk.zip'
target = sdkDownloadLocation
}

task unpackSdk(type: Sync) {
dependsOn('fetchSdk')
from zipTree(tasks.fetchSdk.target)
into sdkLocation
include "**/*.jar"
exclude "**/*-sources.jar"
exclude "**/*-javadoc.jar"
exclude "apidocs/**"
exclude "examples/**"

// Scary but works. I think clouddriver deps in general need cleaning at some point
// Even without the oracle bmc sdk 3rd party deps there's still multiple javax.inject and commons-X JARs
exclude "**/*jackson*.jar"
exclude "**/*jersey*.jar"
exclude "**/hk2*.jar"
exclude "**/*guava*.jar"
exclude "**/commons*.jar"
exclude "**/aopalliance*.jar"
exclude "**/javassist*.jar"
exclude "**/slf*.jar"
exclude "**/osgi*.jar"
exclude "**/validation*.jar"
exclude "**/jsr305*.jar"
exclude "**/json-smart*.jar"
exclude "**/oci-java-sdk-full-shaded-*.jar"
}

task cleanSdk(type: Delete) {
delete sdkLocation, sdkDownloadLocation
}

tasks.clean.dependsOn('cleanSdk')
tasks.compileJava.dependsOn('unpackSdk')

dependencies {
implementation project(":clouddriver-core")

Expand All @@ -16,7 +73,6 @@ dependencies {
implementation "com.netflix.frigga:frigga"
implementation "com.netflix.spinnaker.kork:kork-artifacts"
implementation "com.netflix.spinnaker.kork:kork-exceptions"
implementation "com.oracle.oci.sdk:oci-java-sdk-core:1.5.2"
implementation "com.squareup.okhttp:okhttp"
implementation "com.sun.jersey:jersey-client:1.9.1"
implementation "org.apache.commons:commons-compress:1.14"
Expand All @@ -28,6 +84,8 @@ dependencies {
implementation "org.springframework.boot:spring-boot-actuator"
implementation "org.springframework.boot:spring-boot-starter-web"

implementation fileTree(sdkLocation)

testImplementation "com.github.tomakehurst:wiremock:latest.release"
testImplementation "org.assertj:assertj-core"
testImplementation "org.junit-pioneer:junit-pioneer:0.3.0"
Expand Down
64 changes: 60 additions & 4 deletions clouddriver-oracle/clouddriver-oracle.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,68 @@

class DownloadTask extends DefaultTask {
@Input
String sourceUrl

@OutputFile
File target

@TaskAction
void download() {
ant.get(src: sourceUrl, dest: target)
}
}

final File sdkDownloadLocation = project.file('build/sdkdownload')
final File sdkLocation = project.file('build/oci-java-sdk')

// Oracle BMCS SDK isn't published to any maven repo (yet!), so we manually download, unpack and add to compile/runtime deps
// https://github.com/oracle/oci-java-sdk/issues/25
task fetchSdk(type: DownloadTask) {
sourceUrl = 'https://github.com/oracle/oci-java-sdk/releases/download/v1.3.2/oci-java-sdk.zip'
target = sdkDownloadLocation
}

task unpackSdk(type: Sync) {
dependsOn('fetchSdk')
from zipTree(tasks.fetchSdk.target)
into sdkLocation
include "**/*.jar"
exclude "**/*-sources.jar"
exclude "**/*-javadoc.jar"
exclude "apidocs/**"
exclude "examples/**"

// Scary but works. I think clouddriver deps in general need cleaning at some point
// Even without the oracle bmc sdk 3rd party deps there's still multiple javax.inject and commons-X JARs
exclude "**/*jackson*.jar"
exclude "**/*jersey*.jar"
exclude "**/hk2*.jar"
exclude "**/*guava*.jar"
exclude "**/commons*.jar"
exclude "**/aopalliance*.jar"
exclude "**/javassist*.jar"
exclude "**/slf*.jar"
exclude "**/osgi*.jar"
exclude "**/validation*.jar"
exclude "**/jsr305*.jar"
exclude "**/json-smart*.jar"
exclude "**/oci-java-sdk-full-shaded-*.jar"
}

task cleanSdk(type: Delete) {
delete sdkLocation, sdkDownloadLocation
}

tasks.clean.dependsOn('cleanSdk')
tasks.compileJava.dependsOn('unpackSdk')

dependencies {
implementation project(":clouddriver-core")
implementation project(":cats:cats-core")
implementation project(":clouddriver-security")

implementation fileTree(sdkLocation)

compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
testAnnotationProcessor "org.projectlombok:lombok"
Expand All @@ -13,10 +73,6 @@ dependencies {
implementation "com.netflix.spinnaker.fiat:fiat-api:$fiatVersion"
implementation "com.netflix.spinnaker.fiat:fiat-core:$fiatVersion"
implementation "com.netflix.spinnaker.moniker:moniker"
implementation "com.oracle.oci.sdk:oci-java-sdk-core:1.5.2"
implementation "com.oracle.oci.sdk:oci-java-sdk-identity:1.5.2"
implementation "com.oracle.oci.sdk:oci-java-sdk-loadbalancer:1.5.2"
implementation "com.oracle.oci.sdk:oci-java-sdk-objectstorage:1.5.2"
implementation "org.codehaus.groovy:groovy-all"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-web"
Expand Down
5 changes: 5 additions & 0 deletions clouddriver-web/clouddriver-web.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
apply plugin: 'spinnaker.application'

if (gradle.includedCloudProviderProjects.contains(':clouddriver-oracle')) {
tasks.startScripts.dependsOn(':clouddriver-oracle:unpackSdk')
tasks.startScripts.mustRunAfter(':clouddriver-oracle:unpackSdk')
}

ext {
springConfigLocation = System.getProperty('spring.config.additional-location', "${System.getProperty('user.home')}/.spinnaker/")
}
Expand Down

0 comments on commit be87697

Please sign in to comment.