Gradle Improvements (#2311)
This commit is contained in:
4
.github/workflows/android-device-test.yml
vendored
4
.github/workflows/android-device-test.yml
vendored
@@ -100,7 +100,7 @@ jobs:
|
||||
expect-files: "${{ matrix.test.testFile }}, ${{ matrix.test.appFile }}"
|
||||
|
||||
- name: Configure AWS Credentials
|
||||
if: env.run_device_test == 'true' && matrix.test.name == 'Android Benchmark'
|
||||
if: env.run_device_test == 'true'
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
testSpecArn: ${{ matrix.test.testSpecArn }}
|
||||
|
||||
- name: Upload benchmark results to S3
|
||||
if: env.run_device_test == 'true' && matrix.test.name == 'Android Benchmark'
|
||||
if: always() && env.run_device_test == 'true' && matrix.test.name == 'Android Benchmark'
|
||||
run: |
|
||||
npm install --ignore-scripts
|
||||
node scripts/aws-device-farm/download-benchmark-results.mjs ${{ steps.aws_device_farm_run.outputs.runArn }}
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
apply plugin: 'com.android.application'
|
||||
plugins {
|
||||
id 'com.android.application'
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidVersions.compileSdkVersion
|
||||
ndkVersion androidSdkVersions.ndkVersion
|
||||
buildToolsVersion androidSdkVersions.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
applicationId = 'com.mapbox.mapboxsdk.maps.benchmark_runner'
|
||||
compileSdk 34
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
def abi = 'all'
|
||||
|
||||
@@ -45,12 +45,10 @@ tasks.withType(DokkaTask.class) {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidVersions.compileSdkVersion
|
||||
buildToolsVersion androidSdkVersions.buildToolsVersion
|
||||
|
||||
defaultConfig {
|
||||
minSdkVersion androidVersions.minSdkVersion
|
||||
targetSdkVersion androidVersions.targetSdkVersion
|
||||
compileSdk 34
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
buildConfigField "String", "GIT_REVISION_SHORT", String.format("\"%s\"", getGitRevision())
|
||||
buildConfigField "String", "GIT_REVISION", String.format("\"%s\"", getGitRevision(false))
|
||||
buildConfigField "String", "MAPBOX_SDK_IDENTIFIER", String.format("\"%s\"", "mapbox-maps-android")
|
||||
|
||||
@@ -59,7 +59,7 @@ class MarkerTest {
|
||||
|
||||
@Test
|
||||
fun testIcon() {
|
||||
val bitmap = Bitmap.createBitmap(1, 1, Bitmap.Config.ARGB_4444)
|
||||
val bitmap = Mockito.mock(Bitmap::class.java)
|
||||
val icon = IconFactory.recreate("test", bitmap)
|
||||
val markerOptions = MarkerOptions().position(LatLng()).icon(icon)
|
||||
val marker = markerOptions.marker
|
||||
|
||||
@@ -18,23 +18,14 @@ dependencies {
|
||||
testImplementation libs.lintTests
|
||||
}
|
||||
|
||||
sourceCompatibility = "1.8"
|
||||
targetCompatibility = "1.8"
|
||||
|
||||
compileKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
|
||||
compileTestKotlin {
|
||||
kotlinOptions {
|
||||
jvmTarget = "1.8"
|
||||
}
|
||||
}
|
||||
|
||||
jar {
|
||||
manifest {
|
||||
attributes("Lint-Registry-v2": "com.mapbox.mapboxsdk.lint.MapboxIssueRegistry")
|
||||
jvmTarget = "17"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,12 +18,11 @@ def obtainTestBuildType() {
|
||||
}
|
||||
|
||||
android {
|
||||
compileSdkVersion androidVersions.compileSdkVersion
|
||||
|
||||
defaultConfig {
|
||||
applicationId "org.maplibre.android.testapp"
|
||||
minSdkVersion androidVersions.minSdkVersion
|
||||
targetSdkVersion androidVersions.targetSdkVersion
|
||||
compileSdk 34
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
versionCode 14
|
||||
versionName "6.0.1"
|
||||
testInstrumentationRunner "org.maplibre.android.InstrumentationRunner"
|
||||
|
||||
@@ -146,7 +146,10 @@ class BenchmarkActivity : AppCompatActivity() {
|
||||
|
||||
private fun getBenchmarkInputData(): BenchmarkInputData {
|
||||
// read input for benchmark from JSON file (on CI)
|
||||
val jsonFile = File("${Environment.getExternalStorageDirectory()}/instrumentation-test-input")
|
||||
val jsonFile = File("${Environment.getExternalStorageDirectory()}/instrumentation-test-input.json")
|
||||
Logger.i(TAG, "Environment.getExternalStorageDirectory() = ${Environment.getExternalStorageDirectory()}")
|
||||
Logger.i(TAG, "jsonFile.isFile = ${jsonFile.isFile}")
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && Environment.isExternalStorageManager() && jsonFile.isFile) {
|
||||
val jsonFileContents = jsonFile.readText()
|
||||
val jsonElement = Json.parseToJsonElement(jsonFileContents)
|
||||
|
||||
@@ -70,10 +70,10 @@ class OverlayMapActivity : AppCompatActivity() {
|
||||
private lateinit var paint: Paint
|
||||
|
||||
@SuppressLint("DrawAllocation") // only happens once
|
||||
override fun onDraw(canvas: Canvas?) {
|
||||
override fun onDraw(canvas: Canvas) {
|
||||
super.onDraw(canvas)
|
||||
|
||||
canvas?.let {
|
||||
canvas.let {
|
||||
if (!::paint.isInitialized) {
|
||||
paint = Paint()
|
||||
paint.color = Color.BLACK
|
||||
|
||||
@@ -2,9 +2,9 @@ buildscript {
|
||||
apply from: "${rootDir}/gradle/dependencies.gradle"
|
||||
|
||||
repositories {
|
||||
google()
|
||||
maven { url "https://plugins.gradle.org/m2/" }
|
||||
mavenCentral()
|
||||
google()
|
||||
}
|
||||
dependencies {
|
||||
classpath libs.androidGradlePlugin
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
ext {
|
||||
androidVersions = [
|
||||
minSdkVersion : 21,
|
||||
targetSdkVersion : 33,
|
||||
compileSdkVersion: 33,
|
||||
]
|
||||
|
||||
androidSdkVersions = [
|
||||
buildToolsVersion: '33.0.1',
|
||||
ndkVersion : '25.1.8937393',
|
||||
cmakeVersion : '3.18.1+',
|
||||
]
|
||||
|
||||
@@ -1,31 +1,31 @@
|
||||
[versions]
|
||||
mapLibreServices = "6.0.0"
|
||||
mapboxGestures = "0.7.0"
|
||||
appCompat = "1.5.1"
|
||||
appCompat = "1.6.1"
|
||||
constraintLayout = "2.1.4"
|
||||
interpolator = "1.0.0"
|
||||
recyclerView = "1.2.1"
|
||||
material = "1.7.0"
|
||||
uiAutomator = "2.2.0"
|
||||
recyclerView = "1.3.2"
|
||||
material = "1.11.0"
|
||||
uiAutomator = "2.3.0"
|
||||
espresso = "3.5.1"
|
||||
testRunner = "1.1.4"
|
||||
testRunner = "1.1.5"
|
||||
testRules = "1.5.0"
|
||||
fragment = "1.5.5"
|
||||
annotation = "1.5.0"
|
||||
fragment = "1.6.2"
|
||||
annotation = "1.7.1"
|
||||
leakCanary = "2.10"
|
||||
junit = "4.13.2"
|
||||
mockito = "4.10.0"
|
||||
mockito = "5.11.0"
|
||||
mockk = "1.13.3"
|
||||
robolectric = "4.9.1"
|
||||
timber = "5.0.1"
|
||||
okhttp = "4.11.0"
|
||||
kotlin = "1.9.21"
|
||||
licenses = "0.8.80"
|
||||
lint = "30.3.1"
|
||||
lint = "31.3.2"
|
||||
appcenter = "1.5"
|
||||
commonsIO = "2.11.0"
|
||||
commonsIO = "2.13.0"
|
||||
assertj = "3.25.3"
|
||||
gradleNexus = "1.1.0"
|
||||
gradleNexus = "1.3.0"
|
||||
multidex = "2.0.1"
|
||||
|
||||
androidxTestExtJUnit = "1.1.5"
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
ext.nativeBuild = { nativeTargets ->
|
||||
android {
|
||||
ndkVersion androidSdkVersions.ndkVersion
|
||||
buildToolsVersion androidSdkVersions.buildToolsVersion
|
||||
|
||||
// We sometimes want to invoke Gradle without building a native dependency, e.g. when we just want
|
||||
// to invoke the Java tests. When we explicitly specify an ABI of 'none', no native dependencies are
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 33
|
||||
|
||||
sourceSets {
|
||||
test {
|
||||
assets.srcDirs += ['../../../metrics']
|
||||
@@ -11,6 +9,7 @@ android {
|
||||
|
||||
defaultConfig {
|
||||
applicationId = 'org.maplibre.render_test_runner'
|
||||
compileSdk 34
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 33
|
||||
def abi = 'all'
|
||||
|
||||
Reference in New Issue
Block a user