File tree Expand file tree Collapse file tree
java/com/mapzen/erasermap
kotlin/com/mapzen/erasermap/model Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,9 @@ apply plugin: 'kotlin-android'
1313apply plugin : ' com.neenbedankt.android-apt'
1414apply plugin : ' checkstyle'
1515
16+ def SEARCH_BASE_URL = hasProperty(' searchBaseUrl' ) ? ' "' + searchBaseUrl + ' "' : " null" ;
17+ def ROUTE_BASE_URL = hasProperty(' routeBaseUrl' ) ? ' "' + routeBaseUrl + ' "' : " null" ;
18+
1619def VECTOR_TILE_API_KEY = hasProperty(' vectorTileApiKey' ) ? ' "' + vectorTileApiKey + ' "' : " null" ;
1720def PELIAS_API_KEY = hasProperty(' peliasApiKey' ) ? ' "' + peliasApiKey + ' "' : " null" ;
1821def VALHALLA_API_KEY = hasProperty(' valhallaApiKey' ) ? ' "' + valhallaApiKey + ' "' : " null" ;
@@ -34,6 +37,8 @@ android {
3437 targetSdkVersion 22
3538 versionCode buildVersionCode()
3639 versionName version
40+ buildConfigField " String" , " SEARCH_BASE_URL" , SEARCH_BASE_URL
41+ buildConfigField " String" , " ROUTE_BASE_URL" , ROUTE_BASE_URL
3742 buildConfigField " String" , " VECTOR_TILE_API_KEY" , VECTOR_TILE_API_KEY
3843 buildConfigField " String" , " PELIAS_API_KEY" , PELIAS_API_KEY
3944 buildConfigField " String" , " VALHALLA_API_KEY" , VALHALLA_API_KEY
Original file line number Diff line number Diff line change @@ -79,9 +79,11 @@ public AndroidModule(EraserMapApplication application) {
7979 }
8080
8181 @ Provides @ Singleton Pelias providePelias () {
82+ final String endpoint = BuildConfig .SEARCH_BASE_URL != null ?
83+ BuildConfig .SEARCH_BASE_URL : Pelias .DEFAULT_SERVICE_ENDPOINT ;
8284 final RestAdapter .LogLevel logLevel = BuildConfig .DEBUG ?
8385 RestAdapter .LogLevel .FULL : RestAdapter .LogLevel .NONE ;
84- return Pelias .getPelias ( logLevel );
86+ return Pelias .getPeliasWithEndpoint ( endpoint , logLevel );
8587 }
8688
8789 @ Provides @ Singleton Speakerbox provideSpeakerbox () {
Original file line number Diff line number Diff line change 11package com.mapzen.erasermap.model
22
33import android.location.Location
4- import com.mapzen.pelias .BuildConfig
4+ import com.mapzen.erasermap .BuildConfig
55import com.mapzen.pelias.SimpleFeature
66import com.mapzen.pelias.gson.Feature
77import com.mapzen.valhalla.Route
88import com.mapzen.valhalla.RouteCallback
99import com.mapzen.valhalla.Router
10+ import com.mapzen.valhalla.ValhallaRouter
1011import retrofit.RestAdapter
1112
1213public class ValhallaRouteManager (val settings : AppSettings ,
@@ -79,9 +80,14 @@ public class ValhallaRouteManager(val settings: AppSettings,
7980 }
8081
8182 private fun getInitializedRouter (type : Router .Type ): Router {
83+ val endpoint = BuildConfig .ROUTE_BASE_URL ? : ValhallaRouter .DEFAULT_URL
8284 val logLevel = if (BuildConfig .DEBUG ) RestAdapter .LogLevel .FULL else
8385 RestAdapter .LogLevel .NONE
84- val router = routerFactory.getRouter().setApiKey(apiKey).setLogLevel(logLevel)
86+ val router = routerFactory.getRouter()
87+ .setApiKey(apiKey)
88+ .setEndpoint(endpoint)
89+ .setLogLevel(logLevel)
90+ .setDntEnabled(true )
8591 when (type) {
8692 Router .Type .DRIVING -> return router.setDriving()
8793 Router .Type .WALKING -> return router.setWalking()
Original file line number Diff line number Diff line change 22#
33# Builds master branch and uploads APK to s3://android.mapzen.com/erasermap-snapshots/.
44
5- ./gradlew assembleDevDebug -PmintApiKey=$MINT_API_KEY -PvectorTileApiKey=$VECTOR_TILE_API_KEY -PpeliasApiKey=$PELIAS_API_KEY -PvalhallaApiKey=$VALHALLA_API_KEY -PbuildNumber=$CIRCLE_BRANCH -$CIRCLE_BUILD_NUM
5+ ./gradlew assembleDevDebug -PmintApiKey=$MINT_API_KEY -PvectorTileApiKey=$VECTOR_TILE_API_KEY -PpeliasApiKey=$PELIAS_API_KEY -PvalhallaApiKey=$VALHALLA_API_KEY -PbuildNumber=$CIRCLE_BRANCH -$CIRCLE_BUILD_NUM -PsearchBaseUrl= " $SEARCH_BASE_URL " -ProuteBaseUrl= " $ROUTE_BASE_URL "
66s3cmd put app/build/outputs/apk/app-dev-debug.apk s3://android.mapzen.com/erasermap-latest.apk
77s3cmd put app/build/outputs/apk/app-dev-debug.apk s3://android.mapzen.com/erasermap-snapshots/master-$CIRCLE_BUILD_NUM .apk
Original file line number Diff line number Diff line change 44
55if [ -z ${PERFORM_RELEASE} ]
66 then
7- ./gradlew assembleDevDebug -PmintApiKey=$MINT_API_KEY -PvectorTileApiKey=$VECTOR_TILE_API_KEY -PpeliasApiKey=$PELIAS_API_KEY -PvalhallaApiKey=$VALHALLA_API_KEY -PbuildNumber=$CIRCLE_BRANCH -$CIRCLE_BUILD_NUM
7+ ./gradlew assembleDevDebug -PmintApiKey=$MINT_API_KEY -PvectorTileApiKey=$VECTOR_TILE_API_KEY -PpeliasApiKey=$PELIAS_API_KEY -PvalhallaApiKey=$VALHALLA_API_KEY -PbuildNumber=$CIRCLE_BRANCH -$CIRCLE_BUILD_NUM -PsearchBaseUrl= " $SEARCH_BASE_URL " -ProuteBaseUrl= " $ROUTE_BASE_URL "
88 s3cmd put app/build/outputs/apk/app-dev-debug.apk s3://android.mapzen.com/erasermap-development/$CIRCLE_BRANCH -$CIRCLE_BUILD_NUM .apk
99 else
1010 scripts/install-leyndo.sh
1111 cd app && git clone $CONFIG_REPO
1212 cd ..
13- ./gradlew clean assembleProdRelease --refresh-dependencies -PmintApiKey=$MINT_API_KEY -PvectorTileApiKey=$VECTOR_TILE_API_KEY_PROD -PpeliasApiKey=$PELIAS_API_KEY_PROD -PvalhallaApiKey=$VALHALLA_API_KEY_PROD -PbuildNumber=$RELEASE_TAG -PreleaseStoreFile=$RELEASE_STORE_FILE -PreleaseStorePassword=" $RELEASE_STORE_PASSWORD " -PreleaseKeyAlias=$RELEASE_KEY_ALIAS -PreleaseKeyPassword=" $RELEASE_KEY_PASSWORD "
13+ ./gradlew clean assembleProdRelease --refresh-dependencies -PmintApiKey=$MINT_API_KEY -PvectorTileApiKey=$VECTOR_TILE_API_KEY_PROD -PpeliasApiKey=$PELIAS_API_KEY_PROD -PvalhallaApiKey=$VALHALLA_API_KEY_PROD -PbuildNumber=$RELEASE_TAG -PreleaseStoreFile=$RELEASE_STORE_FILE -PreleaseStorePassword=" $RELEASE_STORE_PASSWORD " -PreleaseKeyAlias=$RELEASE_KEY_ALIAS -PreleaseKeyPassword=" $RELEASE_KEY_PASSWORD " -PsearchBaseUrl= " $SEARCH_BASE_URL " -ProuteBaseUrl= " $ROUTE_BASE_URL "
1414 s3cmd put app/build/outputs/apk/app-prod-release.apk s3://android.mapzen.com/erasermap-releases/$RELEASE_TAG .apk
1515fi
You can’t perform that action at this time.
0 commit comments