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
+
1
19
/*
2
20
* Copyright 2020 Google LLC
3
21
*
17
35
plugins {
18
36
id(" com.android.application" )
19
37
kotlin(" android" )
20
- kotlin(" android.extensions" )
21
38
kotlin(" kapt" )
22
39
id(" androidx.navigation.safeargs.kotlin" )
23
40
id(" com.google.firebase.crashlytics" )
@@ -37,23 +54,23 @@ android {
37
54
buildConfigField(
38
55
" com.google.android.gms.maps.model.LatLng" ,
39
56
" 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" ]} )"
41
58
)
42
59
buildConfigField(
43
60
" com.google.android.gms.maps.model.LatLng" ,
44
61
" 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" ]} )"
46
63
)
47
64
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 )
49
66
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 )
57
74
58
75
manifestPlaceholders[" crashlyticsEnabled" ] = true
59
76
@@ -93,14 +110,16 @@ android {
93
110
}
94
111
maybeCreate(" staging" )
95
112
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" ))
97
116
versionNameSuffix = " -staging"
98
117
99
118
// Specifies a sorted list of fallback build types that the
100
119
// plugin should try to use when a dependency does not include a
101
120
// "staging" build type.
102
121
// Used with :test-shared, which doesn't have a staging variant.
103
- setMatchingFallbacks( listOf (" debug" ) )
122
+ matchingFallbacks + = listOf (" debug" )
104
123
}
105
124
}
106
125
@@ -134,7 +153,7 @@ android {
134
153
}
135
154
}
136
155
137
- lintOptions {
156
+ lint {
138
157
// Eliminates UnusedResources false positives for resources used in DataBinding layouts
139
158
isCheckGeneratedSources = true
140
159
// Running lint over the debug variant is enough
@@ -162,8 +181,8 @@ android {
162
181
}
163
182
164
183
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"
167
186
}
168
187
}
169
188
0 commit comments