Skip to content
This repository has been archived by the owner on Oct 4, 2019. It is now read-only.

Commit

Permalink
Fixing cae, when console is asked too early
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulTaykalo committed May 27, 2015
1 parent ebcb24b commit bd29772
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
22 changes: 18 additions & 4 deletions Support/Xcode/Source/Classes/Plugin/SFDYCIPlugin.m
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,28 @@ - (void)setupMenu {
[subMenu addItem:[NSMenuItem separatorItem]];

// Adding inject item
NSMenuItem *recompileAndInjectMenuItem =
[[NSMenuItem alloc] initWithTitle:@"Recompile and inject"
action:@selector(recompileAndInject:)
keyEquivalent:@"x"];
NSMenuItem *recompileAndInjectMenuItem = [[NSMenuItem alloc] initWithTitle:@"Recompile and inject" action:@selector(recompileAndInject:) keyEquivalent:@"x"];
[recompileAndInjectMenuItem setKeyEquivalentModifierMask:NSControlKeyMask];
[recompileAndInjectMenuItem setTarget:self];

[subMenu addItem:recompileAndInjectMenuItem];

NSMenuItem *verboseRecompilationItem = [[NSMenuItem alloc] initWithTitle:@"Use verbose recompilation" action:@selector(useVerboseRecompilationAction:) keyEquivalent:@""];
[verboseRecompilationItem setTarget:self];
[subMenu addItem:verboseRecompilationItem];


}
}

- (void)useVerboseRecompilationAction:(NSMenuItem *)useVerboseRecompilationItem {
CCPXCodeConsole * console = [CCPXCodeConsole consoleForKeyWindow];
if (useVerboseRecompilationItem.state == NSOffState) {
useVerboseRecompilationItem.state = NSOnState;
[console log:@"DYCI verbose recompilation turned ON"];
} else {
useVerboseRecompilationItem.state = NSOffState;
[console log:@"DYCI verbose recompilation turned OFF"];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,12 @@ - (BOOL)canRecompileFileAtURL:(NSURL *)fileURL {
}


- (CCPXCodeConsole *)console {
if (!_console) {
_console = [CCPXCodeConsole consoleForKeyWindow];
}
return _console;
}


@end
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,14 @@ - (void)runCompilationCommand:(id<CDRSXcode_XCDependencyCommand>)command complet

#pragma mark - Creating Dylib

- (CCPXCodeConsole *)console {
if (!_console) {
_console = [CCPXCodeConsole consoleForKeyWindow];
}
return _console;
}


- (void)createDynamiclibraryWithCommand:(id <CDRSXcode_XCDependencyCommand>)command completion:(void (^)(NSError *))completion {

SFDYCIClangParams * clangParams = [self.clangParamsExtractor extractParamsFromArguments:command.arguments];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ - (void)runOperation
[standardOutputFileHandle waitForDataInBackgroundAndNotify];
[standardErrorFileHandle waitForDataInBackgroundAndNotify];

[self.xcodeConsole appendText:[NSString stringWithFormat:@"%@ %@\n\n", self.task.launchPath, [self.task.arguments componentsJoinedByString:@" "]]];
[self.xcodeConsole debug:[NSString stringWithFormat:@"%@ %@\n\n", self.task.launchPath, [self.task.arguments componentsJoinedByString:@" "]]];
[self.task launch];
}
@catch (NSException* exception)
Expand Down

0 comments on commit bd29772

Please sign in to comment.