File: build.gradle

package info (click to toggle)
gatk-native-bindings 1.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 220 kB
  • sloc: sh: 124; java: 94; xml: 34; makefile: 27
file content (130 lines) | stat: -rw-r--r-- 3,943 bytes parent folder | 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//Note: this section 'buildscript` is only for the dependencies of the buildscript itself.
buildscript {
    repositories {
        mavenCentral()
     }
}

plugins {
    id "java"
    id 'maven'
    id 'signing'
}

compileJava {
  options.compilerArgs = ['-proc:none', '-Xlint:all','-Werror','-Xdiags:verbose']
}

// sourceCompatibility = 1.9
// targetCompatibility = 1.9

final isRelease = Boolean.getBoolean("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()



logger.info("build for version:" + version)

group = 'org.broadinstitute'

task wrapper(type: Wrapper) {
    gradleVersion = '4.0.1'
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from 'build/docs/javadoc'
}

task sourcesJar(type: Jar) {
    from sourceSets.main.allSource
    classifier = 'sources'
}

// This is a hack to disable the java 8 default javadoc lint until we fix the html formatting
if (JavaVersion.current().isJava8Compatible()) {
    tasks.withType(Javadoc) {
        options.addStringOption('Xdoclint:none', '-quiet')
    }
}
/**
 *This specifies what artifacts will be built and uploaded when performing a maven upload.
 */
artifacts {
    archives jar
    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")
    }
}