Created
May 28, 2019 11:20
-
-
Save janvennemann/c97c731a67dfd03dbafa22824ee1feda to your computer and use it in GitHub Desktop.
Titanium module hook to add Storyboards
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
const fs = require('fs'); | |
const path = require('path'); | |
exports.id = 'my.module.add.storyboard'; | |
exports.cliVersion = '>=3.2'; | |
exports.init = init; | |
function init(logger, config, cli) { | |
cli.on('build.ios.xcodeproject', { | |
pre: (data, next) => { | |
const builder = data.ctx; | |
const xcodeProject = data.args[0]; | |
const originalGenerateUuid = xcodeProject.generateUuid; | |
xcodeProject.generateUuid = builder.generateXcodeUuid.bind(builder, xcodeProject); | |
// Edit the name to match your .storyboard | |
xcodeProject.addResourceFile(path.join(builder.buildDir, 'Storyboard.storyboard')); | |
xcodeProject.generateUuid = originalGenerateUuid; | |
next(); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment