|
1 | 1 | # android-ci |
2 | | -Helper library to automatically build and publish a Android app via CI. |
| 2 | + [  ](https://bintray.com/uncinc/android-ci/UncIncAndroidCIPlugin/_latestVersion) |
| 3 | + |
| 4 | +Helper library to automatically build [~~and publish~~](https://github.com/uncinc/android-ci/issues/1) an Android app via CI. |
3 | 5 |
|
4 | | -In early alpha stage currently. Documentation will follow. |
| 6 | +The current library is an internal testing alpha release, more documentation and features will be available in the future. Feature requests are welcome, please submit a Github issue. |
| 7 | + |
| 8 | +## Setup |
| 9 | +1. Include the repository, to your root build.gradle add the following contents: |
| 10 | +```gradle |
| 11 | +buildscript { |
| 12 | + repositories { |
| 13 | + maven { |
| 14 | + url "https://dl.bintray.com/uncinc/android-ci" |
| 15 | + } |
| 16 | + } |
| 17 | + dependencies { |
| 18 | + classpath 'nl.uncinc.androidci:UncIncAndroidCI:0.2' |
| 19 | + } |
| 20 | +} |
| 21 | +``` |
| 22 | +2. In your app's build.gradle add the following before the `android {` block: |
| 23 | +``` |
| 24 | +apply plugin: 'nl.uncinc.androidci' |
| 25 | +``` |
| 26 | +3. Replace version code, version name, and the signing config for the release build in the Android config: |
| 27 | +``` |
| 28 | +android { |
| 29 | + defaultConfig { |
| 30 | + versionCode project.ext.androidciconfig.getVersionCode() |
| 31 | + versionName project.ext.androidciconfig.getVersionName() |
| 32 | + } |
| 33 | +
|
| 34 | + buildTypes { |
| 35 | + release { |
| 36 | + signingConfig project.ext.androidciconfig.getSigningConfig(project) |
| 37 | + } |
| 38 | + } |
| 39 | +} |
| 40 | +``` |
| 41 | +4. Create a signingProperties file in the build context (example, this as signing.properties): |
| 42 | +``` |
| 43 | +storePassword=keystorePassword |
| 44 | +keyPassword=keyPassword |
| 45 | +keyAlias=key0 |
| 46 | +storeFile=/Full/Path/To/keystore.jks |
| 47 | +``` |
| 48 | +5. For building the app use: |
| 49 | +``` |
| 50 | +./gradlew -Pandroidci.signingProperties=/Full/Path/To/signing.properties -Pandroidci.versionCode=2 |
| 51 | +``` |
| 52 | + |
| 53 | +# Possible properties |
| 54 | +| Property | Purpose | Default Value | |
| 55 | +|-----------------------------|----------------------------------------------------------------------------------|--------------------------------------------------------------------------------| |
| 56 | +| androidci.signingProperties | Full path to the file with the signing configuration. Should be available to CI. | android-app-signing.properties (and if it does not exist. The Debug build key) | |
| 57 | +| androidci.versionCode | Android versionCode, use an Integer value | 1 | |
| 58 | +| androidci.versionName | Android versionName, should be a String | Git hash of the repo | |
| 59 | + |
| 60 | +# License |
| 61 | +MIT License |
| 62 | + |
| 63 | +Copyright (c) 2020 Unc Inc |
| 64 | + |
| 65 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 66 | +of this software and associated documentation files (the "Software"), to deal |
| 67 | +in the Software without restriction, including without limitation the rights |
| 68 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 69 | +copies of the Software, and to permit persons to whom the Software is |
| 70 | +furnished to do so, subject to the following conditions: |
| 71 | + |
| 72 | +The above copyright notice and this permission notice shall be included in all |
| 73 | +copies or substantial portions of the Software. |
| 74 | + |
| 75 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 76 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 77 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 78 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 79 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 80 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
| 81 | +SOFTWARE. |
0 commit comments