Skip to content
Snippets Groups Projects
build.gradle 2.35 KiB
Newer Older
  • Learn to ignore specific revisions
  • felmer's avatar
    felmer committed
    apply from: '../gradle/javaproject.gradle'
    
        compile 'apache:commons-io:+',
                'apache:commons-lang:+',
                '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 {
    
    }
    
    task standaloneTestJar(type: Jar, dependsOn: [classes, testClasses]) {
    
        archiveName "${project.group}-base-test.jar"
    
        from files(sourceSets.main.output.classesDir)
        from files(sourceSets.main.output.resourcesDir)
        from files(sourceSets.test.output.classesDir)
    
     
        from {configurations.testRuntime.collect {zipTree(it)}}
     
        manifest {
            attributes 'Main-Class': 'ch.systemsx.cisd.base.AllTests'
    
    task javadocZip(type: Zip, dependsOn: javadoc) {
    
        archiveName "${project.group}-base-javadoc.zip"
    
        from javadoc.destinationDir
    
    task distributionZip(type: Zip, dependsOn: [jar, sourcesJar, javadocZip, standaloneTestJar]) {
    
        from ('dist') {
    
        }
    
        from ('doc') {
    
        }
    
        from (jar.archivePath) {
    
            into "${project.group}-base/lib"
            rename '(.*)', "${project.group}-base.jar"
    
        }
        
        from (sourcesJar.archivePath) {
    
            into "${project.group}-base/src"
            rename '(.*)', "${project.group}-base-src.jar"
    
        }
        
        from (standaloneTestJar.archivePath) {
    
        }
        
        from (javadocZip.archivePath) {
    
        }
    }
    
    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 {}
                        }
                    }
                }
            }
      }
    }