Skip to content

Commit

Permalink
Merge pull request #935 from Lyokone/bump_android_compile_sdk
Browse files Browse the repository at this point in the history
Periodic visitation and dependency bumping
  • Loading branch information
bartekpacia authored Mar 30, 2024
2 parents 7cc54d7 + 7f750f8 commit df3f679
Show file tree
Hide file tree
Showing 24 changed files with 104 additions and 107 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/location-prepare.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ jobs:
strategy:
fail-fast: false
matrix:
flutter-version: ['3.3.x', '3.7.x', '3.10.x']
flutter-version: ["3.16.x", "3.19.x"]

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
channel: stable
flutter-version: ${{ matrix.flutter-version }}

- name: Set up Melos
Expand All @@ -47,15 +48,15 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.10.x
flutter-version: 3.16.x

- name: Set up Java
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
Expand All @@ -74,12 +75,12 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Flutter
uses: subosito/flutter-action@v2
with:
flutter-version: 3.10.x
flutter-version: 3.16.x

- name: Install tools
run: brew install clang-format
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/location-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: location publish

on:
push:
tags: ['location-v*']
tags: ["location-v*"]

jobs:
publish:
Expand All @@ -15,7 +15,7 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# This step adds the auth token for pub.dev
- name: Set up Dart
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/location_platform_interface-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: location_platform_interface publish

on:
push:
tags: ['location_platform_interface-v*']
tags: ["location_platform_interface-v*"]

jobs:
publish:
Expand All @@ -15,7 +15,7 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# This step adds the auth token for pub.dev
- name: Set up Dart
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/location_web-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: location_web publish

on:
push:
tags: ['location_web-v*']
tags: ["location_web-v*"]

jobs:
publish:
Expand All @@ -15,7 +15,7 @@ jobs:

steps:
- name: Clone repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# This step adds the auth token for pub.dev
- name: Set up Dart
Expand Down
24 changes: 11 additions & 13 deletions packages/location/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
group "com.lyokone.location"
version "1.0-SNAPSHOT"
group = "com.lyokone.location"
version = "1.0-SNAPSHOT"

buildscript {
ext.kotlin_version = "1.9.0"
repositories {
google()
mavenCentral()
gradlePluginPortal()
}

dependencies {
classpath "com.android.tools.build:gradle:7.4.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath("org.jlleitschuh.gradle:ktlint-gradle:11.5.0")
classpath "com.android.tools.build:gradle:8.3.1"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.23"
classpath "org.jlleitschuh.gradle:ktlint-gradle:11.5.0"
}
}

Expand All @@ -26,16 +25,16 @@ apply plugin: "kotlin-android"
apply plugin: "org.jlleitschuh.gradle.ktlint"

android {
namespace "com.lyokone.location"
compileSdk 33
namespace = "com.lyokone.location"
compileSdk = 34

defaultConfig {
minSdk 16
minSdk = 21
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
Expand All @@ -47,7 +46,6 @@ android {
dependencies {
compileOnly "androidx.annotation:annotation:1.6.0"

api "com.google.android.gms:play-services-location:21.0.1"
api "com.google.android.gms:play-services-location:21.2.0"
implementation "androidx.core:core-ktx:1.10.1"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
}
2 changes: 1 addition & 1 deletion packages/location/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = 'location'
rootProject.name = "location"
36 changes: 17 additions & 19 deletions packages/location/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 "dev.flutter.flutter-gradle-plugin"
id "org.jetbrains.kotlin.android"
}

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,35 +22,32 @@ if (flutterVersionName == null) {
flutterVersionName = "1.0"
}

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

android {
compileSdk 33
namespace "com.lyokone.location.example"
compileSdk = 34
namespace = "com.lyokone.location.example"

defaultConfig {
applicationId "com.lyokone.location.example"
minSdk 16
targetSdk 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
applicationId = "com.lyokone.location.example"
minSdk = 21
targetSdk = 34
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
}

flutter {
source "../.."
source = "../.."
}
13 changes: 0 additions & 13 deletions packages/location/example/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = "1.9.0"
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()
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.7-all.zip
30 changes: 22 additions & 8 deletions packages/location/example/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
include ":app"
pluginManagement {
def flutterSdkPath = {
def properties = new Properties()
file("local.properties").withInputStream { properties.load(it) }
def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
return flutterSdkPath
}()

includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")

def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
def properties = new Properties()
repositories {
google()
mavenCentral()
gradlePluginPortal()
}
}

assert localPropertiesFile.exists()
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
plugins {
id "dev.flutter.flutter-plugin-loader"
id "com.android.application" version "8.3.1" apply false
id "org.jetbrains.kotlin.android" version "1.9.23" apply false
}

def flutterSdkPath = properties.getProperty("flutter.sdk")
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
include ":app"
1 change: 0 additions & 1 deletion packages/location/example/android/settings_aar.gradle

This file was deleted.

4 changes: 2 additions & 2 deletions packages/location/example/lib/enable_in_background.dart
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ class _EnableInBackgroundState extends State<EnableInBackgroundWidget> {
ElevatedButton(
onPressed: _enabled == null ? null : _toggleBackgroundMode,
child: Text(_enabled ?? false ? 'Disable' : 'Enable'),
)
),
],
)
),
],
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/location/example/lib/get_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class _GetLocationState extends State<GetLocationWidget> {
color: Colors.white,
)
: const Text('Get'),
)
),
],
),
],
Expand Down
2 changes: 1 addition & 1 deletion packages/location/example/lib/listen_location.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class _ListenLocationState extends State<ListenLocationWidget> {
ElevatedButton(
onPressed: _locationSubscription != null ? _stopListen : null,
child: const Text('Stop'),
)
),
],
),
],
Expand Down
4 changes: 2 additions & 2 deletions packages/location/example/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class _MyHomePageState extends State<MyHomePage> {
IconButton(
icon: const Icon(Icons.info_outline),
onPressed: _showInfoDialog,
)
),
],
),
body: SingleChildScrollView(
Expand All @@ -108,7 +108,7 @@ class _MyHomePageState extends State<MyHomePage> {
const Divider(height: 32),
const EnableInBackgroundWidget(),
const Divider(height: 32),
const ChangeNotificationWidget()
const ChangeNotificationWidget(),
],
),
),
Expand Down
4 changes: 2 additions & 2 deletions packages/location/example/lib/permission_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class _PermissionStatusState extends State<PermissionStatusWidget> {
? null
: _requestPermission,
child: const Text('Request'),
)
),
],
)
),
],
);
}
Expand Down
4 changes: 2 additions & 2 deletions packages/location/example/lib/service_enabled.dart
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class _ServiceEnabledState extends State<ServiceEnabledWidget> {
ElevatedButton(
onPressed: (_serviceEnabled ?? false) ? null : _requestService,
child: const Text('Request'),
)
),
],
)
),
],
);
}
Expand Down
6 changes: 3 additions & 3 deletions packages/location/example/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ publish_to: none
version: 1.0.0+1

environment:
sdk: '>=2.18.0 <4.0.0'
flutter: '>=3.3.0'
sdk: ">=3.1.0 <4.0.0"
flutter: ">=3.16.0"

dependencies:
flutter:
sdk: flutter
location:
path: ../
url_launcher: ^6.0.2
url_launcher: ^6.2.5

dev_dependencies:
leancode_lint: ^3.0.0
Expand Down
Loading

0 comments on commit df3f679

Please sign in to comment.