Skip to content
This repository has been archived by the owner on Feb 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #9 from komatatsu/add_bintray_upload
Browse files Browse the repository at this point in the history
add bintray publish task and releng task
  • Loading branch information
komatatsu committed Sep 6, 2016
2 parents 3affd89 + 28828b0 commit 653915e
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 4 deletions.
9 changes: 9 additions & 0 deletions README.md
Expand Up @@ -39,3 +39,12 @@ protected void onCreate(Bundle savedInstanceState) {
</provider>
</application>
```

# For Developers

## How to publish for jcenter

1. create [bintray](https://bintray.com/) account
2. get API_KEY from your profile edit page
3. `./gradlew clean build bintrayUpload -PbintrayUser=[your account name] -PbintrayKey=[your api key] -PdryRun=false`
4. `./gradlew releng`
8 changes: 6 additions & 2 deletions build.gradle
Expand Up @@ -5,8 +5,8 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'

classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.novoda:bintray-release:0.3.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand All @@ -17,3 +17,7 @@ allprojects {
jcenter()
}
}

task releng(dependsOn: ':library:releng') {
description = 'Make a release engineering: git tag && git push'
}
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
#Thu Dec 11 10:31:44 JST 2014
#Tue Sep 06 11:34:59 JST 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
39 changes: 39 additions & 0 deletions library/build.gradle
@@ -1,4 +1,5 @@
apply plugin: 'com.android.library'
apply plugin: 'com.novoda.bintray-release'

def VERSION_CODE = 1
def VERSION_NAME = '2.1.0'
Expand Down Expand Up @@ -28,9 +29,47 @@ android {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}

android {
lintOptions {
abortOnError false
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:22.0.0'
}

//bintray-publish
publish {
userOrg = 'cookpad-inc'
groupId = 'com.cookpad.android'
artifactId = 'issue-reporter'
publishVersion = VERSION_NAME
desc = 'A gradle plugin to report android application issue'
website = 'https://github.com/cookpad/issue-reporter-android'
}

//releng
def git(String command) {
def proc = ["sh", "-c", "cd ${project.rootDir} ; git ${command}"].execute()
if (proc.waitFor() != 0) {
throw new GradleException(proc.err.text.trim())
}
return proc.in.text;
}

task 'releng' << {
def timestamp = new Date().format("yyyyMMddHHmm")
def tag = "v${android.defaultConfig.versionName}-${timestamp}"

println "[releng] making a release engineering for $tag (${git('rev-parse HEAD').trim()}))"

println "[releng] git tag $tag"
git "tag $tag"

println "[releng] git push origin $tag"
git "push origin $tag"
}

0 comments on commit 653915e

Please sign in to comment.