diff --git a/api/build.gradle b/api/build.gradle index b4f6854..dce1058 100644 --- a/api/build.gradle +++ b/api/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'com.android.library' +apply plugin: 'maven' +apply plugin: 'signing' android { compileSdkVersion 21 @@ -14,9 +16,58 @@ android { } } -dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) - provided 'com.google.code.gson:gson:2.3.1' +configurations { + archives { + extendsFrom configurations.default + } +} + +version = "1.2.0" +group = "com.flipboard.goldengate" + +if (canUploadArchives()) { + uploadArchives { + configuration = configurations.archives + repositories.mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: sonatypeRepo) { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } + + pom.project { + name 'GoldenGate' + packaging 'jar' + description 'Generate type safe java bridge into webview javascript code' + url 'https://github.com/flipboard/GoldenGate' + + scm { + url 'https://github.com/Flipboard/GoldenGate.git' + } + + licenses { + license { + name 'BSD 3-Clause License' + url 'https://github.com/Flipboard/GoldenGate/blob/master/LICENSE' + distribution 'repo' + } + } + + developers { + developer { + id 'emilsjolander' + name 'Emil Sjölander' + email 'esjolander@flipboard.com' + } + } + } + } + } +} + +signing { + required { has("release") && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives } afterEvaluate { project -> @@ -35,15 +86,13 @@ afterEvaluate { project -> from android.sourceSets.main.java.srcDirs } - android.libraryVariants.all { variant -> - def name = variant.name.capitalize() - task "jar${name}"(type: Jar) { - from variant.javaCompile.destinationDir - } - } - artifacts { archives androidJavadocJar archives androidSourcesJar } } + +dependencies { + compile fileTree(dir: 'libs', include: ['*.jar']) + provided 'com.google.code.gson:gson:2.3.1' +} diff --git a/build.gradle b/build.gradle index 576af2b..0c54940 100644 --- a/build.gradle +++ b/build.gradle @@ -15,63 +15,6 @@ allprojects { } } -apply plugin: 'maven' -apply plugin: 'signing' - -version = "1.2.0" -group = "com.flipboard.goldengate" - def canUploadArchives() { return project.hasProperty('sonatypeUsername') && project.hasProperty('sonatypePassword') && project.hasProperty('sonatypeRepo') -} - -configurations { - archives { - extendsFrom configurations.default - } -} - -if (canUploadArchives()) { - uploadArchives { - configuration = configurations.archives - repositories.mavenDeployer { - beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } - - repository(url: sonatypeRepo) { - authentication(userName: sonatypeUsername, password: sonatypePassword) - } - - pom.project { - name 'GoldenGate' - packaging 'jar' - description 'Generate type safe java bridge into webview javascript code' - url 'https://github.com/flipboard/GoldenGate' - - scm { - url 'https://github.com/Flipboard/GoldenGate.git' - } - - licenses { - license { - name 'BSD 3-Clause License' - url 'https://github.com/Flipboard/GoldenGate/blob/master/LICENSE' - distribution 'repo' - } - } - - developers { - developer { - id 'emilsjolander' - name 'Emil Sjölander' - email 'esjolander@flipboard.com' - } - } - } - } - } -} - -signing { - required { has("release") && gradle.taskGraph.hasTask("uploadArchives") } - sign configurations.archives } \ No newline at end of file diff --git a/compiler/build.gradle b/compiler/build.gradle index 05a81e8..e500a40 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -1,4 +1,6 @@ apply plugin: 'java' +apply plugin: 'maven' +apply plugin: 'signing' sourceCompatibility = 1.7 @@ -10,6 +12,60 @@ sourceSets { } } +configurations { + archives { + extendsFrom configurations.default + } +} + +version = "1.2.0" +group = "com.flipboard.goldengate" + +if (canUploadArchives()) { + uploadArchives { + configuration = configurations.archives + repositories.mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + repository(url: sonatypeRepo) { + authentication(userName: sonatypeUsername, password: sonatypePassword) + } + + pom.project { + name 'GoldenGate' + packaging 'jar' + description 'Generate type safe java bridge into webview javascript code' + url 'https://github.com/flipboard/GoldenGate' + + scm { + url 'https://github.com/Flipboard/GoldenGate.git' + } + + licenses { + license { + name 'BSD 3-Clause License' + url 'https://github.com/Flipboard/GoldenGate/blob/master/LICENSE' + distribution 'repo' + } + } + + developers { + developer { + id 'emilsjolander' + name 'Emil Sjölander' + email 'esjolander@flipboard.com' + } + } + } + } + } +} + +signing { + required { has("release") && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives +} + task sourcesJar(type: Jar, dependsOn: classes) { classifier = 'sources' from sourceSets.main.allSource