Skip to content

Commit

Permalink
Travis config + Fix release build by using an old version of the grad…
Browse files Browse the repository at this point in the history
…le android plugin (#403)

* Use an old version of the gradle android plugin to workaround this bug: https://code.google.com/p/android/issues/detail\?id\=223162

* Use build tools version 25

* New travis config, check for debug and release builds, also run lint checks

* Add extra-google repo to travis config in order to build the Wearable project

* Add old travis trick to lint check with API 25

* Remove unused IDs from the gradle.properties-example

* Update README with the gradle.properties-example file
  • Loading branch information
maxme authored and roundhill committed Dec 6, 2016
1 parent 13c4a6f commit 06f5ed9
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 21 deletions.
30 changes: 30 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
language: android
jdk: oraclejdk8

android:
components:
- extra-google-m2repository
- extra-android-m2repository
- extra-android-support
- platform-tools
- tools
- build-tools-25.0.1
- android-25

env:
global:
- GRADLE_OPTS="-XX:MaxPermSize=4g -Xmx4g"
- ANDROID_SDKS=android-14
- ANDROID_TARGET=android-14

before_install:
# TODO: Remove the following line when Travis' platform-tools are updated to v25+
- echo yes | android update sdk -a --filter platform-tools --no-ui --force

install:
# Setup gradle.properties
- cp Simplenote/gradle.properties-example Simplenote/gradle.properties

script:
- ./gradlew assembleDebug assembleRelease
- ./gradlew lint || (grep -A20 -B2 'severity="Error"' */build/outputs/*.xml; exit 1)
18 changes: 8 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,29 @@ A Simplenote client for Android. Learn more about Simplenote at [Simplenote.com]

## How to Configure

1) Clone repo

```bash
* Clone repo
```shell
git clone https://github.com/Automattic/simplenote-android.git
cd simplenote-android
```

2) Import into Android Studio using the "Gradle" build option. You may need to create a `local.properties` file with the absolute path to the Android SDK:

* Import into Android Studio using the "Gradle" build option. You may need to create a `local.properties` file with the absolute path to the Android SDK:
Sample `local.properties`
```
sdk.dir=/Applications/Android Studio.app/sdk
```

3) Simperium Config

Add your simperium appid and key to Simplenote/gradle.properties, and an empty googleAnalyticsId:

* Configure Simperium, copy the `Simplenote/gradle.properties-example` file to `Simplenote/gradle.properties` and edit your simperium appid and key (You can keep the `googleAnalyticsId` field empty). Your `Simplenote/gradle.properties` file should look like:
```
simperiumAppId=SIMPERIUM_APP_ID
simperiumAppKey=SIMPERIUM_KEY
googleAnalyticsId=
```

4) Install debug build with Android Studio or `./gradlew installDebug`
* Install debug build with Android Studio or:
```shell
./gradlew installDebug
```

_Note: Simplenote API features such as sharing and publishing will not work with development builds._

Expand Down
11 changes: 5 additions & 6 deletions Simplenote/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
maven { url 'https://maven.fabric.io/repo' }
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.0.0'
}
}

Expand Down Expand Up @@ -41,15 +41,15 @@ version "1.5.4"

android {

compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.1"

defaultConfig {
applicationId "com.automattic.simplenote"
versionName project.version
versionCode 57
minSdkVersion 15
targetSdkVersion 24
targetSdkVersion 25

buildConfigField "String", "SIMPERIUM_APP_ID", "\"${project.simperiumAppId}\""
buildConfigField "String", "SIMPERIUM_APP_KEY", "\"${project.simperiumAppKey}\""
Expand All @@ -70,7 +70,7 @@ android {
applicationIdSuffix '.debug'
}
}

lintOptions {
checkReleaseBuilds false
}
Expand All @@ -97,4 +97,3 @@ if(["storeFile", "storePassword", "keyAlias", "keyPassword"].count { !project.ha
}
android.buildTypes.release.signingConfig = android.signingConfigs.release
}

3 changes: 3 additions & 0 deletions Simplenote/gradle.properties-example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
simperiumAppId=FIXME
simperiumAppKey=FIXME
googleAnalyticsId=
9 changes: 4 additions & 5 deletions Wear/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
classpath 'com.android.tools.build:gradle:2.0.0'
}
}
apply plugin: 'com.android.application'
Expand All @@ -13,13 +13,13 @@ repositories {
}

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 25
buildToolsVersion "25.0.1"

defaultConfig {
applicationId "com.automattic.simplenote"
minSdkVersion 20
targetSdkVersion 23
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -33,7 +33,6 @@ android {
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.android.support:wearable:1.3.0'
compile 'com.google.android.gms:play-services-wearable:8.3.0'
}
Expand Down

0 comments on commit 06f5ed9

Please sign in to comment.