From 99c32b3c8df9a2d216fcd5deebf52492fe197d5f Mon Sep 17 00:00:00 2001 From: Amit Nayar Date: Wed, 27 Jan 2021 14:43:03 +0000 Subject: [PATCH 1/7] Attempt to remove version duplication and bump wrapper version --- android/config.gradle | 17 +++++++++++++++++ .../gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/android/config.gradle b/android/config.gradle index f7004278..e72d7a34 100644 --- a/android/config.gradle +++ b/android/config.gradle @@ -6,6 +6,17 @@ * UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. * This notice may not be removed from this file. */ + +@Grab('org.yaml:snakeyaml:1.17') + +import groovy.yaml + +Yaml parser = new Yaml() +List example = parser.load(("example.yaml" as File).text) + +example.each{println it.subject} + + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -31,6 +42,12 @@ if (pspdfkitVersion == null || pspdfkitVersion == '') { ext.pspdfkitMavenModuleName = 'pspdfkit' +// Get our library version from the pubspec.yaml file. +def pubspecFile = rootProject.file('../pubspec.yaml') +if (!pubspecFile.exists()) { + throw new GradleException("pubspec.yaml not found") +} + ext.pspdfkitFlutterVersion = '1.10.3' ext.androidCompileSdkVersion = 29 diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 73d04ed5..e83a26b9 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jul 16 16:27:42 CEST 2018 +#Wed Jan 27 11:51:31 GMT 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip From 956d5452c1e00aa8ef637f656ed26c3cc5746539 Mon Sep 17 00:00:00 2001 From: Amit Nayar Date: Mon, 1 Feb 2021 17:20:02 +0000 Subject: [PATCH 2/7] Fix the yaml parsing for version. --- android/config.gradle | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/android/config.gradle b/android/config.gradle index e72d7a34..591141e4 100644 --- a/android/config.gradle +++ b/android/config.gradle @@ -7,15 +7,16 @@ * This notice may not be removed from this file. */ -@Grab('org.yaml:snakeyaml:1.17') - -import groovy.yaml - -Yaml parser = new Yaml() -List example = parser.load(("example.yaml" as File).text) - -example.each{println it.subject} +buildscript { + repositories { + jcenter() + } + dependencies { + classpath "org.yaml:snakeyaml:1.27" + } +} +import org.yaml.snakeyaml.Yaml def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') @@ -42,13 +43,14 @@ if (pspdfkitVersion == null || pspdfkitVersion == '') { ext.pspdfkitMavenModuleName = 'pspdfkit' -// Get our library version from the pubspec.yaml file. -def pubspecFile = rootProject.file('../pubspec.yaml') +// Get our library version from the top level pubspec.yaml file. +def pubspecFilePath = '../pubspec.yaml' +def pubspecFile = rootProject.file(pubspecFilePath) if (!pubspecFile.exists()) { - throw new GradleException("pubspec.yaml not found") + throw new GradleException("'pubspec.yaml' file not found. Expected at the top level of the Flutter repository.") } - -ext.pspdfkitFlutterVersion = '1.10.3' +def pubspecYaml = new Yaml().load( pubspecFile.newInputStream() ) +ext.pspdfkitFlutterVersion = pubspecYaml.version ext.androidCompileSdkVersion = 29 ext.androidBuildToolsVersion = '29.0.1' From 6c076079e3dad45bec0d13bae54b546062780a9d Mon Sep 17 00:00:00 2001 From: Amit Nayar Date: Mon, 1 Feb 2021 17:34:00 +0000 Subject: [PATCH 3/7] Some IDE recommendations for warnings --- android/gradle.properties | 17 ++++++++++++++++- .../gradle/wrapper/gradle-wrapper.properties | 4 ++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/android/gradle.properties b/android/gradle.properties index b3fa280b..3ff4bae2 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -1,2 +1,17 @@ +## For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html +# +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx1024m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 +# +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true +#Mon Feb 01 09:50:51 GMT 2021 +android.enableJetifier=true +android.useAndroidX=true +org.gradle.configureondemand=false org.gradle.jvmargs=-Xmx1536M -org.gradle.configureondemand=false \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index e83a26b9..3b55b014 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Wed Jan 27 11:51:31 GMT 2021 +#Mon Feb 01 16:17:50 GMT 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip From 054bb7790db5ee51aa93923c3f2a4a835756e74d Mon Sep 17 00:00:00 2001 From: Amit Nayar Date: Tue, 2 Feb 2021 09:45:44 +0000 Subject: [PATCH 4/7] Apply AS recommendations for the example project --- android/config.gradle | 2 +- example/android/app/build.gradle | 2 +- example/android/gradle.properties | 2 +- example/android/gradle/wrapper/gradle-wrapper.properties | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/android/config.gradle b/android/config.gradle index 591141e4..a20f6aa3 100644 --- a/android/config.gradle +++ b/android/config.gradle @@ -56,4 +56,4 @@ ext.androidCompileSdkVersion = 29 ext.androidBuildToolsVersion = '29.0.1' ext.androidMinSdkVersion = 19 ext.androidTargetSdkVersion = 29 -ext.androidGradlePluginVersion = '3.6.3' +ext.androidGradlePluginVersion = '4.1.1' diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle index dddc4012..93bdad9a 100644 --- a/example/android/app/build.gradle +++ b/example/android/app/build.gradle @@ -44,7 +44,7 @@ flutter { } dependencies { - compile 'com.android.support:multidex:1.0.3' + implementation 'com.android.support:multidex:1.0.3' testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test:runner:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1' diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 9959cda2..563d6ca4 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -2,4 +2,4 @@ org.gradle.jvmargs=-Xmx1536M org.gradle.configureondemand=false android.useAndroidX=true android.enableJetifier=true -android.enableR8=true +android.enableD8=true diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties index bc24dcf0..a4ffc637 100644 --- a/example/android/gradle/wrapper/gradle-wrapper.properties +++ b/example/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Jun 23 08:50:38 CEST 2017 +#Tue Feb 02 09:21:10 GMT 2021 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip From 41ee041012ec1e74b1b73005f535a226b43408ae Mon Sep 17 00:00:00 2001 From: Amit Date: Tue, 2 Feb 2021 15:37:07 +0000 Subject: [PATCH 5/7] Update android/config.gradle Co-authored-by: David Schreiber-Ranner --- android/config.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/config.gradle b/android/config.gradle index a20f6aa3..a549f4b7 100644 --- a/android/config.gradle +++ b/android/config.gradle @@ -49,7 +49,7 @@ def pubspecFile = rootProject.file(pubspecFilePath) if (!pubspecFile.exists()) { throw new GradleException("'pubspec.yaml' file not found. Expected at the top level of the Flutter repository.") } -def pubspecYaml = new Yaml().load( pubspecFile.newInputStream() ) +def pubspecYaml = new Yaml().load(pubspecFile.newInputStream()) ext.pspdfkitFlutterVersion = pubspecYaml.version ext.androidCompileSdkVersion = 29 From 776febd9c6376af009928e1647b7eaa67d4b87ab Mon Sep 17 00:00:00 2001 From: Amit Date: Tue, 2 Feb 2021 15:38:38 +0000 Subject: [PATCH 6/7] Update gradle.properties --- example/android/gradle.properties | 1 - 1 file changed, 1 deletion(-) diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 563d6ca4..925f7b34 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -2,4 +2,3 @@ org.gradle.jvmargs=-Xmx1536M org.gradle.configureondemand=false android.useAndroidX=true android.enableJetifier=true -android.enableD8=true From 5f583b137c0ea12c80382f5a28a921927771c364 Mon Sep 17 00:00:00 2001 From: Amit Nayar Date: Tue, 2 Feb 2021 16:03:12 +0000 Subject: [PATCH 7/7] Changelog entry --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d39e9f3f..e9aeb9fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## Next Release + +- Fixes versioning system to not require a manual update in two places. (#80) +- Updates Gradle version and enable AndroidX for Android plugin and example. (#80) +- Changes open source license to modified BSD instead of Apache. (#79) + ## [1.10.3] - 11 Jan 2021 - Updates copyright year to 2021. (#75)