plugins {
    id 'java-library'
}

archivesBaseName = 'mstreaming'

sourceSets {
    main {
        java {
            srcDir 'java/src'
            srcDir 'java/build/messages-src'
        }
    }
    test {
        java {
            srcDir 'java/test/junit'
        }
    }
}

dependencies {
    api project(':core')
}

// Create the java files from the po files. The jar task will compile them.
// This requires gettext 0.19 or higher.
// We don't support the "slow way"
task bundle {
    doLast {
        if (!(new File("$buildDir/classes/java/main/net/i2p/client/streaming/messages_de.class")).exists())
            println "apps/ministreaming/java/bundle-messages.sh".execute().text
    }
}
jar.dependsOn bundle

jar {
    manifest {
        attributes 'Specification-Title': 'I2P Streaming API'
        attributes 'Implementation-Title': 'I2P Java Streaming API'
    }
}

configurations {
    tests
}
task testJar(type: Jar) {
    archiveBaseName = 'mstreaming-test'
    dependsOn classes
    from sourceSets.test.output
}
artifacts {
    tests testJar
}
