forked from kelvinhokk/cordova-plugin-localization-strings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
after_prepare hook to be outside the platform element in plugin.xml
- Loading branch information
Showing
2 changed files
with
24 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
var ios_script = require('./create_ios_strings'); | ||
var android_script = require('./create_android_strings'); | ||
|
||
module.exports = function(context) { | ||
var Q = context.requireCordovaModule('q') | ||
var platformMetadata = context.requireCordovaModule('cordova-lib/src/cordova/platform_metadata'); | ||
|
||
return platformMetadata.getPlatformVersions(context.opts.projectRoot) | ||
.then(function(platformVersions) { | ||
var promises = []; | ||
var platforms = platformVersions.map(function(platformVersion) { | ||
return platformVersion.platform; | ||
}); | ||
if (platforms.indexOf('ios') >= 0) { | ||
promises.push(ios_script(context)); | ||
} | ||
if (platforms.indexOf('android') >= 0) { | ||
promises.push(android_script(context)); | ||
} | ||
return Q.all(promises); | ||
}); | ||
} |