group 'hlib.mykhailenko'
version '1.0-SNAPSHOT'

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

mainClassName = "PartitionAndMeasure"

sourceCompatibility = 1.8

repositories {

    maven {
        url "http://repo.akka.io/releases/"
    }

    mavenCentral()
}

dependencies {
    compile 'org.scala-lang:scala-library:2.12.6'
    compile 'org.apache.spark:spark-core_2.10:1.1.0'
    compile 'org.apache.spark:spark-graphx_2.10:1.1.0'
    compile 'io.spray:spray-json_2.10:1.3.1'

    testCompile 'junit:junit:4.12'
}

def myManifest = {
    attributes 'Implementation-Title': 'Retrieve graph metrics',
            'Implementation-Version': version,
            'Main-Class': 'hlib.mykhailenko.PartitionAndMeasure'
}

jar {
    manifest (myManifest)
}

task scoreJar(type: Jar) {
    dependsOn build
    manifest (myManifest)
    baseName = project.name + '-fat'
    from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } }
    exclude 'META-INF/*.RSA', 'META-INF/*.SF', 'META-INF/*.DSA'
    with jar
}

