Skip to content

Commit

Permalink
fix: Update Gradle to 8
Browse files Browse the repository at this point in the history
* update example build.gradle

* add missing trailing comma

* upgrade AGP to 8

upgrade AGP to 8,
upgrade JVM compatibilty to gradle issues, documented changes
increase build version to 0.3.1

* upgrade compileSdk to API 34

* make namespace property conditional

Co-authored-by: Honza Bittner <git@tenhobi.dev>

* use java version 1.8

---------

Co-authored-by: Honza Bittner <git@tenhobi.dev>
Co-authored-by: Anton Borries <anton.borries@gmail.com>
  • Loading branch information
3 people committed Dec 2, 2023
1 parent 58e99a4 commit e61131d
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 0.3.1
* Fix `renderFlutterWidget` method causing null check exception when trying to save image widget screenshot [#91](https://github.com/ABausG/home_widget/issues/91) by [milindgoel15](https://github.com/milindgoel15)
* Add support for AGP 8.0 by [milindgoel15](https://github.com/milindgoel15)
* Upgrade jvm target compatibility to 17 by [milindgoel15](https://github.com/milindgoel15)
* Upgrade compileSdk to API 34 by [milindgoel15](https://github.com/milindgoel15)

## 0.3.0
* Add `renderFlutterWidget` method to save a Flutter Widget as an Image [#126](https://github.com/ABausG/home_widget/pull/126) by [leighajarett](https://github.com/leighajarett)

Expand Down
17 changes: 14 additions & 3 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ group 'es.antonborri.home_widget'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.8.0'
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -25,7 +25,11 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
compileSdkVersion 33
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'es.antonborri.home_widget'
}
compileSdk 34

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
Expand All @@ -36,6 +40,13 @@ android {
lintOptions {
disable 'InvalidPackage'
}
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = "1.8"
}
}

dependencies {
Expand Down
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Fri Oct 13 13:45:37 IST 2023
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
4 changes: 2 additions & 2 deletions example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ 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.")
throw new FileNotFoundException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
Expand Down Expand Up @@ -39,7 +39,7 @@ android {
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "es.antonborri.home_widget_example"
minSdkVersion 16
minSdkVersion 19
targetSdkVersion 33
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: home_widget
description: A plugin to provide a common interface for creating HomeScreen Widgets for Android and iOS.
version: 0.3.0
version: 0.3.1
repository: https://github.com/ABausG/home_widget

environment:
Expand Down

0 comments on commit e61131d

Please sign in to comment.