gradle相关的配置

gradle 相关的配置 备忘录:

println sourceSets.main.output.classesDir
println sourceSets['test'].output.classesDir




sourceSets.main.output.classesDir = file("$buildDir/classes")


task show << {
    println relativePath(compileJava.destinationDir)
    println relativePath(processResources.destinationDir)
}


//create a single Jar with all dependencies
task fatJar(type: Jar) {
    manifest {
        attributes 'Implementation-Title': 'Gradle Jar',
            'Implementation-Version': version,
            'Main-Class': 'cn.wps.push.MonitorSevice'
    }


    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    with jar
}




jar {
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    manifest {
        attributes 'Main-Class': 'cn.wps.push.MonitorSevice'
    }
    baseName = project.name + '-all'
}




task listJars << {
    configurations.compile.each { File file -> println file.name }
}

你可能感兴趣的:(java)