You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mnemonic.apache.org by ga...@apache.org on 2020/12/20 02:16:55 UTC

[mnemonic] branch master updated: MNEMONIC-566: Complete the Gradle build for mnemonic-utilities-service in mnemonic-computing-services

This is an automated email from the ASF dual-hosted git repository.

garyw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mnemonic.git


The following commit(s) were added to refs/heads/master by this push:
     new 7ae94dc  MNEMONIC-566: Complete the Gradle build for mnemonic-utilities-service in mnemonic-computing-services
7ae94dc is described below

commit 7ae94dcd5e12468c42782edf8d52c5a6968584ae
Author: Yanhui Zhao <yz...@apache.org>
AuthorDate: Fri Dec 18 12:41:41 2020 -0800

    MNEMONIC-566: Complete the Gradle build for mnemonic-utilities-service in mnemonic-computing-services
    
    Signed-off-by: Yanhui Zhao <yz...@apache.org>
---
 .../mnemonic-utilities-service/build.gradle        | 43 +++++++++++++++++++++-
 1 file changed, 42 insertions(+), 1 deletion(-)

diff --git a/mnemonic-computing-services/mnemonic-utilities-service/build.gradle b/mnemonic-computing-services/mnemonic-utilities-service/build.gradle
index ef56c09..95d7d7e 100644
--- a/mnemonic-computing-services/mnemonic-utilities-service/build.gradle
+++ b/mnemonic-computing-services/mnemonic-utilities-service/build.gradle
@@ -15,8 +15,49 @@
  * limitations under the License.
  */
 
+plugins {
+  id 'net.freudasoft.gradle-cmake-plugin'
+  id 'com.github.johnrengelman.shadow'
+  id 'com.google.osdetector'
+}
+
 description = 'mnemonic-utilities-service'
+
 dependencies {
-    testCompileOnly 'org.testng:testng'
+  implementation project(':mnemonic-core')
+  implementation project(':mnemonic-collections')
+  implementation 'org.flowcomputing.commons:commons-primitives'
+  testCompileOnly 'org.testng:testng'
 }
+
+def nativeDir = "$projectDir/src/main/native"
+
+cmake {
+  sourceFolder = file("$nativeDir")
+  workingFolder = file("$nativeDir/build")
+  buildSharedLibs = true
+  buildConfig = 'Release'
+  buildTarget = 'install'
+}
+
+task copyResources(type: Copy) {
+  from "$nativeDir/dist/native"
+  into "${buildDir}/classes/java/main/native"
+}
+
+shadowJar {
+  minimize()
+  destinationDirectory = file("$projectDir/../service-dist")
+  archiveClassifier = osdetector.classifier
+}
+
+task cleanDist(type: Delete) {
+  delete "$nativeDir/dist"
+}
+
+compileJava.dependsOn cmakeBuild
+processResources.dependsOn copyResources
+build.dependsOn shadowJar
+clean.dependsOn cmakeClean
+clean.dependsOn cleanDist
 test.useTestNG()