Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
language: java
jdk: oraclejdk7
env:
matrix:
- ANDROID_SDKS=android-8 ANDROID_TARGET=android-8
before_install:
# Install base Android SDK
- sudo apt-get update -qq
- if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch > /dev/null; fi
- wget http://dl.google.com/android/android-sdk_r22.2.1-linux.tgz
- tar xzf android-sdk_r22.2.1-linux.tgz
- export ANDROID_HOME=$PWD/android-sdk-linux
- export PATH=${PATH}:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools

# install android build tools
- wget https://dl-ssl.google.com/android/repository/build-tools_r18.0.1-linux.zip
- unzip build-tools_r18.0.1-linux.zip -d $ANDROID_HOME
- mkdir -p $ANDROID_HOME/build-tools/
- mv $ANDROID_HOME/android-4.3 $ANDROID_HOME/build-tools/18.0.1

# Install required components.
# For a full list, run `android list sdk -a --extended`
# Note that sysimg-18 downloads the ARM, x86 and MIPS images (we should optimize this).
# Other relevant API's
- echo yes | android update sdk --filter platform-tools --no-ui --force > /dev/null
- echo yes | android update sdk --filter android-18 --no-ui --force > /dev/null
- echo yes | android update sdk --filter android-8 --no-ui --force > /dev/null
- echo yes | android update sdk --filter extra-android-support --no-ui > /dev/null
- echo yes | android update sdk --filter extra-android-m2repository --no-ui > /dev/null

# Create and start emulator
- echo no | android create avd --force -n test -t $ANDROID_TARGET
- emulator -avd test -no-skin -no-audio -no-window &
- mv local.properties.sample local.properties
- echo "sdk.dir=$ANDROID_HOME" >> local.properties; cat local.properties;

before_script:
- adb wait-for-device

script:
- ./gradlew connectedInstrumentTest
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.5.+'
classpath 'com.android.tools.build:gradle:0.6.+'
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Sep 16 13:34:36 EDT 2013
#Tue Oct 22 11:40:23 PDT 2013
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.7-bin.zip
distributionUrl=http\://services.gradle.org/distributions/gradle-1.8-all.zip
5 changes: 5 additions & 0 deletions local.properties.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
wp.oauth.redirect_uri=http\://example.com/
wp.oauth.app_secret=WORDPRESS_API_SECRET
wp.oauth.app_id=WORDPRESS_API_ID
wp.db_secret=DB_SECRET
wp.gcm.id=GCM_ID
4 changes: 3 additions & 1 deletion tests/java/org/wordpress/android/TestUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.text.TextUtils;
import android.util.Log;
import org.wordpress.android.WordPress;
import org.wordpress.android.WordPressDB;
Expand Down Expand Up @@ -35,8 +36,9 @@ public static SQLiteDatabase loadDBFromDump(Context targetContext, Context testC
InputStream is = testContext.getAssets().open(filename);
InputStreamReader inputStreamReader = new InputStreamReader(is);
BufferedReader f = new BufferedReader(inputStreamReader);
for (String line = f.readLine(); line != null; line = f.readLine()) {
for (String line = f.readLine(); !TextUtils.isEmpty(line); line = f.readLine()) {
try {
Log.d("WordPress.Test", String.format("Trying to run line %s", line));
db.execSQL(line);
} catch (android.database.sqlite.SQLiteException e ) {
// ignore import errors
Expand Down