1+ /*
2+ * Copyright 2021 Google LLC
3+ *
4+ * Licensed under the Apache License, Version 2.0 (the "License");
5+ * you may not use this file except in compliance with the License.
6+ * You may obtain a copy of the License at
7+ *
8+ * https://www.apache.org/licenses/LICENSE-2.0
9+ *
10+ * Unless required by applicable law or agreed to in writing, software
11+ * distributed under the License is distributed on an "AS IS" BASIS,
12+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+ * See the License for the specific language governing permissions and
14+ * limitations under the License.
15+ */
16+
17+ import kotlin.reflect.full.memberFunctions
18+
119/*
220 * Copyright 2020 Google LLC
321 *
1735plugins {
1836 id(" com.android.application" )
1937 kotlin(" android" )
20- kotlin(" android.extensions" )
2138 kotlin(" kapt" )
2239 id(" androidx.navigation.safeargs.kotlin" )
2340 id(" com.google.firebase.crashlytics" )
@@ -37,23 +54,23 @@ android {
3754 buildConfigField(
3855 " com.google.android.gms.maps.model.LatLng" ,
3956 " MAP_VIEWPORT_BOUND_NE" ,
40- " new com.google.android.gms.maps.model.LatLng(${properties[" map_viewport_bound_ne" ]} )"
57+ " new com.google.android.gms.maps.model.LatLng(${project. properties[" map_viewport_bound_ne" ]} )"
4158 )
4259 buildConfigField(
4360 " com.google.android.gms.maps.model.LatLng" ,
4461 " MAP_VIEWPORT_BOUND_SW" ,
45- " new com.google.android.gms.maps.model.LatLng(${properties[" map_viewport_bound_sw" ]} )"
62+ " new com.google.android.gms.maps.model.LatLng(${project. properties[" map_viewport_bound_sw" ]} )"
4663 )
4764
48- buildConfigField(" float" , " MAP_CAMERA_FOCUS_ZOOM" , properties[" map_camera_focus_zoom" ] as String )
65+ buildConfigField(" float" , " MAP_CAMERA_FOCUS_ZOOM" , project. properties[" map_camera_focus_zoom" ] as String )
4966
50- resValue(" dimen" , " map_camera_bearing" , properties[" map_default_camera_bearing" ] as String )
51- resValue(" dimen" , " map_camera_target_lat" , properties[" map_default_camera_target_lat" ] as String )
52- resValue(" dimen" , " map_camera_target_lng" , properties[" map_default_camera_target_lng" ] as String )
53- resValue(" dimen" , " map_camera_tilt" , properties[" map_default_camera_tilt" ] as String )
54- resValue(" dimen" , " map_camera_zoom" , properties[" map_default_camera_zoom" ] as String )
55- resValue(" dimen" , " map_viewport_min_zoom" , properties[" map_viewport_min_zoom" ] as String )
56- resValue(" dimen" , " map_viewport_max_zoom" , properties[" map_viewport_max_zoom" ] as String )
67+ resValue(" dimen" , " map_camera_bearing" , project. properties[" map_default_camera_bearing" ] as String )
68+ resValue(" dimen" , " map_camera_target_lat" , project. properties[" map_default_camera_target_lat" ] as String )
69+ resValue(" dimen" , " map_camera_target_lng" , project. properties[" map_default_camera_target_lng" ] as String )
70+ resValue(" dimen" , " map_camera_tilt" , project. properties[" map_default_camera_tilt" ] as String )
71+ resValue(" dimen" , " map_camera_zoom" , project. properties[" map_default_camera_zoom" ] as String )
72+ resValue(" dimen" , " map_viewport_min_zoom" , project. properties[" map_viewport_min_zoom" ] as String )
73+ resValue(" dimen" , " map_viewport_max_zoom" , project. properties[" map_viewport_max_zoom" ] as String )
5774
5875 manifestPlaceholders[" crashlyticsEnabled" ] = true
5976
@@ -93,14 +110,16 @@ android {
93110 }
94111 maybeCreate(" staging" )
95112 getByName(" staging" ) {
96- initWith(getByName(" debug" ))
113+ // TODO: replace with initWith(getByName("debug")) in 7.0.0-beta04
114+ // https://issuetracker.google.com/issues/186798050
115+ this ::class .memberFunctions.first { it.name == " initWith" }.call(this , getByName(" debug" ))
97116 versionNameSuffix = " -staging"
98117
99118 // Specifies a sorted list of fallback build types that the
100119 // plugin should try to use when a dependency does not include a
101120 // "staging" build type.
102121 // Used with :test-shared, which doesn't have a staging variant.
103- setMatchingFallbacks( listOf (" debug" ) )
122+ matchingFallbacks + = listOf (" debug" )
104123 }
105124 }
106125
@@ -134,7 +153,7 @@ android {
134153 }
135154 }
136155
137- lintOptions {
156+ lint {
138157 // Eliminates UnusedResources false positives for resources used in DataBinding layouts
139158 isCheckGeneratedSources = true
140159 // Running lint over the debug variant is enough
@@ -162,8 +181,8 @@ android {
162181 }
163182
164183 packagingOptions {
165- exclude( " META-INF/AL2.0" )
166- exclude( " META-INF/LGPL2.1" )
184+ resources.excludes + = " META-INF/AL2.0"
185+ resources.excludes + = " META-INF/LGPL2.1"
167186 }
168187}
169188
0 commit comments