view build.gradle @ 342:c81dff5460b0

add build.gradle
author sugi
date Wed, 16 Apr 2014 16:48:59 +0900
parents
children d46c42352e4f
line wrap: on
line source

apply plugin: 'java'
apply plugin: 'eclipse'

version = '1.0'

dependencies {
    compile fileTree(dir: 'lib', include: '*.jar')
    runtime fileTree(dir: 'lib', include: '*.jar')
    testCompile group: 'junit', name: 'junit', version: '4.+'
}

jar {
    copy {
        from configurations.compile
        into 'app/lib'
    }
    
    def manifestClasspath = configurations.compile.collect{ 'lib/' + it.getName() }.join(' ')
    manifest {
        attributes 'Implementation-Title': 'Gradle Quickstart'
        attributes 'Implementation-Version': version
        attributes 'Main-Class' : 'org.gradle.GradleMain'
        attributes 'Class-Path': manifestClasspath
    }
    
    from (configurations.compile.resolve().collect { it.isDirectory() ? it : fileTree(it) }) {
        exclude 'META-INF/MANIFEST.MF'
        exclude 'META-INF/*.SF'
        exclude 'META-INF/*.DSA'
        exclude 'META-INF/*.RSA'
        exclude '**/*.jar'
    }
    
    destinationDir = file('app')
    archiveName = 'GradleTest.jar'
}

repositories {
    mavenCentral()
}

test {
    systemProperties 'property': 'value'
}