breautek commented on PR #1896:
URL: https://github.com/apache/cordova-android/pull/1896#issuecomment-4090029533

   > This is very inconsistent when cordova platform add creates a half 
functional Android Studio project but cordova build is required to create a 
full functional IDE project. I think this should be improved.
   
   I do agree but I also agree with Erisu that we might not want to do a full 
build on platform add. But platform add should generate functional IDE project.
   
   If I recall correctly we have a dummy project in a `tools` subfolder, which 
acts as a standalone android project (it has it's own `settings.gradle`) and 
it's entire purpose is to decouple the android gradle project from the Android 
SDK -- so that we can request a gradle wrapper, using the system gradle version 
that the user has installed, to get a gradle wrapper at the version the project 
wants.
   
   The reason why we need to decouple from the Android SDK for this step is 
because the Android SDK will apply gradle version constraints preventing you 
from executing the gradle wrapper task. Which means if you load in the Android 
SDK into the build script, the installed system gradle version must be 
satisfiable by Android SDK which kinda defeats the purpose of using a 
wrapper... So we have a dummy project allowing a much broader version range of 
gradle, to be used to get the gradle wrapper.
   
   Then to make Android Studio IDE recognize that the wrapper is installed for 
its own project, we copy the gradle wrapper files up to the main android 
project.
   
   This is all to work around the "Gradle" way of doing things, which they say 
you should check in the gradle wrapper, including it's binary content into the 
repository. However if you accept that practice, you open yourself up to the 
[XZ](https://www.akamai.com/blog/security-research/critical-linux-backdoor-xz-utils-discovered-what-to-know)
 problem... as it can be very easy to sneak and hide malicious code in binary 
files.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to