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/23 19:03:20 UTC

[mnemonic] branch master updated: MNEMONIC-564: Complete the build of mnemonic-pmdk-pmem-service

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 39fd36c  MNEMONIC-564: Complete the build of mnemonic-pmdk-pmem-service
39fd36c is described below

commit 39fd36c8126290a367b742250333634d1d0ba57b
Author: chenyang <ch...@apache.org>
AuthorDate: Tue Dec 22 19:55:01 2020 -0800

    MNEMONIC-564: Complete the build of mnemonic-pmdk-pmem-service
    
    Signed-off-by: chenyang <ch...@apache.org>
---
 .../mnemonic-pmdk-pmem-service/build.gradle        | 42 +++++++++++++++++++++-
 1 file changed, 41 insertions(+), 1 deletion(-)

diff --git a/mnemonic-memory-services/mnemonic-pmdk-pmem-service/build.gradle b/mnemonic-memory-services/mnemonic-pmdk-pmem-service/build.gradle
index 67b2979..84170fe 100644
--- a/mnemonic-memory-services/mnemonic-pmdk-pmem-service/build.gradle
+++ b/mnemonic-memory-services/mnemonic-pmdk-pmem-service/build.gradle
@@ -15,8 +15,48 @@
  * limitations under the License.
  */
 
+plugins {
+  id 'net.freudasoft.gradle-cmake-plugin'
+  id 'com.github.johnrengelman.shadow'
+  id 'com.google.osdetector'
+}
+
 description = 'mnemonic-pmdk-pmem-service'
+
 dependencies {
-    testCompileOnly 'org.testng:testng'
+  implementation project(':mnemonic-core')
+  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()