openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From csantan...@apache.org
Subject [incubator-openwhisk] branch master updated: Add maven plugin to build.grade (#3061)
Date Sat, 27 Jan 2018 16:27:27 GMT
This is an automated email from the ASF dual-hosted git repository.

csantanapr pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new e70e23b  Add maven plugin to build.grade (#3061)
e70e23b is described below

commit e70e23baf6d8861ee8760d7e106cb7ab3781b261
Author: Chetan Mehrotra <chetanm@apache.org>
AuthorDate: Sat Jan 27 21:57:25 2018 +0530

    Add maven plugin to build.grade (#3061)
    
    - Adds `maven` plugin to build.gradle files for tests, common, controller and
    invoker.
    - Enables support for generating source jars
    - Uses `org.apache.openwhisk` as groupId
    - Uses `0.0.1-SNAPSHOT` as current version
    - Customize the base name to follow pattern "openwhisk-<module name>"
---
 build.gradle                 | 42 ++++++++++++++++++++++++++++++++++++++++++
 common/scala/build.gradle    |  3 +++
 core/controller/build.gradle |  3 +++
 core/invoker/build.gradle    |  3 +++
 tests/build.gradle           |  3 +++
 5 files changed, 54 insertions(+)

diff --git a/build.gradle b/build.gradle
index 135c13b..facd90b 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 e8ed52a..1a44bce 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 45aba6d..0b90444 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 15993f8..aad64a7 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 2aa602a..7cf5e18 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())
 

-- 
To stop receiving notification emails like this one, please contact
csantanapr@apache.org.

Mime
View raw message