[ 
https://issues.apache.org/jira/browse/CB-14054?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16477407#comment-16477407
 ] 

ASF GitHub Bot commented on CB-14054:
-------------------------------------

TimBarham commented on issue #7: CB-14054: fixing cordova-android directory 
restructuring. (backward compatible)
URL: https://github.com/apache/cordova-serve/pull/7#issuecomment-389512098
 
 
   Thanks for the PR @zeprone!
   
   One plan when `cordova-serve` was first written was that it would move to 
using the platform API to get the `www` folder once that was supported. This 
seems like a great opportunity to do that! It means we don't have to reply on a 
hardcoded `www` folder in `cordova-serve` anymore (except to support older 
platform versions that don't have it), and changes like this will no longer 
break `cordova-serve` going forwards.
   
   Instead of getting the `version` from the platform, you can get the `www` 
folder directly using code something like this:
   
   ```js
   try {
       var api = require(path.join(cordovaProjectRoot, 'platforms', 
platformName, 'cordova/api'));
       return new api().locations.www;
   } catch(e) {
       // Fallback on hardcoded paths if platform api not found
       return return path.join(cordovaProjectRoot, 'platforms', platformName, 
platform.www_dir);
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> cordova-serve not aware of cordova-android directory restructuring in v7+
> -------------------------------------------------------------------------
>
>                 Key: CB-14054
>                 URL: https://issues.apache.org/jira/browse/CB-14054
>             Project: Apache Cordova
>          Issue Type: Bug
>          Components: cordova-android, cordova-serve
>    Affects Versions: cordova-android-7.0.0
>         Environment: **
>  * Cordova VS Code extension version: 1.3.9
>  * VSCode version: 1.22.2
>  * OS platform and version: Windows 10 Education x64 v10.0.16299.402
>  * NodeJS version: 8.11.1
>  * Cordova version: 8.0.0
>  * Cordova-Android/iOS/Windows version: 7.0.0 (also tried 7.1.0)
>  
>            Reporter: Russell Allen
>            Assignee: Joe Bowser
>            Priority: Major
>
> The cordova-serve plugin detects the platform {{www}} root wrong: in 
> [email protected] it has moved from {{assets/www}} to {{app/src/main/assets/www}}.
> When using [email protected], the issue doesn't persist.
> Discovered when using VS Code to emulate app (as Android) in browser. Please 
> see [https://github.com/Microsoft/vscode-cordova/issues/386] 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to