diff --git a/android/KMAPro/build.gradle b/android/KMAPro/build.gradle index 9f6728c04d..47a5bb35f6 100644 --- a/android/KMAPro/build.gradle +++ b/android/KMAPro/build.gradle @@ -8,9 +8,10 @@ buildscript { } } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' - classpath 'com.google.gms:google-services:4.2.0' - classpath 'io.fabric.tools:gradle:1.28.1' + classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.google.gms:google-services:4.3.2' + classpath 'io.fabric.tools:gradle:1.31.2' + classpath 'name.remal:gradle-plugins:1.0.157' } } diff --git a/android/KMAPro/gradle/wrapper/gradle-wrapper.properties b/android/KMAPro/gradle/wrapper/gradle-wrapper.properties index 29126efb6c..53d1d37d02 100644 --- a/android/KMAPro/gradle/wrapper/gradle-wrapper.properties +++ b/android/KMAPro/gradle/wrapper/gradle-wrapper.properties @@ -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-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/android/KMAPro/kMAPro/build.gradle b/android/KMAPro/kMAPro/build.gradle index 0ab3a071d2..30e3c30cb2 100644 --- a/android/KMAPro/kMAPro/build.gradle +++ b/android/KMAPro/kMAPro/build.gradle @@ -1,16 +1,18 @@ plugins { id 'com.android.application' id 'io.fabric' - id 'com.github.triplet.play' version '2.1.0' apply false + id 'com.github.triplet.play' version '2.5.0' apply false + id 'name.remal.default-plugins' } android { - compileSdkVersion 28 + compileSdkVersion 29 + buildToolsVersion "29.0.2" defaultConfig { applicationId "com.tavultesoft.kmapro" minSdkVersion 19 - targetSdkVersion 28 + targetSdkVersion 29 //println "===DUMPING PROPERTIES===" //dumpProperties(project) // Use this to dump all external properties for debugging TeamCity integration @@ -115,15 +117,15 @@ repositories { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.0.0' api(name: 'keyman-engine', ext: 'aar') - implementation "com.google.firebase:firebase-core:16.0.8" + implementation "com.google.firebase:firebase-core:17.2.1" implementation "com.google.firebase:firebase-crash:16.2.1" - implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') { + implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') { transitive = true } - implementation 'androidx.preference:preference:1.1.0-alpha04' + implementation 'androidx.preference:preference:1.1.0' } /*def void dumpProperties(it){ diff --git a/android/KMEA/app/build.gradle b/android/KMEA/app/build.gradle index eb271e91c0..dd13f07074 100644 --- a/android/KMEA/app/build.gradle +++ b/android/KMEA/app/build.gradle @@ -1,12 +1,15 @@ -apply plugin: 'com.android.library' +plugins { + id 'name.remal.default-plugins' + id 'com.android.library' +} android { - compileSdkVersion 28 - buildToolsVersion "28.0.3" + compileSdkVersion 29 + buildToolsVersion "29.0.2" defaultConfig { minSdkVersion 16 - targetSdkVersion 28 + targetSdkVersion 29 String env_build_number = System.getenv("BUILD_NUMBER") //assigned by TeamCity, so all caps String env_build_counter = System.getenv("build_counter") @@ -42,25 +45,45 @@ android { //showStandardStreams = true // If we want test console log output to show during builds. } workingDir = "../" // Defaults to the `app` subdirectory, which is different from Android Studio's default. + + //Avoid Warning: an illegal reflective access operation has occurred + //Change argument jdk.module.illegalAccess=warn for detailed information which module needs to be opened + //Problem is caused by robolectric: see https://github.com/robolectric/robolectric/issues/4776 + if(JavaVersion.current().isJava9Compatible()){ + jvmArgs ('-Djdk.module.illegalAccess=permit') + jvmArgs('--add-opens', 'java.base/java.lang=ALL-UNNAMED') + jvmArgs('--add-opens', 'java.base/java.lang.reflect=ALL-UNNAMED') + } + } } } dependencies { - implementation 'androidx.appcompat:appcompat:1.0.2' + implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'com.google.android.material:material:1.0.0' implementation 'commons-io:commons-io:2.6' - implementation 'org.apache.commons:commons-text:1.6' + implementation 'org.apache.commons:commons-text:1.8' // Robolectric - testImplementation 'androidx.test:core:1.1.0' - testImplementation 'androidx.test.ext:junit:1.1.0' - testImplementation 'org.robolectric:robolectric:4.2' + testImplementation 'androidx.test:core:1.2.0' + testImplementation 'androidx.test.ext:junit:1.1.1' + testImplementation 'org.robolectric:robolectric:4.3.1' /* We only want these Firebase Crashlytics dependencies for KMEA */ - implementation 'com.google.firebase:firebase-analytics:16.4.0' + implementation 'com.google.firebase:firebase-analytics:17.2.1' implementation 'com.google.firebase:firebase-crash:16.2.1' - implementation('com.crashlytics.sdk.android:crashlytics:2.9.9@aar') { - transitive = true; + implementation('com.crashlytics.sdk.android:crashlytics:2.10.1@aar') { + transitive = true } + + // Assign the annotation processor for tests. + testAnnotationProcessor 'com.google.auto.service:auto-service:1.0-rc4' } +//Show deprecation compiler warnings +/* +allprojects { + tasks.withType(JavaCompile) { + options.compilerArgs << "-Xlint:deprecation" + } +}*/ diff --git a/android/KMEA/app/src/test/resources/com/tavultesoft/kmea/robolectric.properties b/android/KMEA/app/src/test/resources/com/tavultesoft/kmea/robolectric.properties new file mode 100644 index 0000000000..1c3d9c523c --- /dev/null +++ b/android/KMEA/app/src/test/resources/com/tavultesoft/kmea/robolectric.properties @@ -0,0 +1,3 @@ +#Android SDK 29 requires java 9. +#To execute the tests on during the automatic build process, we need to force robolectric to use an older sdk version for test +sdk=28 \ No newline at end of file diff --git a/android/KMEA/build.gradle b/android/KMEA/build.gradle index 6ac36dd8dc..6de066ae49 100644 --- a/android/KMEA/build.gradle +++ b/android/KMEA/build.gradle @@ -5,7 +5,8 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:3.4.0' + classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'name.remal:gradle-plugins:1.0.157' } } diff --git a/android/KMEA/gradle.properties b/android/KMEA/gradle.properties index fc305f79fd..dd9c757897 100644 --- a/android/KMEA/gradle.properties +++ b/android/KMEA/gradle.properties @@ -1,3 +1,11 @@ android.enableJetifier=true android.useAndroidX=true -android.enableUnitTestBinaryResources=true \ No newline at end of file +android.enableUnitTestBinaryResources=true + +#Added because of warning in build process +#Gradle may disable incremental compilation as the following annotation processors are not incremental: auto-service-1.0-rc4.jar (com.google.auto.service:auto-service:1.0-rc4). +#Consider setting the experimental feature flag android.enableSeparateAnnotationProcessing=true in the gradle.properties file to run annotation processing in a separate task and make compilation incremental. +#Causes new warning: +#WARNING: The option setting 'android.enableSeparateAnnotationProcessing=true' is experimental and unsupported. +#The current default is 'false'. +#android.enableSeparateAnnotationProcessing=true diff --git a/android/KMEA/gradle/wrapper/gradle-wrapper.properties b/android/KMEA/gradle/wrapper/gradle-wrapper.properties index 87bd64a1b9..903f2b0357 100644 --- a/android/KMEA/gradle/wrapper/gradle-wrapper.properties +++ b/android/KMEA/gradle/wrapper/gradle-wrapper.properties @@ -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-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip diff --git a/android/README.md b/android/README.md index bb97004ff7..a9a56f37f4 100644 --- a/android/README.md +++ b/android/README.md @@ -2,9 +2,18 @@ ## Prerequisites * Android Studio 3.3.2+ -* Java SE Development Kit 8 +* Java SE Development Kit 8 * [Node.js](https://nodejs.org/) 8.9+ (for building KeymanWeb) +## Install Java +It is recommended to use openJDK because of oracle license issues. +Tested with latest release for openJDK 8 from +https://github.com/ojdkbuild/ojdkbuild + +1. Download and unpack the zip archive +2. On on windows: use the default java path C:\Program Files\Java to avoid error message "Error 0x80010135 Path Too Long". +3. Aso set an environment variable for JAVA_HOME e.g C:\Program Files\Java\openjdk-1.8.0.232-1 + ## Minimum Android Requirements Keyman for Android has a minSdkVersion of 16 for [Android 4.1 Jelly Bean](https://developer.android.com/about/versions/android-4.1) diff --git a/android/history.md b/android/history.md index f5df786ce3..114b1ae24d 100644 --- a/android/history.md +++ b/android/history.md @@ -2,6 +2,9 @@ ## 13.0 alpha * Start version 13.0 +* New Features: + * Adding a download manager to execute downloads in background (#2247) + * Improve custom package installation: Show readme.htm before starting installation process (#2286) ## 2019-10-30 12.0.4206 stable * Bug fix: diff --git a/windows/src/developer/TIKE/compile/CompileKeymanWeb.pas b/windows/src/developer/TIKE/compile/CompileKeymanWeb.pas index 2036b8041c..469c0b45dd 100644 --- a/windows/src/developer/TIKE/compile/CompileKeymanWeb.pas +++ b/windows/src/developer/TIKE/compile/CompileKeymanWeb.pas @@ -974,15 +974,14 @@ begin n := len; pwszContext := fkp.dpContext; - //CODE_IFOPT: // I3429 - //CODE_IFSYSTEMSTORE: // I3430 for i := 1 to n do begin rec := ExpandSentinel(pwszContext); - if rec.IsSentinel and (rec.Code in [CODE_IFOPT, CODE_IFSYSTEMSTORE]) then + if rec.IsSentinel and (rec.Code in [CODE_NUL, CODE_IFOPT, CODE_IFSYSTEMSTORE]) then Dec(len); pwszContext := incxstr(pwszContext); end; + end // KMW < 10.0 exclude all sentinel-based characters, including deadkeys, from direct context deletion. // Deadkeys have alternative special handling. @@ -992,10 +991,10 @@ begin len := -1; if IsKeyboardVersion10OrLater() and (pwsz^ <> #0) then - begin - Result := Result + nlt+Format('k.KDC(%d,t);', [ len ] ); // I3681 - len := -1; - end; + begin + Result := Result + nlt+Format('k.KDC(%d,t);', [ len ] ); // I3681 + len := -1; + end; while pwsz^ <> #0 do begin diff --git a/windows/src/developer/TIKE/xml/layoutbuilder/builder.js b/windows/src/developer/TIKE/xml/layoutbuilder/builder.js index a7cb2b3737..97b605fa9e 100644 --- a/windows/src/developer/TIKE/xml/layoutbuilder/builder.js +++ b/windows/src/developer/TIKE/xml/layoutbuilder/builder.js @@ -2186,15 +2186,15 @@ $(function () { function(data) { builder.loadingState = false; if(typeof data === 'object') { - if(data.platform) { + if(data.platform && KVKL[data.platform]) { $('#selPlatform').val(data.platform); - builder.selectPlatform(); } - if(data.presentation) { + builder.selectPlatform(); + if(data.presentation && builder.presentations[data.presentation]) { $('#selPlatformPresentation').val(data.presentation); builder.prepareLayer(); } - if(data.layer) { + if(data.layer && KVKL[builder.lastPlatform][data.layer]) { $('#selLayer').val(data.layer); builder.selectLayer(); }