Skip to content

Commit

Permalink
Merge pull request #2488 from leancodepl/bump-compile-sdk-and-gradle
Browse files Browse the repository at this point in the history
Bump compile sdk and gradle in patrol to make it work with Android 15
  • Loading branch information
pdenert authored Jan 16, 2025
2 parents 1490c47 + 4f19607 commit 501be2f
Show file tree
Hide file tree
Showing 21 changed files with 116 additions and 75 deletions.
13 changes: 10 additions & 3 deletions dev/e2e_app/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id "com.android.application"
id "org.jetbrains.kotlin.android"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

Expand All @@ -23,8 +23,14 @@ if (flutterVersionName == null) {
}

android {
compileSdk 34
compileSdk 35
namespace "pl.leancode.patrol.e2e_app"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
}

kotlinOptions {
jvmTarget = "1.8"
Expand All @@ -37,7 +43,7 @@ android {
defaultConfig {
applicationId "pl.leancode.patrol.e2e_app"
minSdk 24
targetSdk 33
targetSdk 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner"
Expand All @@ -60,6 +66,7 @@ flutter {
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.20"
androidTestUtil "androidx.test:orchestrator:1.4.2"
}
2 changes: 2 additions & 0 deletions dev/e2e_app/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-feature android:name="android.hardware.camera" android:required="false"/>

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
Expand Down
13 changes: 11 additions & 2 deletions dev/e2e_app/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
rootProject.buildDir = "../build"
allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(":app")
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
9 changes: 4 additions & 5 deletions dev/e2e_app/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ pluginManagement {
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}
settings.ext.flutterSdkPath = flutterSdkPath()
}()

includeBuild("${settings.ext.flutterSdkPath}/packages/flutter_tools/gradle")
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

repositories {
google()
Expand All @@ -18,8 +17,8 @@ pluginManagement {
}

plugins {
id "dev.flutter.flutter-plugin-loader"
id "com.android.application" version "7.4.2" apply false
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
id "com.android.application" version "8.6.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
}

Expand Down
32 changes: 17 additions & 15 deletions dev/e2e_app/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,10 @@ packages:
dependency: "direct main"
description:
name: geolocator
sha256: f4efb8d3c4cdcad2e226af9661eb1a0dd38c71a9494b22526f9da80ab79520e5
sha256: d2ec66329cab29cb297d51d96c067d457ca519dca8589665fa0b82ebacb7dbe4
url: "https://pub.dev"
source: hosted
version: "10.1.1"
version: "13.0.2"
geolocator_android:
dependency: transitive
description:
Expand All @@ -321,10 +321,10 @@ packages:
dependency: transitive
description:
name: geolocator_apple
sha256: bc2aca02423ad429cb0556121f56e60360a2b7d694c8570301d06ea0c00732fd
sha256: "6154ea2682563f69fc0125762ed7e91e7ed85d0b9776595653be33918e064807"
url: "https://pub.dev"
source: hosted
version: "2.3.7"
version: "2.3.8+1"
geolocator_platform_interface:
dependency: transitive
description:
Expand All @@ -337,10 +337,10 @@ packages:
dependency: transitive
description:
name: geolocator_web
sha256: "102e7da05b48ca6bf0a5bda0010f886b171d1a08059f01bfe02addd0175ebece"
sha256: "2ed69328e05cd94e7eb48bb0535f5fc0c0c44d1c4fa1e9737267484d05c29b5e"
url: "https://pub.dev"
source: hosted
version: "2.2.1"
version: "4.1.1"
geolocator_windows:
dependency: transitive
description:
Expand Down Expand Up @@ -499,21 +499,23 @@ packages:
path: "../../packages/patrol"
relative: true
source: path
version: "3.11.2"
version: "3.13.2"
patrol_finders:
dependency: transitive
description:
path: "../../packages/patrol_finders"
relative: true
source: path
version: "2.1.2"
name: patrol_finders
sha256: "5a1e2b4c6636e89645fc596d68224cfe6cca28e11c855b98dd0df9bed0d80405"
url: "https://pub.dev"
source: hosted
version: "2.6.0"
patrol_log:
dependency: transitive
description:
path: "../../packages/patrol_log"
relative: true
source: path
version: "0.0.1"
name: patrol_log
sha256: ad5d7b759d16071ca16aa9b27eb4f106ce23079792d4312941874dbc33e795cb
url: "https://pub.dev"
source: hosted
version: "0.2.2"
permission_handler:
dependency: "direct main"
description:
Expand Down
2 changes: 1 addition & 1 deletion dev/e2e_app/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ dependencies:
sdk: flutter
flutter_local_notifications: ^17.2.3
flutter_timezone: ^1.0.8
geolocator: ^10.1.0
geolocator: ^13.0.0
permission_handler: ^10.4.5
timezone: ^0.9.2
webview_flutter: ^4.4.2
Expand Down
7 changes: 5 additions & 2 deletions packages/patrol/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
## Unreleased

- Remove `exception` from `StepEntry`. When it was too long, it caused crash because of badly formed JSON
- Bump `patrol_finders` and `patrol_log` versions
- Remove `exception` from `StepEntry`. When it was too long, it caused crash because of badly formed JSON.
- Bump `patrol_finders` and `patrol_log` versions.
- Bump compileSdk to 35.
- Bump gradle to 8.9.0.
- Make Patrol works with Java 21.

## 3.13.2

Expand Down
4 changes: 2 additions & 2 deletions packages/patrol/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
}

dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "com.android.tools.build:gradle:8.2.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0"
}
Expand All @@ -35,7 +35,7 @@ allprojects {

android {
namespace "pl.leancode.patrol"
compileSdk 33
compileSdk 35

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
6 changes: 4 additions & 2 deletions packages/patrol/example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (flutterVersionName == null) {
}

android {
compileSdkVersion 34
compileSdkVersion 35
ndkVersion flutter.ndkVersion

namespace "pl.leancode.patrol.example"
Expand All @@ -46,6 +46,7 @@ android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
coreLibraryDesugaringEnabled true
}

kotlinOptions {
Expand All @@ -59,7 +60,7 @@ android {
defaultConfig {
applicationId "pl.leancode.patrol.example"
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner"
Expand All @@ -82,5 +83,6 @@ flutter {
}

dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:2.0.3'
androidTestUtil 'androidx.test:orchestrator:1.5.1'
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

<application
android:label="Patrol example"
android:name="${applicationName}"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:windowLayoutInDisplayCutoutMode">shortEdges</item>
</style>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="LaunchTheme" parent="@android:style/Theme.Light.NoTitleBar">
<item name="android:forceDarkAllowed">false</item>
</style>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
2 changes: 1 addition & 1 deletion packages/patrol/example/android/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pluginManagement {

plugins {
id "dev.flutter.flutter-plugin-loader"
id "com.android.application" version "8.1.2" apply false
id "com.android.application" version "8.6.0" apply false
id "com.google.gms.google-services" version "4.4.0" apply false
id "org.jetbrains.kotlin.android" version "1.9.20" apply false
}
Expand Down
2 changes: 2 additions & 0 deletions packages/patrol_finders/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
- Add `isVisibleAt` method to check if a widget is visible at a given alignment in case `visible` fails.
- Remove `exception` from `StepEntry`. When it was too long, it caused crash because of badly formed JSON
- Bump `patrol_log` version.
- Bump compileSdk to 35.
- Bump gradle to 8.9.0.

## 2.6.0

Expand Down
23 changes: 8 additions & 15 deletions packages/patrol_finders/example/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
plugins {
id "com.android.application"
id "kotlin-android"
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
Expand All @@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
}
}

def flutterRoot = localProperties.getProperty("flutter.sdk")
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = "1"
Expand All @@ -21,12 +22,8 @@ if (flutterVersionName == null) {
flutterVersionName = "1.0"
}

apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdk 33
compileSdk 35
namespace "pl.leancode.patrol.example"

kotlinOptions {
Expand All @@ -40,7 +37,7 @@ android {
defaultConfig {
applicationId "pl.leancode.patrol.example"
minSdk 21
targetSdk 33
targetSdk 35
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "pl.leancode.patrol.PatrolJUnitRunner"
Expand All @@ -58,7 +55,3 @@ android {
flutter {
source "../.."
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
}
23 changes: 8 additions & 15 deletions packages/patrol_finders/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,25 +1,18 @@
buildscript {
ext.kotlin_version = "1.9.20"
repositories {
google()
mavenCentral()
}

dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}

allprojects {
repositories {
google()
mavenCentral()
}
}

rootProject.buildDir = "../build"
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
project.evaluationDependsOn(":app")
}
subprojects {
project.evaluationDependsOn(':app')
}

tasks.register("clean", Delete) {
delete rootProject.buildDir
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
Loading

0 comments on commit 501be2f

Please sign in to comment.