Package: gkl / 0.8.10+dfsg-3

fix_debian_build.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
Author: Olivier Sallou
Last-Update: 2018-05-04 06:03:41 +0000
Description: Adapt build to Debian packaging needs
Forwarded: not-needed
--- a/build.gradle
+++ b/build.gradle
@@ -2,7 +2,6 @@
     id 'java'
     id 'maven'
     id 'signing'
-    id 'com.palantir.git-version' version '0.5.2'
 }
 
 compileJava {
@@ -87,6 +86,7 @@
     }
     useTestNG {
     }
+    scanForTestClasses = false
     // propagate system properties to test JVM
     systemProperties = System.getProperties()
 
@@ -117,7 +117,17 @@
 //===================================================================
 
 final isRelease = project.hasProperty("release")
-version = (isRelease ? gitVersion() : gitVersion() + "-SNAPSHOT").replaceAll(".dirty", "")
+def getDebianVersion() {
+    def dpkgStdOut = new ByteArrayOutputStream()
+    exec {
+        commandLine "dpkg-parsechangelog", "-S", "Version"
+        standardOutput = dpkgStdOut
+    }
+    return dpkgStdOut.toString().trim().replaceFirst(/(-gradle)?([+]dfsg[.0-9]*)?-[^-]+$/, "")
+}
+
+version = getDebianVersion()
+// version = (isRelease ? gitVersion() : gitVersion() + "-SNAPSHOT").replaceAll(".dirty", "")
 
 group = "com.intel.gkl"