breautek commented on issue #1731:
URL: 
https://github.com/apache/cordova-android/issues/1731#issuecomment-2276308988

   > I think we should ensure that the platform incl. folder structure exists 
on npm i or cordova build. Because it's already defined in package.json.
   
   Just because platform exists in package.json doesn't mean it should be 
added. There are several instances where a workstation only wants to work with 
subset of supported platforms (be it a CI build, or perhaps the project 
supports the iOS platform but is operating on a non-mac workstation). Therefore 
it definitely can't be implicitly added on npm install.
   
   I'm not sure if Cordova ever supported the ability to build a platform that 
hasn't been added so I'm not sure if this would be a bug, and I'm not sure if 
I'd support it checking and adding the platform implicitly if it hasn't been 
added, it would depend on the code complexity... I'm not sure how easy it would 
be to make the build/prepare command check for and add the platform if it 
doesn't already exists.
   
   Naturally the prebuild hook written will fail since you can't add a platform 
that is already added, and after the first build, it will be added. If you 
wanted to use that as a workaround, you'll need to check if the 
`platforms/android` directory exists (which should be something that is 
gitignored) before you attempt to add the platform.
   
   Generally speaking a workflow would look something like:
   
   1. `git clone cordova-project`
   2. `cordova platform add android`
   3. `cordova build/run android`
   
   


-- 
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: issues-unsubscr...@cordova.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@cordova.apache.org
For additional commands, e-mail: issues-h...@cordova.apache.org

Reply via email to