[TIMOB-25448] Android: Update module build tools to compile with Java 7
GitHub Issue | n/a |
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2017-11-10T01:02:16.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 7.0.0 |
Components | Android |
Labels | android, java, module |
Reporter | Joshua Quick |
Assignee | Joshua Quick |
Created | 2017-10-27T01:22:10.000+0000 |
Updated | 2017-11-15T05:52:44.000+0000 |
Description
*Summary:*
Currently, the "appc" command line tool builds Titanium Android modules with Java 6 which is obsolete and generates compiler warnings.
We should switch to compiling modules with Java 7 which is 100% supported by the Android SDK and is what Google currently recommends. Plus, module developers can take advantage of Java 7's newest language features, such as the Closable try-resouce feature.
*Note:*
The Android SDK does not fully support Java 8 yet. We can use the JDK 8 or JDK 9 tools, but compile with Java 7 until Google has full support.
*How to test:*
Unzip the attached [^java7module.zip] file.
Open the Mac terminal (or Windows command prompt).
In the terminal, "cd" (change directory) to the "./java7Module/android" directory.
In the terminal, enter: appc ti sdk select
You will be prompted to select an SDK version. Enter the newest Titanium version.
In the terminal, enter: appc run -p "android" --build-only
Verify that the build was successful. (Note that compiler errors will occur if compiling with Java 6.)
Attachments
PR (master): https://github.com/appcelerator/titanium_mobile/pull/9562
Passed FR, and merged.
Changes are seen in SDK 7.0.0.v20171114202841.