ext.moduleName = 'aion.apiserver'

// compile error in tests right now, so disable them from build
build.dependsOn.remove("check")

test.dependsOn copyNativeLibsForModuleTests
unitTest.dependsOn copyNativeLibsForModuleTests
benchmarkTest.dependsOn copyNativeLibsForModuleTests

sourceSets {
    test {
        resources {
            srcDirs = ['test_resources']
        }
    }

    unitTest {
        resources {
            srcDirs = ['test']
        }
        java {
            srcDirs = ['test']
            exclude '**/AccountManagerTest.java'
            compileClasspath += main.output + test.output
            runtimeClasspath += main.output + test.output
        }
    }

    benchmarkTest {
        resources {
            srcDirs = ['test']
        }
        java {
            srcDirs = ['test']
            include '**/AccountManagerTest.java'
            compileClasspath += main.output + test.output
            runtimeClasspath += main.output + test.output
        }
    }
}

dependencies {
    compile project(':modUtil')
    compile project(':modLogger')
    compile project(':modCrypto')

    compile project(':modAionImpl')
    compile files("${rootProject.projectDir}/lib/fastvm-c7d37c5.jar")
    compile project(':modEvtMgr')
    compile project(':modEvtMgrImpl')
    compile project(':3rdParty.libnzmq')
    compile files("${rootProject.projectDir}/lib/aion-types-22a3be9.jar")
    compile files("${rootProject.projectDir}/lib/AionRpc.jar")
    compile files("${rootProject.projectDir}/lib/rpc-lib4j-1.1-b6c7789.jar")
    compile 'org.json:json:20180813'
    compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.5.0'
    compile group: 'org.apache.commons', name: 'commons-collections4', version: '4.0'
    compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.4'
    compile 'com.github.ben-manes.caffeine:caffeine:2.8.0'
    compile group: 'org.nanohttpd', name: 'nanohttpd', version: '2.3.1'
    compile group: 'org.jboss.logging', name: 'jboss-logging', version: '3.3.0.Final'
    compile group: 'org.jboss.xnio', name: 'xnio-nio', version: '3.3.8.Final'
    compile group: 'org.jboss.xnio', name: 'xnio-api', version: '3.3.8.Final'
    compile group: 'io.undertow', name: 'undertow-core', version: '2.0.10.Final'

    compile 'com.fasterxml.jackson.core:jackson-core:2.10.3'
    compile 'com.fasterxml.jackson.core:jackson-databind:2.10.3'
    compile 'com.fasterxml.jackson.core:jackson-annotations:2.10.3'
    compile 'com.github.everit-org.json-schema:org.everit.json.schema:1.11.1'
    compile group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-json-org', version: '2.10.3'


    testCompile 'junit:junit:4.12'
    testCompile 'org.hamcrest:hamcrest-all:1.3'
    testCompile "org.mockito:mockito-core:2.23.0"
}

configurations {
    unitTestCompile.extendsFrom testCompile
    unitTestRuntime.extendsFrom testRuntime

    benchmarkTestCompile.extendsFrom testCompile
    benchmarkTestRuntime.extendsFrom testRuntime
}

test {
    testLogging {
        outputs.upToDateWhen {false}
        showStandardStreams = true
    }
}

