This is an automated email from the ASF dual-hosted git repository. pdesai pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/openwhisk-devtools.git
The following commit(s) were added to refs/heads/master by this push: new 629404f Adding task copy dependencies (#296) 629404f is described below commit 629404fc0789f93607f36bb24546281697120b13 Author: Will Plusnick <pwplusn...@users.noreply.github.com> AuthorDate: Wed Oct 9 16:36:43 2019 -0500 Adding task copy dependencies (#296) Adding the profile into the runtime. --- knative-build/runtimes/java/core/java8/Dockerfile | 1 + .../runtimes/java/core/java8/proxy/build.gradle | 35 ++++++++++++++++++++-- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/knative-build/runtimes/java/core/java8/Dockerfile b/knative-build/runtimes/java/core/java8/Dockerfile index be41f27..4af4e11 100644 --- a/knative-build/runtimes/java/core/java8/Dockerfile +++ b/knative-build/runtimes/java/core/java8/Dockerfile @@ -36,6 +36,7 @@ RUN cd /javaAction \ && rm -rf .classpath .gitignore .gradle .project .settings Dockerfile build \ && ./gradlew oneJar \ && rm -rf /javaAction/src \ + && ./gradlew copyDependencies \ && ./compileClassCache.sh CMD ["java", "-Dfile.encoding=UTF-8", "-Xshareclasses:cacheDir=/javaSharedCache,readonly", "-Xquickstart", "-jar", "/javaAction/build/libs/javaAction-all.jar"] diff --git a/knative-build/runtimes/java/core/java8/proxy/build.gradle b/knative-build/runtimes/java/core/java8/proxy/build.gradle index eb28a7c..7d718dc 100644 --- a/knative-build/runtimes/java/core/java8/proxy/build.gradle +++ b/knative-build/runtimes/java/core/java8/proxy/build.gradle @@ -15,14 +15,22 @@ * limitations under the License. */ +import groovy.io.FileType + apply plugin: 'java' +ext { + profile = "base" +} + repositories { mavenCentral() } dependencies { - compile 'com.google.code.gson:gson:2.6.2' + //compile 'com.google.code.gson:gson:2.6.2' + compile 'com.google.code.gson:gson:2.8.5' + compile 'org.json:json:20190722' } jar { @@ -31,11 +39,34 @@ jar { } } +task copyDependencies(type: Copy) { + println "Task: copyDependencies" + def target = "profiles/$profile/libs" + + from configurations.compile + into target + + doLast { + dumpDir(".") + dumpDir(target) + } +} + +def dumpDir(dir) { + println "dumpDir('"+ dir + "'):" + new File(dir).listFiles().sort{ it.name }.reverse().each { def f -> + println ">> " + f.name + } +} + task oneJar(type: Jar) { + outputs.upToDateWhen { false } manifest.from jar.manifest classifier = 'all' from { - configurations.runtime.collect { it.isDirectory() ? it : zipTree(it) } + configurations.runtime.collect { + it.isDirectory() ? it : zipTree(it) + } } { exclude "META-INF/*.SF" exclude "META-INF/*.DSA"