From f27044857aa53e5cdd67f51b7c54ac5a0d3b6e08 Mon Sep 17 00:00:00 2001 From: Zoff Date: Sun, 10 Jul 2016 15:05:41 +0200 Subject: [PATCH 01/13] build with circleCI --- circle.yml | 135 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 circle.yml diff --git a/circle.yml b/circle.yml new file mode 100644 index 0000000..8ed849a --- /dev/null +++ b/circle.yml @@ -0,0 +1,135 @@ +machine: + timezone: + Europe/Vienna + environment: + ZEMU_: "appemu23" + EMU_: "appemu21" + XEMU_: "appemu10" + Zsdpath: "/sdcard" + sdpath: "/storage/sdcard" + Xsdpath: "/mnt/sdcard" + ANDROID_HOME: /usr/local/android-sdk-linux + ANDROID_SDK: /usr/local/android-sdk-linux/ + _SDK_: /usr/local/android-sdk-linux/ + GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1000m -XX:+HeapDumpOnOutOfMemoryError"' + CLASS_P: org.microg.nlp.backend.nominatim + START_INTENT_P: .BackendService +dependencies: + cache_directories: + - ~/.android + - ~/.gradle + override: + - echo "dummy" + pre: + - sudo apt-get update > /dev/null 2> /dev/null + - sudo apt-get install xvfb > /dev/null 2> /dev/null + - sudo apt-get install xdotool > /dev/null 2> /dev/null + - sudo apt-get install telnet > /dev/null 2> /dev/null + - sudo apt-get install x11-utils > /dev/null 2> /dev/null + - sudo apt-get install xvkbd > /dev/null 2> /dev/null + - sudo apt-get install qrencode > /dev/null 2> /dev/null + + - gradle -v # display gradle version + - echo y | android update sdk --no-ui --all --filter "tools" + - android list sdk --all | grep -i tools + - android list sdk --all --extended + + - echo y | android update sdk --no-ui --all --filter build-tools-23.0.3 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter build-tools-22.0.0 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter android-23 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter platform-tools > /dev/null 2> /dev/null + + - echo y | android update sdk --no-ui --all --filter extra-android-m2repository > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter extra-google-m2repository > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter extra-android-support > /dev/null 2> /dev/null + + - echo y | android update sdk --no-ui --all --filter platform-tools-preview > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-23 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-addon-google_apis-google-23 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter addon-google_apis-google-23 > /dev/null 2> /dev/null + + - pwd ; ls -al + + - cat app/build.gradle | grep 'useCompileDaemon' + - sed -i -e 's#scalaCompileOptions.useCompileDaemon = true#scalaCompileOptions.useCompileDaemon = false#' app/build.gradle + - cat app/build.gradle | grep 'useCompileDaemon' + + - ./gradlew assembleDebug --stacktrace --info --no-daemon + - ls -al app/build/outputs/apk/ ; exit 0 + + - zip -d app/build/outputs/apk/app-debug-unaligned.apk META-INF/\* # remove signature !! + - cp -av app/build/outputs/apk/app-debug-unaligned.apk ~/app.apk ; + cd ~/ ; + echo xxxxxxrm -f ~/.android/debug.keystore ; + ls -al ~/.android/debug.keystore ; + if [ ! -f ~/.android/debug.keystore ]; then echo "*** generating new signer key ***" ; + echo "*** generating new signer key ***"; + echo "*** generating new signer key ***"; + keytool -genkey -v -keystore ~/.android/debug.keystore -storepass android -keyalg RSA -keysize 2048 -validity 10000 -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US" ; + fi ; + ls -al ~/ ; + jarsigner -verbose -keystore ~/.android/debug.keystore -storepass android -keypass android -sigalg SHA1withRSA -digestalg SHA1 -sigfile CERT -signedjar app-signed.apk app.apk androiddebugkey ; + ls -al ~/ ; + $_SDK_/build-tools/23.0.3/zipalign -v 4 app-signed.apk app-signed-aligned.apk ; + ls -al ~/ ; + pwd ; + ls -al ; + cp -av app-signed-aligned.apk $CIRCLE_ARTIFACTS/${CIRCLE_PROJECT_REPONAME}.apk || exit 1 + +## also make apk files with different names for each build (for individual downloads) + - cp -av $CIRCLE_ARTIFACTS/${CIRCLE_PROJECT_REPONAME}.apk $CIRCLE_ARTIFACTS/${CIRCLE_PROJECT_REPONAME}_circleci_$CIRCLE_SHA1.apk ; exit 0 +## qr code to scan with your phone to directly download the apk file (for convenience) + - qrencode -o $CIRCLE_ARTIFACTS/QR_apk.png 'https://circle-artifacts.com/gh/'${CIRCLE_PROJECT_USERNAME}'/'${CIRCLE_PROJECT_REPONAME}'/'${CIRCLE_BUILD_NUM}'/artifacts/'${CIRCLE_NODE_INDEX}'/tmp/'`basename $CIRCLE_ARTIFACTS`'/'"${CIRCLE_PROJECT_REPONAME}_circleci_$CIRCLE_SHA1.apk" ; exit 0 +## qr code to go directly to the aritfacts (to scan with phone) + - qrencode -o $CIRCLE_ARTIFACTS/QR_artifacts.png 'https://circleci.com/gh/'${CIRCLE_PROJECT_USERNAME}'/'${CIRCLE_PROJECT_REPONAME}'/'${CIRCLE_BUILD_NUM}'#artifacts' ; exit 0 + +test: + pre: + - mksdcard -l e 180M sdcard.img + - echo 'mtools_skip_check=1' > ~/.mtoolsrc + - android list targets +# + - if [ "$EMU_" == "appemu23" ]; then echo "no" | android create avd -n appemu23 -f -t android-23 --abi default/armeabi-v7a --skin "WXGA720" ; fi + - if [ "$EMU_" == "appemu23" ]; then cat ~/.android/avd/appemu23.avd/config.ini ; fi +# + - if [ "$EMU_" == "appemu21" ]; then echo "no" | android create avd -n appemu21 -f -t android-21 --abi default/armeabi-v7a --skin "WXGA720" ; fi + - if [ "$EMU_" == "appemu21" ]; then cat ~/.android/avd/appemu21.avd/config.ini ; fi +# + - if [ "$EMU_" == "appemu10" ]; then echo "no" | android create avd -n appemu10 -f -t android-10 --abi default/armeabi --skin "WQVGA432" ; fi + - if [ "$EMU_" == "appemu10" ]; then cat ~/.android/avd/appemu10.avd/config.ini ; fi +# + - echo "$EMU_" + - echo "$sdpath" + override: + - emulator -avd "$EMU_" -sdcard sdcard.img -no-audio: + background: true + parallel: true + - circle-android wait-for-boot + + - sleep 210 # let the emulator settle down first + + - adb shell input keyevent 82 # remove lock screen on emulator + - sleep 10 + - import -window root $CIRCLE_ARTIFACTS/capture_emulator_running.png + + - fb-adb shell "cat /proc/meminfo" ; exit 0 + + - adb shell ls -al / ; exit 0 + - adb shell ls -al /storage/ ; exit 0 + - adb shell ls -al /sdcard/ ; exit 0 + + - adb install ~/app-signed-aligned.apk + + - adb logcat -v time > $CIRCLE_ARTIFACTS/adb_out.txt 2>&1 : + background: true + - sleep 60 # let the emulator settle down first + + - fb-adb shell am start -n $CLASS_P/$START_INTENT_P + - sleep 60 + - sleep 120 # wait to be sure the app has started fully + + - died_count=`cat $CIRCLE_ARTIFACTS/adb_out.txt|grep 'Process. '"$CLASS_P"', PID.'|wc -l|tr -d ' '` ; if [ $died_count -gt 0 ]; then echo "app crashed"; exit 1; fi + + - import -window root $CIRCLE_ARTIFACTS/capture_app_running.png # get proof that the app is running + - adb shell screencap -p | sed 's/\r$//' > $CIRCLE_ARTIFACTS/capture_app_running_2.png + From 0d5635476bb3ddcfe6ca186716dcb154f3b866c3 Mon Sep 17 00:00:00 2001 From: Zoff Date: Sun, 10 Jul 2016 15:16:06 +0200 Subject: [PATCH 02/13] tweak --- circle.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/circle.yml b/circle.yml index 8ed849a..c8984c2 100644 --- a/circle.yml +++ b/circle.yml @@ -50,12 +50,9 @@ dependencies: - pwd ; ls -al - - cat app/build.gradle | grep 'useCompileDaemon' - - sed -i -e 's#scalaCompileOptions.useCompileDaemon = true#scalaCompileOptions.useCompileDaemon = false#' app/build.gradle - - cat app/build.gradle | grep 'useCompileDaemon' - - ./gradlew assembleDebug --stacktrace --info --no-daemon - - ls -al app/build/outputs/apk/ ; exit 0 + - ls -al build/outputs/apk/ ; exit 0 + - find . -name '*.apk' ; exit 0 - zip -d app/build/outputs/apk/app-debug-unaligned.apk META-INF/\* # remove signature !! - cp -av app/build/outputs/apk/app-debug-unaligned.apk ~/app.apk ; From 328734cfde7d223afdeef90b1900d3524600f023 Mon Sep 17 00:00:00 2001 From: Zoff Date: Sun, 10 Jul 2016 15:21:39 +0200 Subject: [PATCH 03/13] tweak 2 --- circle.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/circle.yml b/circle.yml index c8984c2..656bc6f 100644 --- a/circle.yml +++ b/circle.yml @@ -54,6 +54,10 @@ dependencies: - ls -al build/outputs/apk/ ; exit 0 - find . -name '*.apk' ; exit 0 +# --- copy apk file to generic location --- + - cp -av ./build/outputs/apk/NominatimGeocoderBackend-debug-unaligned.apk app/build/outputs/apk/app-debug-unaligned.apk +# --- copy apk file to generic location --- + - zip -d app/build/outputs/apk/app-debug-unaligned.apk META-INF/\* # remove signature !! - cp -av app/build/outputs/apk/app-debug-unaligned.apk ~/app.apk ; cd ~/ ; From 3774de8b0c0c63fd7a8842a59290fe232e8ffc3f Mon Sep 17 00:00:00 2001 From: Zoff Date: Sun, 10 Jul 2016 15:39:38 +0200 Subject: [PATCH 04/13] tweak 3 --- circle.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/circle.yml b/circle.yml index 656bc6f..69756fe 100644 --- a/circle.yml +++ b/circle.yml @@ -55,6 +55,7 @@ dependencies: - find . -name '*.apk' ; exit 0 # --- copy apk file to generic location --- + - mkdir -p ./app/build/outputs/apk/ - cp -av ./build/outputs/apk/NominatimGeocoderBackend-debug-unaligned.apk app/build/outputs/apk/app-debug-unaligned.apk # --- copy apk file to generic location --- From 360ddbd18eb2e7ceecae33f7c08efe09c0c8f203 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:12:51 +0200 Subject: [PATCH 05/13] 1 --- src/main/AndroidManifest.xml | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/main/AndroidManifest.xml b/src/main/AndroidManifest.xml index 15a7e95..dcb7525 100644 --- a/src/main/AndroidManifest.xml +++ b/src/main/AndroidManifest.xml @@ -1,14 +1,15 @@ + android:versionName="1.1.1" + android:versionCode="10101" + package="org.microg.nlp.backend.nominatim"> - + + android:minSdkVersion="11" + android:targetSdkVersion="22" /> + - + + + + + + + + + From f05bedb16f43dbdfed18345a9026167c30199c13 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:13:31 +0200 Subject: [PATCH 06/13] 2 --- .../nlp/backend/nominatim/BackendService.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/microg/nlp/backend/nominatim/BackendService.java b/src/main/java/org/microg/nlp/backend/nominatim/BackendService.java index 0a4ec07..4f14148 100644 --- a/src/main/java/org/microg/nlp/backend/nominatim/BackendService.java +++ b/src/main/java/org/microg/nlp/backend/nominatim/BackendService.java @@ -1,10 +1,12 @@ package org.microg.nlp.backend.nominatim; import android.content.Context; +import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.location.Address; import android.net.Uri; import android.os.Build; +import android.preference.PreferenceManager; import android.util.Log; import org.json.JSONArray; @@ -28,11 +30,11 @@ public class BackendService extends GeocoderBackendService { private static final String SERVICE_URL_MAPQUEST = "http://open.mapquestapi.com/nominatim/v1/"; private static final String SERVICE_URL_OSM = " http://nominatim.openstreetmap.org/"; private static final String REVERSE_GEOCODE_URL = - "%sreverse?format=json&accept-language=%s&lat=%f&lon=%f"; + "%sreverse?format=json&key=%s&accept-language=%s&lat=%f&lon=%f"; private static final String SEARCH_GEOCODE_URL = - "%ssearch?format=json&accept-language=%s&addressdetails=1&bounded=1&q=%s&limit=%d"; + "%ssearch?format=json&key=%s&accept-language=%s&addressdetails=1&bounded=1&q=%s&limit=%d"; private static final String SEARCH_GEOCODE_WITH_BOX_URL = - "%ssearch?format=json&accept-language=%s&addressdetails=1&bounded=1&q=%s&limit=%d" + + "%ssearch?format=json&key=%s&accept-language=%s&addressdetails=1&bounded=1&q=%s&limit=%d" + "&viewbox=%f,%f,%f,%f"; private static final String WIRE_LATITUDE = "lat"; private static final String WIRE_LONGITUDE = "lon"; @@ -51,8 +53,12 @@ public class BackendService extends GeocoderBackendService { @Override protected List
getFromLocation(double latitude, double longitude, int maxResults, String locale) { + + SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); + String mapquestApiKey = SP.getString("api_preference", "NA"); + String url = String.format(Locale.US, REVERSE_GEOCODE_URL, SERVICE_URL_MAPQUEST, - locale.split("_")[0], latitude, longitude); + mapquestApiKey, locale.split("_")[0], latitude, longitude); try { JSONObject result = new JSONObject(new AsyncGetRequest(this, url).asyncStart().retrieveString()); @@ -84,15 +90,19 @@ private static Locale localeFromLocaleString(String localeString) { protected List
getFromLocationName(String locationName, int maxResults, double lowerLeftLatitude, double lowerLeftLongitude, double upperRightLatitude, double upperRightLongitude, String locale) { + + SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getBaseContext()); + String mapquestApiKey = SP.getString("api_preference", "NA"); + String query = Uri.encode(locationName); String url; if (lowerLeftLatitude == 0 && lowerLeftLongitude == 0 && upperRightLatitude == 0 && upperRightLongitude == 0) { url = String.format(Locale.US, SEARCH_GEOCODE_URL, SERVICE_URL_MAPQUEST, - locale.split("_")[0], query, maxResults); + mapquestApiKey, locale.split("_")[0], query, maxResults); } else { url = String.format(Locale.US, SEARCH_GEOCODE_WITH_BOX_URL, SERVICE_URL_MAPQUEST, - locale.split("_")[0], query, maxResults, lowerLeftLongitude, + mapquestApiKey, locale.split("_")[0], query, maxResults, lowerLeftLongitude, upperRightLatitude, upperRightLongitude, lowerLeftLatitude); } try { From b55ea196d83e6a277f196cd20d2756bf73f701c9 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:14:03 +0200 Subject: [PATCH 07/13] 3 --- .../backend/nominatim/SettingsActivity.java | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/main/java/org/microg/nlp/backend/nominatim/SettingsActivity.java diff --git a/src/main/java/org/microg/nlp/backend/nominatim/SettingsActivity.java b/src/main/java/org/microg/nlp/backend/nominatim/SettingsActivity.java new file mode 100644 index 0000000..1957354 --- /dev/null +++ b/src/main/java/org/microg/nlp/backend/nominatim/SettingsActivity.java @@ -0,0 +1,58 @@ +package org.microg.nlp.backend.nominatim; + +import android.content.SharedPreferences; +import android.preference.ListPreference; +import android.preference.Preference; +import android.preference.PreferenceActivity; +import android.preference.PreferenceFragment; +import android.os.Bundle; + +public class SettingsActivity extends PreferenceActivity { + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Display the fragment as the main content. + getFragmentManager().beginTransaction() + .replace(android.R.id.content, new PrefsFragment()).commit(); + + } + + public static class PrefsFragment extends PreferenceFragment implements SharedPreferences.OnSharedPreferenceChangeListener { + + @Override + public void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + + // Load the preferences from an XML resource + addPreferencesFromResource(R.xml.preferences); + setSummaries(); + getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this); + } + + @Override + public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) { + updatePreference(findPreference(key), key); + } + + private void setSummaries(){ + + final SharedPreferences sh = getPreferenceManager().getSharedPreferences() ; + + Preference stylePref = findPreference("api_preference"); + stylePref.setSummary(sh.getString("api_preference", "")); + + } + private void updatePreference(Preference preference, String key) { + if (preference == null) return; + if (preference instanceof ListPreference) { + ListPreference listPreference = (ListPreference) preference; + listPreference.setSummary(listPreference.getEntry()); + return; + } + SharedPreferences sharedPrefs = getPreferenceManager().getSharedPreferences(); + preference.setSummary(sharedPrefs.getString(key, "Default")); + } + } + +} From 6560fc3cf8fbdd4a725758ff8728fdc3eab629d7 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:14:37 +0200 Subject: [PATCH 08/13] 5 --- src/main/res/values/strings.xml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/res/values/strings.xml b/src/main/res/values/strings.xml index ec5cbfd..db6198f 100644 --- a/src/main/res/values/strings.xml +++ b/src/main/res/values/strings.xml @@ -1,5 +1,10 @@ - NominatimGeocoderBackend + Nominatim Geocoder Backend Nominatim + + MapQuest Server Access + MapQuest Developer API Key + MapQuest Developer API Key + Enter your MapQuest developer API key. From 729494560f81795b248e2bb756a24bb0b5908b39 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:15:10 +0200 Subject: [PATCH 09/13] 6 --- src/main/res/xml/preferences.xml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/main/res/xml/preferences.xml diff --git a/src/main/res/xml/preferences.xml b/src/main/res/xml/preferences.xml new file mode 100644 index 0000000..379748c --- /dev/null +++ b/src/main/res/xml/preferences.xml @@ -0,0 +1,16 @@ + + + + + + + + + + From 512f0b5c2ff6edac5a69ba7883e1741612abf2c9 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:20:20 +0200 Subject: [PATCH 10/13] tweak CI commands --- circle.yml | 63 +++++++++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 5 deletions(-) diff --git a/circle.yml b/circle.yml index 69756fe..0d3ae10 100644 --- a/circle.yml +++ b/circle.yml @@ -1,19 +1,43 @@ machine: timezone: Europe/Vienna + java: + version: oraclejdk8 environment: +###### custom 1 ###### ZEMU_: "appemu23" EMU_: "appemu21" XEMU_: "appemu10" Zsdpath: "/sdcard" sdpath: "/storage/sdcard" Xsdpath: "/mnt/sdcard" +###### custom 1 ###### + +###### custom 2 ###### + XGRADLE_HOME: ~/g/gradle-2.10 + XPATH: ~/g/gradle-2.10/bin:$PATH + GRADLE_CUSTOM_VERSION: N +###### custom 2 ###### + +###### custom 3 ###### + CLASS_P: org.microg.nlp.backend.nominatim + START_INTENT_P: .BackendService + # switch glibc to a memory conserving mode + MALLOC_ARENA_MAX: "2" +###### custom 3 ###### + +############################### +# 0 -> no +# 1 -> C +# 2 -> Java + COVERITY_BUILD_: 0 + COV_PROJ: zoff99%2Fxyz +############################### + ANDROID_HOME: /usr/local/android-sdk-linux ANDROID_SDK: /usr/local/android-sdk-linux/ _SDK_: /usr/local/android-sdk-linux/ GRADLE_OPTS: '-Dorg.gradle.jvmargs="-Xmx1000m -XX:+HeapDumpOnOutOfMemoryError"' - CLASS_P: org.microg.nlp.backend.nominatim - START_INTENT_P: .BackendService dependencies: cache_directories: - ~/.android @@ -28,35 +52,64 @@ dependencies: - sudo apt-get install x11-utils > /dev/null 2> /dev/null - sudo apt-get install xvkbd > /dev/null 2> /dev/null - sudo apt-get install qrencode > /dev/null 2> /dev/null + - sudo apt-get install zip > /dev/null 2> /dev/null + - sudo apt-get install bc > /dev/null 2> /dev/null - gradle -v # display gradle version + - if [ "$GRADLE_CUSTOM_VERSION""x" == "1x" ]; then cd ~ ; wget https://services.gradle.org/distributions/gradle-2.10-bin.zip ; fi + - if [ "$GRADLE_CUSTOM_VERSION""x" == "1x" ]; then mkdir ~/g ; cd ~/g ; unzip ~/gradle-2.10-bin.zip ; fi + - gradle -v # display gradle version + - echo y | android update sdk --no-ui --all --filter "tools" - android list sdk --all | grep -i tools - android list sdk --all --extended - - echo y | android update sdk --no-ui --all --filter build-tools-23.0.3 > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter build-tools-22.0.0 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter build-tools-23.0.1 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter build-tools-23.0.2 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter build-tools-23.0.3 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter build-tools-24.0.0 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter android-21 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter android-22 > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter android-23 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter android-24 > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter platform-tools > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter extra-android-m2repository > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter extra-google-m2repository > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter extra-android-support > /dev/null 2> /dev/null - - echo y | android update sdk --no-ui --all --filter platform-tools-preview > /dev/null 2> /dev/null + # - echo y | android update sdk --no-ui --all --filter extra-google-google_play_services > /dev/null 2> /dev/null + # - echo y | android update sdk --no-ui --all --filter extra-google-google_play_services_froyo > /dev/null 2> /dev/null + # - echo y | android update sdk --no-ui --all --filter extra-google-gcm > /dev/null 2> /dev/null + + #- echo y | android update sdk --no-ui --all --filter platform-tools-preview > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-23 > /dev/null 2> /dev/null + - echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-android-24 > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter sys-img-armeabi-v7a-addon-google_apis-google-23 > /dev/null 2> /dev/null - echo y | android update sdk --no-ui --all --filter addon-google_apis-google-23 > /dev/null 2> /dev/null + - if [ "$COVERITY_BUILD_""x" != "0x" ]; then mkdir ~/cov_scan/ && wget https://scan.coverity.com/download/linux-64 --post-data "token=$COVERITY_TOKEN&project=$COV_PROJ" -O ~/cov_scan/coverity_tool.tgz && wget 'http://www.catb.org/~esr/coverity-submit/coverity-submit-1.17.tar.gz' -O ~/cov_scan/coverity-submit.tar.gz && cd ~/cov_scan/ && tar -xzvf coverity_tool.tgz ; fi + - pwd ; ls -al +###### custom ###### + - sed -i -e 's,textReport .*,textReport true,' app/build.gradle ; exit 0 +###### custom ###### + + - ./gradlew lint --info - ./gradlew assembleDebug --stacktrace --info --no-daemon + - ls -al build/outputs/apk/ ; exit 0 - find . -name '*.apk' ; exit 0 + - if [ "$COVERITY_BUILD_""x" != "0x" ]; then ls -al build/cov-int/ ; exit 0 ; fi + - if [ "$COVERITY_BUILD_""x" != "0x" ]; then cp -v build/cov-int/build-log.txt $CIRCLE_ARTIFACTS/ ; exit 0 ; fi + - if [ "$COVERITY_BUILD_""x" != "0x" ]; then cd build/ ; tar -czvf $CIRCLE_ARTIFACTS/covint.tar.gz cov-int ; exit 0 ; fi + # --- copy apk file to generic location --- - mkdir -p ./app/build/outputs/apk/ - - cp -av ./build/outputs/apk/NominatimGeocoderBackend-debug-unaligned.apk app/build/outputs/apk/app-debug-unaligned.apk + - if [ ! -e ./app/build/outputs/apk/app-debug-unaligned.apk ]; then cp -v `find ./build/outputs/apk/ -name '*.apk' 2> /dev/null | tail -1 2> /dev/null` ./app/build/outputs/apk/app-debug-unaligned.apk ; fi # --- copy apk file to generic location --- - zip -d app/build/outputs/apk/app-debug-unaligned.apk META-INF/\* # remove signature !! From a573acc3c469bd53d1dc97006ea25cf227b5a2d5 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:21:01 +0200 Subject: [PATCH 11/13] fix --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 0d3ae10..032db5e 100644 --- a/circle.yml +++ b/circle.yml @@ -94,7 +94,7 @@ dependencies: - pwd ; ls -al ###### custom ###### - - sed -i -e 's,textReport .*,textReport true,' app/build.gradle ; exit 0 + - sed -i -e 's,textReport .*,textReport true,' build.gradle ; exit 0 ###### custom ###### - ./gradlew lint --info From efbe3694bb9f06db56da343110a26aabcd6e725c Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:34:50 +0200 Subject: [PATCH 12/13] start settings --- circle.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/circle.yml b/circle.yml index 032db5e..6c6c37f 100644 --- a/circle.yml +++ b/circle.yml @@ -21,7 +21,7 @@ machine: ###### custom 3 ###### CLASS_P: org.microg.nlp.backend.nominatim - START_INTENT_P: .BackendService + START_INTENT_P: .SettingsActivity # switch glibc to a memory conserving mode MALLOC_ARENA_MAX: "2" ###### custom 3 ###### From ee24ee51be0a61bbfe876c7cb2f3192acb806809 Mon Sep 17 00:00:00 2001 From: Zoff Date: Thu, 4 Aug 2016 12:35:58 +0200 Subject: [PATCH 13/13] dont stop on lint errors --- build.gradle | 3 +++ 1 file changed, 3 insertions(+) diff --git a/build.gradle b/build.gradle index 39e4b4e..d366219 100644 --- a/build.gradle +++ b/build.gradle @@ -36,6 +36,9 @@ dependencies { android { compileSdkVersion 22 buildToolsVersion "22.0.0" + lintOptions { + abortOnError false + } } if (file('user.gradle').exists()) {