buildscript {
    dependencies {
        classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.3'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
    }
}

apply plugin: 'java-library'
apply plugin: 'com.google.protobuf'

dependencies {
    implementation 'com.google.crypto.tink:tink:1.1.0'
    implementation 'com.google.crypto.tink:apps-webpush:1.1.0'
    implementation 'com.google.protobuf:protobuf-java:3.4.0'
    testImplementation 'junit:junit:4.12'
}

protobuf {
    protoc {
        artifact = 'com.google.protobuf:protoc:3.0.0'
    }
}

task sourcesJar(type: Jar, dependsOn: classes) {
    classifier = 'sources'
    from sourceSets.main.allSource
}

task javadocJar(type: Jar, dependsOn: javadoc) {
    classifier = 'javadoc'
    from javadoc.destinationDir
}

artifacts {
    archives sourcesJar
    archives javadocJar
}

// Inform IntelliJ projects about the generated code.
apply plugin: 'idea'

idea {
    module {
        sourceDirs += file("${projectDir}/build/generated/source/proto/main/java")
    }
}

apply from: 'publish.gradle'
