[TIMOB-26944] Inconsistent Android SDK/NDK and JDK detection logic
GitHub Issue | n/a |
---|---|
Type | Story |
Priority | High |
Status | Open |
Resolution | Unresolved |
Affected Version/s | Release 8.0.0 |
Fix Version/s | n/a |
Components | Android, CLI, Tooling |
Labels | 2019-cl, cb-tooling |
Reporter | Christopher Williams |
Assignee | Chris Barber |
Created | 2019-03-27T19:55:03.000+0000 |
Updated | 2019-04-11T16:19:34.000+0000 |
Description
This is an internal development and architecture issue.
We have 3 separate "codebases" around detecting the Android SDK/NDK and the JDK/JAVA_HOME.
For developers building our SDK, we have some logic I wrote up in our "scons" scripts: https://github.com/appcelerator/titanium_mobile/tree/master/build/lib/android
For SDK users (Titanium/Appc CLI) we delegate to node-titanium-sdk: https://github.com/appcelerator/node-titanium-sdk/blob/master/lib/android.js
Which also delegates the jdk/Java stuff to node-apps: https://github.com/appcelerator/node-appc/blob/master/lib/jdk.js
And for the Daemon, it uses androidlib and jdklib:
- https://github.com/appcelerator/androidlib/tree/master/src
- https://github.com/appcelerator/jdklib/tree/master/src
(And although not explicit, it really also uses https://github.com/appcelerator/appcd-plugin-jdk/blob/master/src/jdk-info-service.js to scan Windows registry, etc)
We should not keep re-inventing the wheel repeatedly here. We should be re-using the same logic to detect these pieces regardless of whether we are building the SDK, using the SDK or using the daemon.
androidlib and jdklib exist to replace the jdk logic in node-appc and android logic in node-titanium-sdk. I don't believe we should invest in updating the existing tooling to use androidlib/jdklib. Instead, spend that time getting the new toolchain out the door, which everyday we're getting closer to doing. This ticket has no direct actionable item and will be indirectly resolved when the new Titanium CLI ships.