Skip to content

Commit

Permalink
Apparently things can't be put in the root build.gradle
Browse files Browse the repository at this point in the history
  • Loading branch information
Emil Sjolander committed Feb 20, 2015
1 parent 9e07e04 commit 76aaef2
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 67 deletions.
69 changes: 59 additions & 10 deletions api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'

android {
compileSdkVersion 21
Expand All @@ -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 '[email protected]'
}
}
}
}
}
}

signing {
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

afterEvaluate { project ->
Expand All @@ -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'
}
57 changes: 0 additions & 57 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 '[email protected]'
}
}
}
}
}
}

signing {
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}
56 changes: 56 additions & 0 deletions compiler/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'signing'

sourceCompatibility = 1.7

Expand All @@ -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 '[email protected]'
}
}
}
}
}
}

signing {
required { has("release") && gradle.taskGraph.hasTask("uploadArchives") }
sign configurations.archives
}

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

0 comments on commit 76aaef2

Please sign in to comment.