From 11c415f60b84e16d8ae074a67128cf9fafda857e Mon Sep 17 00:00:00 2001 From: Andrew Chen Date: Tue, 30 Jun 2015 13:25:37 +0800 Subject: [PATCH] Add auto-json and retrofacebook-annotation refer #37 --- auto-json/build.gradle | 2 +- auto-json/deploy.gradle | 111 +++++++++++++++++++++ auto-json/gradle.properties | 20 ++++ retrofacebook-annotation/build.gradle | 2 +- retrofacebook-annotation/deploy.gradle | 111 +++++++++++++++++++++ retrofacebook-annotation/gradle.properties | 20 ++++ retrofacebook-app/build.gradle | 2 + 7 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 auto-json/deploy.gradle create mode 100644 auto-json/gradle.properties create mode 100644 retrofacebook-annotation/deploy.gradle create mode 100644 retrofacebook-annotation/gradle.properties diff --git a/auto-json/build.gradle b/auto-json/build.gradle index cf76ea5..8243001 100644 --- a/auto-json/build.gradle +++ b/auto-json/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'java' -//apply from: file('deploy.gradle') +apply from: file('deploy.gradle') targetCompatibility = '1.7' sourceCompatibility = '1.7' diff --git a/auto-json/deploy.gradle b/auto-json/deploy.gradle new file mode 100644 index 0000000..1184f2a --- /dev/null +++ b/auto-json/deploy.gradle @@ -0,0 +1,111 @@ +/* + * Copyright 2013 Chris Banes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return hasProperty('BINTRAY_USER') ? BINTRAY_USER : "" +} + +def getRepositoryPassword() { + return hasProperty('BINTRAY_KEY') ? BINTRAY_KEY : "" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + // http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradle + task javadocsJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir + //classpath += configurations.compile // http://stackoverflow.com/questions/10895032/javadoc-with-gradle-dont-get-the-libraries-while-running-javadoc-task + } + + task sourcesJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource + } + + artifacts { + archives sourcesJar + archives javadocsJar + } +} diff --git a/auto-json/gradle.properties b/auto-json/gradle.properties new file mode 100644 index 0000000..d1c2e33 --- /dev/null +++ b/auto-json/gradle.properties @@ -0,0 +1,20 @@ +VERSION_NAME=1.0.1 +VERSION_CODE=101 +GROUP=com.infstory + +POM_DESCRIPTION=Using RxJava to wrap original Facebook SDK +POM_URL=https://github.com/yongjhih/RetroFacebook +POM_SCM_URL=https://github.com/yongjhih/RetroFacebook +POM_SCM_CONNECTION=scm:git@github.com:yongjhih/RetroFacebook.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:yongjhih/RetroFacebook.git +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=yongjhih +POM_DEVELOPER_NAME=Andrew Chen + +POM_NAME=Retrofit Facebook Android SDK +POM_ARTIFACT_ID=auto-json +POM_PACKAGING=jar + +RELEASE_REPOSITORY_URL=https://api.bintray.com/maven/yongjhih/maven/AutoJson/ diff --git a/retrofacebook-annotation/build.gradle b/retrofacebook-annotation/build.gradle index cf93b92..a69e85a 100644 --- a/retrofacebook-annotation/build.gradle +++ b/retrofacebook-annotation/build.gradle @@ -1,5 +1,5 @@ apply plugin: 'java' -//apply from: file('deploy.gradle') +apply from: file('deploy.gradle') targetCompatibility = '1.7' sourceCompatibility = '1.7' diff --git a/retrofacebook-annotation/deploy.gradle b/retrofacebook-annotation/deploy.gradle new file mode 100644 index 0000000..1184f2a --- /dev/null +++ b/retrofacebook-annotation/deploy.gradle @@ -0,0 +1,111 @@ +/* + * Copyright 2013 Chris Banes + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +apply plugin: 'maven' +apply plugin: 'signing' + +def isReleaseBuild() { + return VERSION_NAME.contains("SNAPSHOT") == false +} + +def getReleaseRepositoryUrl() { + return hasProperty('RELEASE_REPOSITORY_URL') ? RELEASE_REPOSITORY_URL + : "https://oss.sonatype.org/service/local/staging/deploy/maven2/" +} + +def getSnapshotRepositoryUrl() { + return hasProperty('SNAPSHOT_REPOSITORY_URL') ? SNAPSHOT_REPOSITORY_URL + : "https://oss.sonatype.org/content/repositories/snapshots/" +} + +def getRepositoryUsername() { + return hasProperty('BINTRAY_USER') ? BINTRAY_USER : "" +} + +def getRepositoryPassword() { + return hasProperty('BINTRAY_KEY') ? BINTRAY_KEY : "" +} + +afterEvaluate { project -> + uploadArchives { + repositories { + mavenDeployer { + beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) } + + pom.groupId = GROUP + pom.artifactId = POM_ARTIFACT_ID + pom.version = VERSION_NAME + + repository(url: getReleaseRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + snapshotRepository(url: getSnapshotRepositoryUrl()) { + authentication(userName: getRepositoryUsername(), password: getRepositoryPassword()) + } + + pom.project { + name POM_NAME + packaging POM_PACKAGING + description POM_DESCRIPTION + url POM_URL + + scm { + url POM_SCM_URL + connection POM_SCM_CONNECTION + developerConnection POM_SCM_DEV_CONNECTION + } + + licenses { + license { + name POM_LICENCE_NAME + url POM_LICENCE_URL + distribution POM_LICENCE_DIST + } + } + + developers { + developer { + id POM_DEVELOPER_ID + name POM_DEVELOPER_NAME + } + } + } + } + } + } + + signing { + required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") } + sign configurations.archives + } + + // http://stackoverflow.com/questions/11474729/how-to-build-sources-jar-with-gradle + task javadocsJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir + //classpath += configurations.compile // http://stackoverflow.com/questions/10895032/javadoc-with-gradle-dont-get-the-libraries-while-running-javadoc-task + } + + task sourcesJar(type: Jar) { + classifier = 'sources' + from sourceSets.main.allSource + } + + artifacts { + archives sourcesJar + archives javadocsJar + } +} diff --git a/retrofacebook-annotation/gradle.properties b/retrofacebook-annotation/gradle.properties new file mode 100644 index 0000000..675f6f5 --- /dev/null +++ b/retrofacebook-annotation/gradle.properties @@ -0,0 +1,20 @@ +VERSION_NAME=1.0.1 +VERSION_CODE=101 +GROUP=com.infstory + +POM_DESCRIPTION=Using RxJava to wrap original Facebook SDK +POM_URL=https://github.com/yongjhih/RetroFacebook +POM_SCM_URL=https://github.com/yongjhih/RetroFacebook +POM_SCM_CONNECTION=scm:git@github.com:yongjhih/RetroFacebook.git +POM_SCM_DEV_CONNECTION=scm:git@github.com:yongjhih/RetroFacebook.git +POM_LICENCE_NAME=The Apache Software License, Version 2.0 +POM_LICENCE_URL=http://www.apache.org/licenses/LICENSE-2.0.txt +POM_LICENCE_DIST=repo +POM_DEVELOPER_ID=yongjhih +POM_DEVELOPER_NAME=Andrew Chen + +POM_NAME=Retrofit Facebook Android SDK +POM_ARTIFACT_ID=retrofacebook-annotation +POM_PACKAGING=jar + +RELEASE_REPOSITORY_URL=https://api.bintray.com/maven/yongjhih/maven/RetroFacebookAnnotation/ diff --git a/retrofacebook-app/build.gradle b/retrofacebook-app/build.gradle index 1351923..db9a3e3 100644 --- a/retrofacebook-app/build.gradle +++ b/retrofacebook-app/build.gradle @@ -76,6 +76,8 @@ dependencies { v3Compile project(':retrofacebook-v3') v4Compile project(':retrofacebook') + //v3Compile 'com.infstory:retrofacebook-v3:1.0.1' + //v4Compile 'com.infstory:retrofacebook-v4:1.0.1' compile 'io.reactivex:rxjava:1.0.9' compile 'io.reactivex:rxandroid:0.24.0'