Skip to content

Commit c3f10c6

Browse files
authored
More working default values for XML files (#571)
- mtransitapps/commons-android#62
1 parent ec8c2c5 commit c3f10c6

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

shared-modules/MTREADME.md.MT.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ else
9090
echo "> No agency file! (rds:$GTFS_RDS_VALUES_GEN_FILE|json:$AGENCY_JSON_FILE|bike:$BIKE_STATION_VALUES_FILE)"
9191
exit 1 # error
9292
fi
93-
echo " - type: '$TYPE'"
9493
if [ -z "$TYPE" ]; then
9594
echo " > No type found for agency!"
9695
exit 1 # error

shared/app-android/build.gradle

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,21 @@ def setupResValues(buildType, appId) {
439439

440440
buildType.resValue("string", "bike_station_authority", "${appId}.bike")
441441
buildType.resValue("string", "gtfs_rts_authority", "${appId}.gtfs") // do not change to avoid breaking compat w/ old modules
442+
443+
def poiAgencyTypePrefix
444+
if (file("src/main/res/values/gtfs_rts_values.xml").exists()) { // do not change to avoid breaking compat w/ old modules
445+
poiAgencyTypePrefix = "gtfs_rts" // do not change to avoid breaking compat w/ old modules
446+
} else if (file("src/main/res/values/bike_station_values.xml").exists()) {
447+
poiAgencyTypePrefix = "bike_station"
448+
}
449+
if (poiAgencyTypePrefix) {
450+
buildType.resValue("string", "poi_agency_authority", "@string/${poiAgencyTypePrefix}_authority")
451+
buildType.resValue("string", "poi_agency_color", "@string/${poiAgencyTypePrefix}_color")
452+
buildType.resValue("string", "poi_agency_short_name", "@string/${poiAgencyTypePrefix}_short_name")
453+
} else {
454+
println "> Unexpected POI agency type!"
455+
}
456+
442457
buildType.resValue("string", "gtfs_real_time_authority", "${appId}.gtfs.realtime")
443458

444459
buildType.resValue("string", "rss_authority", "${appId}.news.rss")

0 commit comments

Comments
 (0)