Merge branch 'master' into StudioProjectCompat

I fixed the master so it passes eslint.
This commit is contained in:
Joe Bowser 2017-07-18 14:25:56 -07:00
commit d0dab4bb09
2 changed files with 9 additions and 2 deletions

View File

@ -36,7 +36,7 @@ at the core, applications written with web technology: HTML, CSS and JavaScript.
## Requires
- Java JDK 1.6 or greater
- Java JDK 1.8 or greater
- Android SDK [http://developer.android.com](http://developer.android.com)

View File

@ -167,9 +167,16 @@ function cleanWww (projectRoot, locations) {
*/
function updateProjectAccordingTo (platformConfig, locations) {
// Update app name by editing res/values/strings.xml
var name = platformConfig.name();
var strings = xmlHelpers.parseElementtreeSync(locations.strings);
var name = platformConfig.name();
strings.find('string[@name="app_name"]').text = name.replace(/\'/g, '\\\'');
var shortName = platformConfig.shortName && platformConfig.shortName();
if (shortName && shortName !== name) {
strings.find('string[@name="launcher_name"]').text = shortName.replace(/\'/g, '\\\'');
}
fs.writeFileSync(locations.strings, strings.write({indent: 4}), 'utf-8');
events.emit('verbose', 'Wrote out android application name "' + name + '" to ' + locations.strings);