Description: skipping parts useless for a Debian build and getting the Debian
 version of the package
Author: Olivier Sallou <osallou@debian.org>
Forwarded: not-needed
Last-Update: 2022-12-27

--- a/build.gradle
+++ b/build.gradle
@@ -8,19 +8,29 @@
 plugins {
     id "java"
     id 'maven'
-    id 'signing'
-    id 'com.palantir.git-version' version '0.5.1' //version helper
 }
 
 compileJava {
   options.compilerArgs = ['-proc:none', '-Xlint:all','-Werror','-Xdiags:verbose']
 }
 
-sourceCompatibility = 1.8
-targetCompatibility = 1.8
+// sourceCompatibility = 1.9
+// targetCompatibility = 1.9
 
 final isRelease = Boolean.getBoolean("release")
-version = (isRelease ? gitVersion() : gitVersion() + "-SNAPSHOT").replaceAll(".dirty", "")
+// 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()
+
+
 
 logger.info("build for version:" + version)
 
@@ -54,66 +64,3 @@
     archives javadocJar
     archives sourcesJar
 }
-
-/**
- * Sign non-snapshot releases with our secret key.  This should never need to be invoked directly.
- */
-signing {
-    required { gradle.taskGraph.hasTask("uploadArchives") }
-    sign configurations.archives
-}
-
-/**
- * Upload a release to sonatype.  You must be an authorized uploader and have your sonatype
- * username and password information in your gradle properties file. 
- *
- * For releasing to your local maven repo, use gradle install
- */
-uploadArchives {
-    repositories {
-        mavenDeployer {
-            beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
-
-            repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
-                authentication(userName: project.findProperty("sonatypeUsername"), password: project.findProperty("sonatypePassword"))
-            }
-
-            snapshotRepository(url: "https://broadinstitute.jfrog.io/broadinstitute/libs-snapshot-local/") {
-                authentication(userName: System.env.ARTIFACTORY_USERNAME, password: System.env.ARTIFACTORY_PASSWORD)
-            }
-
-            pom.project {
-                name 'gatk-native-bindings'
-                packaging 'jar'
-                description 'Bindings for native libraries to implement to be compatible with GATK4'
-                url 'http://github.com/broadinstitute/gatk-native-bindings'
-
-
-                scm {
-                    url 'scm:git@github.com:broadinstitute/gatk-native-bindings.git'
-                    connection 'scm:git@github.com:broadinstitute/gatk-native-bindings.git'
-                    developerConnection 'scm:git@github.com:broadinstitute/gatk-native-bindings.git'
-                }
-
-                developers {
-                    developer {
-                        id = "gatkdev"
-                        name = "GATK Development Team"
-                        email = "gatk-dev-public@broadinstitute.org"
-                    }
-                }
-
-                licenses {
-                    license {
-                        name 'BSD 3-Clause'
-                        url 'https://github.com/broadinstitute/gatk-native-bindings/blob/master/LICENSE.TXT'
-                        distribution 'repo'
-                    }
-                }
-            }
-        }
-    }
-    doFirst{
-        System.out.println("Uploading version $version")
-    }
-}
