Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the need to update the version in two places #80

Merged
merged 7 commits into from
Feb 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated but missing from the changelog.


## [1.10.3] - 11 Jan 2021

- Updates copyright year to 2021. (#75)
Expand Down
23 changes: 21 additions & 2 deletions android/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
* UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES.
* This notice may not be removed from this file.
*/

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')
if (localPropertiesFile.exists()) {
Expand All @@ -31,10 +43,17 @@ if (pspdfkitVersion == null || pspdfkitVersion == '') {

ext.pspdfkitMavenModuleName = 'pspdfkit'

ext.pspdfkitFlutterVersion = '1.10.3'
// Get our library version from the top level pubspec.yaml file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

def pubspecFilePath = '../pubspec.yaml'
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())
ext.pspdfkitFlutterVersion = pubspecYaml.version

ext.androidCompileSdkVersion = 29
ext.androidBuildToolsVersion = '29.0.1'
ext.androidMinSdkVersion = 19
ext.androidTargetSdkVersion = 29
ext.androidGradlePluginVersion = '3.6.3'
ext.androidGradlePluginVersion = '4.1.1'
17 changes: 16 additions & 1 deletion android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,17 @@
## For more details on how to configure your build environment visit
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes in this file were added by Android Studio automatically to fix some warnings.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those changes look good and are sensible.

# 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
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jul 16 16:27:42 CEST 2018
#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-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upping the gradle version because there appears to be no side effects from doing so.

2 changes: 1 addition & 1 deletion example/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ flutter {
}

dependencies {
compile 'com.android.support:multidex:1.0.3'
implementation 'com.android.support:multidex:1.0.3'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compile is deprecated

testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
Expand Down
1 change: 0 additions & 1 deletion example/android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ org.gradle.jvmargs=-Xmx1536M
org.gradle.configureondemand=false
android.useAndroidX=true
android.enableJetifier=true
android.enableR8=true
4 changes: 2 additions & 2 deletions example/android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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