cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shazron <...@git.apache.org>
Subject [GitHub] cordova-android pull request #321: CB-8978 Prepare copy resource-files from ...
Date Fri, 14 Apr 2017 19:53:11 GMT
Github user shazron commented on a diff in the pull request:

    https://github.com/apache/cordova-android/pull/321#discussion_r111626815
  
    --- 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 --
    
    (same result in iOS in my PR)



---
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


Mime
View raw message