File: build.gradle

package info (click to toggle)
libsis-base-java 18.09~pre1+git20180827.fe4953e+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,156 kB
  • sloc: java: 9,106; ansic: 813; xml: 160; sh: 139; makefile: 35
file content (116 lines) | stat: -rw-r--r-- 3,010 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
apply from: './javaproject.gradle'

group='sis'

dependencies {
    compile 'apache:commons-io:+',
            'apache:commons-lang3:+',
            'testng:testng:+',
            'rinn:restrictions:+'
} 

tasks.withType(Test) {
    systemProperty "java.library.path", "libs/native/unix/amd64-Linux:libs/native/nativedata/amd64-Linux:libs/native/unix/x86_64-Mac OS X:libs/native/nativedata/x86_64-Mac OS X"
}


sourceSets {
  test {
    resources {
      srcDir "libs"
      include "**"
    }
  }
}

jar {
    archiveName "${project.group}-base-${version}.jar"
    manifest {
        attributes 'Main-Class': 'ch.systemsx.cisd.base.BuildAndEnvironmentInfo'
    }

    from('targets/dist') {
        include 'BUILD*INFO'
    }    

    from fileTree("libs/")
}

sourcesJar {
    archiveName "${project.group}-base-${version}-sources.jar"
}

task standaloneTestJar(type: Jar, dependsOn: [classes, testClasses]) {
    archiveName "${project.group}-base-${version}-tests.jar"
    from files(sourceSets.main.output.classesDir)
    from files(sourceSets.main.output.resourcesDir)
    from files(sourceSets.test.output.classesDir)
    from files("libs")
 
    from('targets/dist') {
        include 'BUILD*INFO'
    }    

    from {configurations.testRuntime.collect {zipTree(it)}}
 
    manifest {
        attributes 'Main-Class': 'ch.systemsx.cisd.base.AllTests'
    }
}

task javadocZip(type: Jar, dependsOn: javadoc) {
    archiveName "${project.group}-base-${version}-javadoc.jar"
    baseName "${project.group}-base-javadoc"
    from javadoc.destinationDir
}

task distributionZip(type: Zip, dependsOn: [jar, sourcesJar, javadocZip, standaloneTestJar]) {
    def ver = project.ext.versionNumber.startsWith('SNAPSHOT') ? "${version}" : ""
    def myVersion = project.ext.versionNumber.startsWith('SNAPSHOT') ? "${project.ext.versionNumber}-${project.ext.revisionNumber}" : project.ext.versionNumber
    archiveName "${project.group}-base-${myVersion}.zip"
    from ('dist') {
        into "${project.group}-base"
    }

    from ('doc') {
        into "${project.group}-base/doc"
    }

    from (jar.archivePath) {
        into "${project.group}-base/lib"
    }
    
    from (sourcesJar.archivePath) {
        into "${project.group}-base/src"
    }
    
    from (standaloneTestJar.archivePath) {
        into "${project.group}-base/lib"
    }
    
    from (javadocZip.archivePath) {
        into "${project.group}-base/doc"
    }
}

build.dependsOn distributionZip

publishing {
    publications {
        ivy(IvyPublication) {
            module "${project.group}-base"
            revision project.revisionForPublication
            from components.java
            artifact(sourcesJar) {
                type = 'source'
            }
            descriptor {
                withXml {
                    for (org in ['testng', 'rinn']) {
                      asNode().dependencies.dependency.find { it.@org == org }.replaceNode {}
                    }
                }
            }
        }
  }
}