/*
 * SPDX-License-Identifier: Apache2.0
 */
plugins {
    id 'com.github.johnrengelman.shadow' version '7.0.0'
    id 'java'
}

version = '0.0.1'

sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8

repositories {
    mavenLocal()
    mavenCentral()
    maven {
        url 'https://jitpack.io'
    }
    maven {
        url "https://nexus.hyperledger.org/content/repositories/snapshots/"
    }
}

dependencies {
    implementation group: 'org.hyperledger.fabric-chaincode-java', name: 'fabric-chaincode-shim', version: '2.5.0'
    implementation group: 'org.json', name: 'json', version: '20180813'
    testImplementation 'org.junit.jupiter:junit-jupiter:5.4.2'
    testImplementation 'org.assertj:assertj-core:3.11.1'
    testImplementation 'org.mockito:mockito-core:2.+'
}

shadowJar {
    archiveBaseName.set('chaincode')
    archiveVersion.set('')
    archiveClassifier.set('')

    manifest {
        attributes 'Main-Class': 'org.hyperledger.fabric.contract.ContractRouter'
    }
}

test {
    useJUnitPlatform()
    testLogging {
        events "passed", "skipped", "failed"
    }
}

tasks.withType(JavaCompile) {
    options.compilerArgs += ["-Xlint:unchecked", "-Xlint:deprecation", "-parameters"]
}
