You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cordova.apache.org by shazron <gi...@git.apache.org> on 2017/04/14 19:52:47 UTC

[GitHub] cordova-android pull request #321: CB-8978 Prepare copy resource-files from ...

Github user shazron commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/321#discussion_r111626765
  
    --- Diff: bin/templates/cordova/lib/prepare.js ---
    @@ -401,6 +403,44 @@ function mapImageResources(rootDir, subDir, type, resourceName) {
         return pathMap;
     }
     
    +
    +function updateFileResources(cordovaProject, platformDir) {
    +    var files = cordovaProject.projectConfig.getFileResources('android');
    +
    +    // if there are resource-file elements in config.xml
    +    if (files.length === 0) {
    +        events.emit('verbose', 'This app does not have additional resource files defined');
    +        return;
    +    }
    +
    +    var resourceMap = {};
    +    files.forEach(function(res) {
    +        var targetPath = path.join(platformDir, res.target);
    +        resourceMap[targetPath] = res.src;
    +    });
    +
    +    events.emit('verbose', 'Updating resource files at ' + platformDir);
    +    FileUpdater.updatePaths(
    +        resourceMap, { rootDir: cordovaProject.root }, logFileOp);
    +}
    +
    +
    +function cleanFileResources(projectRoot, projectConfig, platformDir) {
    +    var files = projectConfig.getFileResources('android');
    +    if (files.length > 0) {
    --- End diff --
    
    @dpogue @infil00p  I noticed that files.length is always zero here when I do a `cordova clean` even though I have a `<resource-file>` tag in config.xml.  Is this function useless then effectively?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@cordova.apache.org
For additional commands, e-mail: dev-help@cordova.apache.org