apply plugin: 'java'
apply plugin: 'application'

mainClassName = 'ca.uwaterloo.cs858.analysis.Main'

sourceCompatibility = 1.8
targetCompatibility = 1.8

distTar.enabled = false

repositories {
    mavenCentral()
}

distributions {
    main {
        baseName = 'Customization'
        // include the configuration files into the distribution zip
        contents {
            into('/' + distributions.main.baseName) {
                from '.'
                include 'dat/*'
                exclude 'dat/Config.properties'
            }
        }
    }
}

sourceSets {
    main {
        java {
            srcDirs = ["src"]
        }
        resources {
            srcDirs = ["res"]
        }
    }
}

jar {
    baseName = 'Customization'
    version = '0.1'
    manifest {
        attributes 'Main-Class': 'ca.uwaterloo.cs858.analysis.Main'
    }
}

dependencies {
    // http://mvnrepository.com/artifact/com.google.guava/guava
    compile group: 'com.google.guava', name: 'guava', version: '13.0.1'
    // local libs
    compile fileTree(dir: 'libs', include: ['apktool*.jar'])
    compile fileTree(dir: 'libs', include: ['com.ibm.wala.*.jar'])
    compile fileTree(dir: 'libs', include: ['edu.purdue.cs.toydroid*.jar'])
    compile fileTree(dir: 'libs', include: ['dexlib*.jar'])
    // log libs
    compile "org.apache.logging.log4j:log4j-api:2.4"
    compile "org.apache.logging.log4j:log4j-core:2.4"
    // other dependencies
    // commons has been included in apktool
    // http://mvnrepository.com/artifact/commons-cli/commons-cli
    //compile group: 'commons-cli', name: 'commons-cli', version: '1.2'
    // http://mvnrepository.com/artifact/commons-io/commons-io
    //compile group: 'commons-io', name: 'commons-io', version: '2.2'
    // http://mvnrepository.com/artifact/org.slf4j/slf4j-api
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.2'
    // http://mvnrepository.com/artifact/ch.qos.logback/logback-classic
    compile group: 'ch.qos.logback', name: 'logback-core', version: '1.0.9'
    compile group: 'ch.qos.logback', name: 'logback-classic', version: '1.0.9'
}

//
task copyDeps(type: Copy) {
    from(configurations.compile + configurations.testCompile) {
        include "*.jar"
    }
    into rootProject.rootDir.getAbsolutePath() + "/lib"
}
