Android build config maintenance (#2465)

This commit is contained in:
Bart Louwers
2024-06-04 17:26:14 +02:00
committed by GitHub
parent 4280dfb5ca
commit e546889063
14 changed files with 17 additions and 21 deletions

View File

@@ -2,7 +2,7 @@
buildscript { buildscript {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.3' classpath 'com.android.tools.build:gradle:3.5.3'
@@ -12,7 +12,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
} }

View File

@@ -131,6 +131,9 @@ android {
kotlinOptions { kotlinOptions {
jvmTarget = "1.8" jvmTarget = "1.8"
} }
buildFeatures {
buildConfig true
}
} }
licenseReport { licenseReport {

View File

@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(MapLibreAndroid)
add_subdirectory(../../../../../ add_subdirectory(../../../../../
../../../../../${ANDROID_ABI}) ../../../../../${ANDROID_ABI})

View File

@@ -78,6 +78,7 @@ android {
buildFeatures { buildFeatures {
viewBinding = true viewBinding = true
buildConfig true
} }
namespace 'org.maplibre.android.testapp' namespace 'org.maplibre.android.testapp'

View File

@@ -26,7 +26,7 @@ class QueryRenderedFeaturesBoxSymbolCountActivity : AppCompatActivity() {
lateinit var mapView: MapView lateinit var mapView: MapView
lateinit var maplibreMap: MapLibreMap lateinit var maplibreMap: MapLibreMap
private set private set
private lateinit var toast: Toast
override fun onCreate(savedInstanceState: Bundle?) { override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState) super.onCreate(savedInstanceState)
setContentView(R.layout.activity_query_features_box) setContentView(R.layout.activity_query_features_box)
@@ -80,15 +80,11 @@ class QueryRenderedFeaturesBoxSymbolCountActivity : AppCompatActivity() {
val features = maplibreMap.queryRenderedFeatures(box, "symbols-layer") val features = maplibreMap.queryRenderedFeatures(box, "symbols-layer")
// Show count // Show count
if (toast != null) { Toast.makeText(
toast!!.cancel()
}
toast = Toast.makeText(
this@QueryRenderedFeaturesBoxSymbolCountActivity, this@QueryRenderedFeaturesBoxSymbolCountActivity,
String.format("%s features in box", features.size), "${features.size} feature${if (features.size == 1) "" else "s"} in box",
Toast.LENGTH_SHORT Toast.LENGTH_SHORT
) ).show()
toast.show()
} }
} }
} }

View File

@@ -9,7 +9,6 @@
android:id="@id/mapView" android:id="@id/mapView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/toolbar"
app:maplibre_cameraZoom="1"/> app:maplibre_cameraZoom="1"/>
</RelativeLayout> </RelativeLayout>

View File

@@ -9,7 +9,6 @@
android:id="@id/mapView" android:id="@id/mapView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
app:maplibre_cameraBearing="220" app:maplibre_cameraBearing="220"
app:maplibre_cameraTargetLat="50.871062" app:maplibre_cameraTargetLat="50.871062"
app:maplibre_cameraTargetLng="1.583210" app:maplibre_cameraTargetLng="1.583210"

View File

@@ -9,7 +9,6 @@
android:id="@id/mapView" android:id="@id/mapView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/toolbar"
app:maplibre_cameraTargetLat="38.87031" app:maplibre_cameraTargetLat="38.87031"
app:maplibre_cameraTargetLng="-77.00897" app:maplibre_cameraTargetLng="-77.00897"
app:maplibre_cameraZoom="10"/> app:maplibre_cameraZoom="10"/>

View File

@@ -9,7 +9,6 @@
android:id="@id/mapView" android:id="@id/mapView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/toolbar"
app:maplibre_cameraTargetLat="45.1855569" app:maplibre_cameraTargetLat="45.1855569"
app:maplibre_cameraTargetLng="5.7215506" app:maplibre_cameraTargetLng="5.7215506"
app:maplibre_cameraZoom="11" app:maplibre_cameraZoom="11"

View File

@@ -9,7 +9,6 @@
android:id="@+id/mapView" android:id="@+id/mapView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/toolbar"
app:maplibre_cameraTargetLat="52.0907" app:maplibre_cameraTargetLat="52.0907"
app:maplibre_cameraTargetLng="5.1214" app:maplibre_cameraTargetLng="5.1214"
app:maplibre_cameraZoom="16"/> app:maplibre_cameraZoom="16"/>

View File

@@ -2,6 +2,5 @@ android.useAndroidX=true
systemProp.org.gradle.internal.http.connectionTimeout=360000 systemProp.org.gradle.internal.http.connectionTimeout=360000
systemProp.org.gradle.internal.http.socketTimeout=360000 systemProp.org.gradle.internal.http.socketTimeout=360000
org.gradle.jvmargs=-Xmx4096M org.gradle.jvmargs=-Xmx4096M
android.defaults.buildfeatures.buildconfig=true
android.nonTransitiveRClass=false android.nonTransitiveRClass=false
android.nonFinalResIds=false android.nonFinalResIds=false

View File

@@ -77,7 +77,7 @@ afterEvaluate {
afterEvaluate { project -> afterEvaluate { project ->
android.libraryVariants.all { variant -> android.libraryVariants.all { variant ->
tasks.androidJavadocs.doFirst { tasks.androidJavadocs.doFirst {
classpath += files(variant.javaCompile.classpath.files) classpath += files(variant.javaCompileProvider.get().classpath.files)
} }
} }
} }

View File

@@ -1,7 +1,7 @@
buildscript { buildscript {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.4.1' classpath 'com.android.tools.build:gradle:8.4.1'
@@ -11,6 +11,6 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
} }

View File

@@ -2,7 +2,7 @@
buildscript { buildscript {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:8.1.1' classpath 'com.android.tools.build:gradle:8.1.1'
@@ -12,7 +12,7 @@ buildscript {
allprojects { allprojects {
repositories { repositories {
google() google()
jcenter() mavenCentral()
} }
} }