145 lines
3.2 KiB
Groovy
145 lines
3.2 KiB
Groovy
buildscript {
|
|
repositories {
|
|
google()
|
|
jcenter()
|
|
}
|
|
|
|
dependencies {
|
|
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.8.10'
|
|
}
|
|
}
|
|
|
|
apply plugin: 'java'
|
|
apply plugin: 'com.google.protobuf'
|
|
apply plugin: 'maven'
|
|
apply plugin: 'signing'
|
|
|
|
sourceCompatibility = 1.7
|
|
archivesBaseName = "signal-metadata-java"
|
|
version = version_number
|
|
group = group_info
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
mavenLocal()
|
|
}
|
|
|
|
sourceSets {
|
|
test {
|
|
java {
|
|
srcDirs = ['src/test/java/', project(':tests').file('src/test/java')]
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
compile "org.whispersystems:signal-protocol-java:${protocol_version}"
|
|
compile 'com.google.protobuf:protobuf-javalite:3.10.0'
|
|
|
|
testCompile ('junit:junit:3.8.2')
|
|
}
|
|
|
|
protobuf {
|
|
protoc {
|
|
artifact = 'com.google.protobuf:protoc:3.10.0'
|
|
}
|
|
generateProtoTasks {
|
|
all().each { task ->
|
|
task.builtins {
|
|
java {
|
|
option "lite"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
sourceSets {
|
|
main.proto.srcDir '../protobuf'
|
|
}
|
|
|
|
test {
|
|
testLogging {
|
|
events 'passed'
|
|
showStandardStreams = true
|
|
}
|
|
|
|
include 'org/signal/**'
|
|
}
|
|
|
|
def isReleaseBuild() {
|
|
return version.contains("SNAPSHOT") == false
|
|
}
|
|
|
|
signing {
|
|
required { isReleaseBuild() && gradle.taskGraph.hasTask('uploadArchives') }
|
|
sign configurations.archives
|
|
}
|
|
|
|
uploadArchives {
|
|
configuration = configurations.archives
|
|
repositories.mavenDeployer {
|
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
|
|
|
repository(url: sonatypeRepo) {
|
|
authentication(userName: whisperSonatypeUsername, password: whisperSonatypePassword)
|
|
}
|
|
|
|
pom.project {
|
|
name 'signal-metadata-java'
|
|
packaging 'jar'
|
|
description 'Signal Protocol Plus cryptography library for Java'
|
|
url 'https://github.com/signalapp/libsignal-metadata-java'
|
|
|
|
scm {
|
|
url 'scm:git@github.com:SignalApp/libsignal-metadata-java.git'
|
|
connection 'scm:git@github.com:SignalApp/libsignal-metadata-java.git'
|
|
developerConnection 'scm:git@github.com:SignalApp/libsignal-metadata-java.git'
|
|
}
|
|
|
|
licenses {
|
|
license {
|
|
name 'GPLv3'
|
|
url 'https://www.gnu.org/licenses/gpl-3.0.txt'
|
|
distribution 'repo'
|
|
}
|
|
}
|
|
|
|
developers {
|
|
developer {
|
|
name 'Moxie Marlinspike'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
task installArchives(type: Upload) {
|
|
description "Installs the artifacts to the local Maven repository."
|
|
configuration = configurations['archives']
|
|
repositories {
|
|
mavenDeployer {
|
|
repository url: "file://${System.properties['user.home']}/.m2/repository"
|
|
}
|
|
}
|
|
}
|
|
|
|
task packageJavadoc(type: Jar, dependsOn: 'javadoc') {
|
|
from javadoc.destinationDir
|
|
classifier = 'javadoc'
|
|
}
|
|
|
|
task packageSources(type: Jar) {
|
|
from sourceSets.main.allSource
|
|
classifier = 'sources'
|
|
}
|
|
|
|
artifacts {
|
|
archives(packageJavadoc) {
|
|
type = 'javadoc'
|
|
}
|
|
|
|
archives packageSources
|
|
}
|
|
|