Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #249 from NachoMan/master

Use xcrun to identify the path to "docsetutil".
  • Loading branch information...
commit b54dcbec20a628b2f65cdcf9bee9567ecc153992 2 parents 047e182 + d13a7fa
@tomaz authored
View
8 Application/GBAppledocApplication.m
@@ -21,7 +21,7 @@
static NSString *kGBArgOutputPath = @"output";
static NSString *kGBArgTemplatesPath = @"templates";
static NSString *kGBArgDocSetInstallPath = @"docset-install-path";
-static NSString *kGBArgDocSetUtilPath = @"docsetutil-path";
+static NSString *kGBArgXcrunPath = @"xcrun-path";
static NSString *kGBArgIndexDescPath = @"index-desc";
static NSString *kGBArgIncludePath = @"include";
static NSString *kGBArgIgnorePath = @"ignore";
@@ -232,7 +232,7 @@ - (void)application:(DDCliApplication *)app willParseOptions:(DDGetoptLongParser
{ kGBArgIncludePath, 's', DDGetoptRequiredArgument },
{ kGBArgIndexDescPath, 0, DDGetoptRequiredArgument },
{ kGBArgDocSetInstallPath, 0, DDGetoptRequiredArgument },
- { kGBArgDocSetUtilPath, 0, DDGetoptRequiredArgument },
+ { kGBArgXcrunPath, 0, DDGetoptRequiredArgument },
{ kGBArgProjectName, 'p', DDGetoptRequiredArgument },
{ kGBArgProjectVersion, 'v', DDGetoptRequiredArgument },
@@ -652,7 +652,7 @@ - (NSString *)description {
- (void)setOutput:(NSString *)path { self.settings.outputPath = [self standardizeCurrentDirectoryForPath:path]; }
- (void)setDocsetInstallPath:(NSString *)path { self.settings.docsetInstallPath = [self standardizeCurrentDirectoryForPath:path]; }
-- (void)setDocsetutilPath:(NSString *)path { self.settings.docsetUtilPath = [self standardizeCurrentDirectoryForPath:path]; }
+- (void)setXCRunPath:(NSString *)path { self.settings.xcrunPath = [self standardizeCurrentDirectoryForPath:path]; }
- (void)setInclude:(NSString *)path { [self.settings.includePaths addObject:[self standardizeCurrentDirectoryForPath:path]]; }
- (void)setIndexDesc:(NSString *)path { self.settings.indexDescriptionPath = [self standardizeCurrentDirectoryForPath:path]; }
- (void)setTemplates:(NSString *)path { self.settings.templatesPath = [self standardizeCurrentDirectoryForPath:path]; }
@@ -818,7 +818,7 @@ - (void)printSettingsAndArguments:(NSArray *)arguments {
for (NSString *path in self.settings.ignoredPaths) ddprintf(@"--%@ = %@\n", kGBArgIgnorePath, path);
for (NSString *path in self.settings.excludeOutputPaths) ddprintf(@"--%@ = %@\n", kGBArgExcludeOutputPath, path);
ddprintf(@"--%@ = %@\n", kGBArgDocSetInstallPath, self.settings.docsetInstallPath);
- ddprintf(@"--%@ = %@\n", kGBArgDocSetUtilPath, self.settings.docsetUtilPath);
+ ddprintf(@"--%@ = %@\n", kGBArgXcrunPath, self.settings.xcrunPath);
ddprintf(@"\n");
ddprintf(@"--%@ = %@\n", kGBArgDocSetBundleIdentifier, self.settings.docsetBundleIdentifier);
View
4 Application/GBApplicationSettingsProvider.h
@@ -138,8 +138,8 @@ extern id kGBCustomDocumentIndexDescKey;
/** The path to which documentation set is to be installed. */
@property (copy) NSString *docsetInstallPath;
-/** The path to `docsetutil` tool, including tool filename. */
-@property (copy) NSString *docsetUtilPath;
+/** The path to `xcrun` tool, including tool filename. */
+@property (copy) NSString *xcrunPath;
/** The list of all include paths containing static documentation.
View
8 Application/GBApplicationSettingsProvider.m
@@ -69,10 +69,10 @@ - (id)init {
self.outputPath = @"";
self.templatesPath = nil;
self.docsetInstallPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Library/Developer/Shared/Documentation/DocSets"];
- self.docsetUtilPath = @"/Developer/usr/bin/docsetutil";
- if (![[NSFileManager defaultManager] fileExistsAtPath:self.docsetUtilPath]) {
+ self.xcrunPath = @"/usr/bin/xcrun";
+ if (![[NSFileManager defaultManager] fileExistsAtPath:self.xcrunPath]) {
NSString *xcodePath = [[NSWorkspace sharedWorkspace] fullPathForApplication:@"Xcode"];
- self.docsetUtilPath = [xcodePath stringByAppendingPathComponent:@"Contents/Developer/usr/bin/docsetutil"];
+ self.xcrunPath = [xcodePath stringByAppendingPathComponent:@"Contents/Developer/usr/bin/xcrun"];
}
self.indexDescriptionPath = nil;
self.includePaths = [NSMutableSet set];
@@ -575,7 +575,7 @@ - (NSString *)versionIdentifier {
@synthesize outputPath;
@synthesize docsetInstallPath;
-@synthesize docsetUtilPath;
+@synthesize xcrunPath;
@synthesize templatesPath;
@synthesize includePaths;
@synthesize indexDescriptionPath;
View
4 Generating/GBDocSetOutputGenerator.m
@@ -183,8 +183,8 @@ - (BOOL)indexDocSet:(NSError **)error {
GBLogInfo(@"Indexing DocSet...");
GBTask *task = [GBTask task];
task.reportIndividualLines = YES;
- NSArray *args = [NSArray arrayWithObjects:@"index", [self.outputUserPath stringByStandardizingPath], nil];
- BOOL result = [task runCommand:self.settings.docsetUtilPath arguments:args block:^(NSString *output, NSString *error) {
+ NSArray *args = [NSArray arrayWithObjects:@"docsetutil", @"index", [self.outputUserPath stringByStandardizingPath], nil];
+ BOOL result = [task runCommand:self.settings.xcrunPath arguments:args block:^(NSString *output, NSString *error) {
if (output) GBLogDebug(@"> %@", [output stringByTrimmingWhitespaceAndNewLine]);
if (error) GBLogError(@"!> %@", [error stringByTrimmingWhitespaceAndNewLine]);
}];
View
3  Generating/GBDocSetPublishGenerator.m
@@ -47,6 +47,7 @@ - (BOOL)generateOutputWithStore:(id)store error:(NSError **)error {
// Create command line arguments array.
NSMutableArray *args = [NSMutableArray array];
+ [args addObject:@"docsetutil"];
[args addObject:@"package"];
[args addObject:@"-output"];
[args addObject:[outputDocSetPath stringByStandardizingPath]];
@@ -63,7 +64,7 @@ - (BOOL)generateOutputWithStore:(id)store error:(NSError **)error {
[args addObject:installedDocSetPath];
// Run the task.
- BOOL result = [task runCommand:self.settings.docsetUtilPath arguments:args block:^(NSString *output, NSString *error) {
+ BOOL result = [task runCommand:self.settings.xcrunPath arguments:args block:^(NSString *output, NSString *error) {
if (output) GBLogDebug(@"> %@", [output stringByTrimmingWhitespaceAndNewLine]);
if (error) GBLogError(@"!> %@", [error stringByTrimmingWhitespaceAndNewLine]);
}];
View
10 Testing/GBApplicationTesting.m
@@ -65,13 +65,13 @@ - (void)testDocsetInstallPath_shouldAssignValueToSettings {
assertThat(settings2.docsetInstallPath, is(self.currentPath));
}
-- (void)testDocsetUtilPath_shouldAssignValueToSettings {
+- (void)testXcrunPath_shouldAssignValueToSettings {
// setup & execute
- GBApplicationSettingsProvider *settings1 = [self settingsByRunningWithArgs:@"--docsetutil-path", @"path", nil];
- GBApplicationSettingsProvider *settings2 = [self settingsByRunningWithArgs:@"--docsetutil-path", @".", nil];
+ GBApplicationSettingsProvider *settings1 = [self settingsByRunningWithArgs:@"--xcrun-path", @"path", nil];
+ GBApplicationSettingsProvider *settings2 = [self settingsByRunningWithArgs:@"--xcrun-path", @".", nil];
// verify
- assertThat(settings1.docsetUtilPath, is(@"path"));
- assertThat(settings2.docsetUtilPath, is(self.currentPath));
+ assertThat(settings1.xcrunPath, is(@"path"));
+ assertThat(settings2.xcrunPath, is(self.currentPath));
}
- (void)testIndexDesc_shouldAssignValueToSettings {
Please sign in to comment.
Something went wrong with that request. Please try again.