Skip to content

Commit

Permalink
Merge pull request #18 from cheekiatng/timob-20469
Browse files Browse the repository at this point in the history
[TIMOB-20469] Fix build after clean
  • Loading branch information
jhaynie committed Apr 20, 2016
2 parents b1ca65d + 544984e commit e19cd1d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
13 changes: 11 additions & 2 deletions iphone/plugin/hyperloop.js
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,13 @@ HyperloopiOSBuilder.prototype.generateSourceFiles = function generateSourceFiles
* Generates the symbol reference based on the references from the metabase's parser state.
*/
HyperloopiOSBuilder.prototype.generateSymbolReference = function generateSymbolReference() {
var symbolRefFile = path.join(this.hyperloopBuildDir, 'symbol_references.json');
var json = JSON.stringify(this.parserState.getReferences(), null, 2);

if (!this.parserState) {
this.logger.info('Skipping ' + HL + ' generating of symbol references. Empty AST. ');
return;
}
var symbolRefFile = path.join(this.hyperloopBuildDir, 'symbol_references.json'),
json = JSON.stringify(this.parserState.getReferences(), null, 2);
if (!fs.existsSync(symbolRefFile) || fs.readFileSync(symbolRefFile).toString() !== json) {
this.forceStubGeneration = true;
this.logger.trace('Forcing regeneration of wrappers');
Expand All @@ -549,6 +553,11 @@ HyperloopiOSBuilder.prototype.compileResources = function compileResources(callb
* Generates stubs from the metabase.
*/
HyperloopiOSBuilder.prototype.generateStubs = function generateStubs(callback) {

if (!this.parserState) {
this.logger.info('Skipping ' + HL + ' stub generation. Empty AST.');
return callback();
}
if (!this.forceStubGeneration) {
this.logger.debug('Skipping stub generation');
return callback();
Expand Down
4 changes: 3 additions & 1 deletion metabase/ios/lib/generate/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,9 @@ function generateFromJSON (name, dir, json, state, callback, includes) {

// remove these functions for now until we can fix them
['NSLogv', 'NSLog', 'UIApplicationMain'].forEach(function (fn) {
delete json.functions[fn];
if (json.functions) {
delete json.functions[fn];
}
});

// we must have a root object even those this is a protocol and
Expand Down
4 changes: 3 additions & 1 deletion metabase/ios/lib/generate/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,9 @@ function getResultWrapper (state, json, obj, instance) {
addImport(state, name, struct);
return newPrefix(state, name);
} else {
typedef = json.typedefs[cls];
if (json.typedefs) {
typedef = json.typedefs[cls];
}
if (typedef) {
return getResultWrapper(state, json, typedef, instance);
}
Expand Down

0 comments on commit e19cd1d

Please sign in to comment.