You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2018/01/27 16:27:29 UTC

[GitHub] csantanapr closed pull request #3061: Add maven plugin to build.grade

csantanapr closed pull request #3061: Add maven plugin to build.grade
URL: https://github.com/apache/incubator-openwhisk/pull/3061
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/build.gradle b/build.gradle
index 135c13b792..facd90b514 100644
--- a/build.gradle
+++ b/build.gradle
@@ -11,6 +11,9 @@ subprojects {
     apply plugin: 'scalafmt'
     scalafmt.configFilePath = gradle.scalafmt.config
 
+    group 'org.apache.openwhisk'
+    version '0.0.1-SNAPSHOT'
+
     afterEvaluate {
         if (project.plugins.hasPlugin('application')
                 && project.plugins.hasPlugin('scala')) {
@@ -20,6 +23,45 @@ subprojects {
                 }
             }
         }
+
+        if (project.plugins.hasPlugin('maven')) {
+            task sourcesJar(type: Jar, dependsOn: classes) {
+                classifier = 'sources'
+                from sourceSets.main.allSource
+            }
+
+            task testSourcesJar(type: Jar, dependsOn: testClasses) {
+                classifier = 'test-sources'
+                from sourceSets.test.allSource
+            }
+
+            task testClassesJar(type: Jar, dependsOn: testClasses) {
+                classifier = 'tests'
+                from sourceSets.test.output
+            }
+
+            artifacts {
+                archives sourcesJar
+                archives testSourcesJar
+                archives testClassesJar
+            }
+        }
+
+        if (project.plugins.hasPlugin('application')) {
+            //Ensure that dist archive name does not contain version
+            distTar {
+                archiveName = "${project.name}.tar"
+            }
+
+            //Avoid generating the zip files from maven installations
+            distZip {
+                enabled false
+            }
+
+            configurations.archives.with {
+                artifacts.remove artifacts.find { it.archiveTask.is distZip }
+            }
+        }
     }
 }
 
diff --git a/common/scala/build.gradle b/common/scala/build.gradle
index e8ed52a86c..1a44bcee68 100644
--- a/common/scala/build.gradle
+++ b/common/scala/build.gradle
@@ -1,9 +1,12 @@
 apply plugin: 'scala'
 apply plugin: 'eclipse'
+apply plugin: 'maven'
 
 ext.dockerImageName = 'scala'
 apply from: '../../gradle/docker.gradle'
 
+project.archivesBaseName = "openwhisk-common"
+
 repositories {
     mavenCentral()
 }
diff --git a/core/controller/build.gradle b/core/controller/build.gradle
index 45aba6d7fc..0b904440af 100644
--- a/core/controller/build.gradle
+++ b/core/controller/build.gradle
@@ -1,11 +1,14 @@
 apply plugin: 'scala'
 apply plugin: 'application'
 apply plugin: 'eclipse'
+apply plugin: 'maven'
 
 ext.dockerImageName = 'controller'
 apply from: '../../gradle/docker.gradle'
 distDocker.dependsOn ':common:scala:distDocker', 'distTar'
 
+project.archivesBaseName = "openwhisk-controller"
+
 repositories {
     mavenCentral()
 }
diff --git a/core/invoker/build.gradle b/core/invoker/build.gradle
index 15993f8293..aad64a7af0 100644
--- a/core/invoker/build.gradle
+++ b/core/invoker/build.gradle
@@ -1,11 +1,14 @@
 apply plugin: 'scala'
 apply plugin: 'application'
 apply plugin: 'eclipse'
+apply plugin: 'maven'
 
 ext.dockerImageName = 'invoker'
 apply from: '../../gradle/docker.gradle'
 distDocker.dependsOn ':common:scala:distDocker', 'distTar'
 
+project.archivesBaseName = "openwhisk-invoker"
+
 repositories {
     mavenCentral()
 }
diff --git a/tests/build.gradle b/tests/build.gradle
index 2aa602ac1f..7cf5e189a3 100644
--- a/tests/build.gradle
+++ b/tests/build.gradle
@@ -1,11 +1,14 @@
 apply plugin: 'scala'
 apply plugin: 'eclipse'
+apply plugin: 'maven'
 compileTestScala.options.encoding = 'UTF-8'
 
 repositories {
     mavenCentral()
 }
 
+project.archivesBaseName = "openwhisk-tests"
+
 tasks.withType(Test) {
     systemProperties(System.getProperties())
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services