From 4f92ed170de6019f06b44a26c18ef38f0709288f Mon Sep 17 00:00:00 2001 From: Edward Smith Date: Mon, 2 Sep 2019 12:57:49 -0700 Subject: [PATCH 01/12] * Added code coverage. --- build-release => Tools/build-release | 0 Tools/xcode-coverage-report | 50 ++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) rename build-release => Tools/build-release (100%) create mode 100755 Tools/xcode-coverage-report diff --git a/build-release b/Tools/build-release similarity index 100% rename from build-release rename to Tools/build-release diff --git a/Tools/xcode-coverage-report b/Tools/xcode-coverage-report new file mode 100755 index 0000000..ea398d1 --- /dev/null +++ b/Tools/xcode-coverage-report @@ -0,0 +1,50 @@ +#!/bin/bash +function printHelp() { +cat < ] + +Reads Xcode coverage data and outputs it in a format suitable for phabit ingestion. +HELP +} + +build_dir="" +while (( $# > 0 )) +do + if [[ $1 == -h ]] + then + printHelp + exit 0 + fi + if (( ${#build_dir} != 0 )) + then + echo ">>> Error: Build directory already set: '$build_dir'. Scanning '$1'." 1>&2 + exit 1 + fi + build_dir="$1" + shift +done + +if (( ${#build_dir} == 0 )) +then + if [ -e "./Build" ] + then + build_dir="./Build" + else + build_dir=".build" + fi +fi + +test_run=$(echo ./Build/Logs/Test/**/**/*.xccovarchive) +if (( $(echo "$test_run" | wc -l) != 1 )) +then + echo ">>> Error: can't find xccovarchive file: '$test_run'." 1>&2 + exit 1 +fi + +while IFS= read -r file +do + echo "File: \"$file\"" + xcrun xccov view \ + --file "$file" \ + "$test_run" +done < <(xcrun xccov view --file-list "$test_run") From 86b1037ce6c5448c829a847f2621a2dfe8298cb4 Mon Sep 17 00:00:00 2001 From: ignkarman Date: Tue, 15 Oct 2019 14:36:06 -0400 Subject: [PATCH 02/12] added custom message prefences in XGAPreferencesViewController which is bound to new custom build message properties in the XGASettings. Added custom build message options. --- XcodeGitHub.xcodeproj/project.pbxproj | 4 +- XcodeGitHub/XGCommandOptions.h | 3 + XcodeGitHub/XGCommandOptions.m | 14 + XcodeGitHub/XGXcodeBot.m | 1 + xcode-github-app.xcodeproj/project.pbxproj | 13 +- .../XGAPreferencesViewController.m | 3 + .../XGAPreferencesViewController.xib | 239 +++++++++++++++--- xcode-github-app/XGASettings.h | 3 + xcode-github-app/XGASettings.m | 69 +++++ 9 files changed, 303 insertions(+), 46 deletions(-) diff --git a/XcodeGitHub.xcodeproj/project.pbxproj b/XcodeGitHub.xcodeproj/project.pbxproj index 6b0ec1d..512c225 100644 --- a/XcodeGitHub.xcodeproj/project.pbxproj +++ b/XcodeGitHub.xcodeproj/project.pbxproj @@ -261,7 +261,7 @@ CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = WRWLR8VRUH; + DEVELOPMENT_TEAM = V6NVC835L8; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; GCC_C_LANGUAGE_STANDARD = gnu11; @@ -327,7 +327,7 @@ CODE_SIGN_STYLE = Manual; COPY_PHASE_STRIP = NO; DEBUG_INFORMATION_FORMAT = dwarf; - DEVELOPMENT_TEAM = WRWLR8VRUH; + DEVELOPMENT_TEAM = V6NVC835L8; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu11; diff --git a/XcodeGitHub/XGCommandOptions.h b/XcodeGitHub/XGCommandOptions.h index 5e047d2..8c6678a 100644 --- a/XcodeGitHub/XGCommandOptions.h +++ b/XcodeGitHub/XGCommandOptions.h @@ -18,6 +18,9 @@ NS_ASSUME_NONNULL_BEGIN @property (copy) NSString*_Nullable xcodeServerPassword; // Optional @property (copy) NSString*_Nullable templateBotName; @property (copy) NSString*_Nullable githubAuthToken; +@property (copy) NSString*_Nullable successfulBuildMessage; +@property (copy) NSString*_Nullable failedBuildMessage; +@property (copy) NSString*_Nullable perfectBuildMessage; @property (assign) int verbosity; @property (assign) BOOL dryRun; @property (assign) BOOL showStatusOnly; diff --git a/XcodeGitHub/XGCommandOptions.m b/XcodeGitHub/XGCommandOptions.m index b7ad1f9..dc9f59c 100644 --- a/XcodeGitHub/XGCommandOptions.m +++ b/XcodeGitHub/XGCommandOptions.m @@ -29,6 +29,9 @@ - (instancetype _Nonnull) initWithArgc:(int)argc argv:(char*const _Nullable[_Nul {"verbose", no_argument, NULL, 'v'}, {"version", no_argument, NULL, 'V'}, {"xcodeserver", required_argument, NULL, 'x'}, + {"successmessage", no_argument, NULL, 'S'}, + {"failuremessage", no_argument, NULL, 'F'}, + {"perfectmessage", no_argument, NULL, 'P'}, {0, 0, 0, 0} }; @@ -54,6 +57,9 @@ - (instancetype _Nonnull) initWithArgc:(int)argc argv:(char*const _Nullable[_Nul case 'v': self.verbosity++; break; case 'V': self.showVersion = YES; break; case 'x': self.xcodeServerName = [self.class stringFromParameter]; break; + case 'S': self.successfulBuildMessage = [self.class stringFromParameter]; break; + case 'F': self.failedBuildMessage = [self.class stringFromParameter]; break; + case 'P': self.perfectBuildMessage = [self.class stringFromParameter]; break; default: self.badOptionsError = YES; break; } } while (c != -1 && !self.badOptionsError); @@ -107,6 +113,14 @@ + (NSString*) helpString { "\n" " -x, --xcodeserver \n" " The network name of the xcode server.\n" + " -S, --successmessage \n" + " Optional custom integration success message.\n" + "\n" + " -F, --failuremessage \n" + " Optional custom integration failure message.\n" + "\n" + " -P, --perfectmessage \n" + " Optional custom perfect integration message.\n" "\n" "The tool returns 0 on success, otherwise a non-zero value.\n" "\n" diff --git a/XcodeGitHub/XGXcodeBot.m b/XcodeGitHub/XGXcodeBot.m index abf3632..494d097 100644 --- a/XcodeGitHub/XGXcodeBot.m +++ b/XcodeGitHub/XGXcodeBot.m @@ -133,6 +133,7 @@ - (NSString*) summaryString { */ - (APFormattedString*) formattedDetailString { + NSTimeInterval duration = [self.endedDate timeIntervalSinceDate:self.startedDate]; NSString*durationString = XGDurationStringFromTimeInterval(duration); diff --git a/xcode-github-app.xcodeproj/project.pbxproj b/xcode-github-app.xcodeproj/project.pbxproj index ceab214..af42a17 100644 --- a/xcode-github-app.xcodeproj/project.pbxproj +++ b/xcode-github-app.xcodeproj/project.pbxproj @@ -246,7 +246,7 @@ TargetAttributes = { 4D7661672057565200216B72 = { CreatedOnToolsVersion = 9.2; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; SystemCapabilities = { com.apple.HardenedRuntime = { enabled = 1; @@ -480,9 +480,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "xcode-github-app/xcode-github-app.entitlements"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = WRWLR8VRUH; + DEVELOPMENT_TEAM = V6NVC835L8; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/xcode-github-app/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; @@ -497,10 +498,10 @@ buildSettings = { ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CODE_SIGN_ENTITLEMENTS = "xcode-github-app/xcode-github-app.entitlements"; - CODE_SIGN_IDENTITY = "Mac Developer"; - CODE_SIGN_STYLE = Manual; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - DEVELOPMENT_TEAM = WRWLR8VRUH; + DEVELOPMENT_TEAM = V6NVC835L8; ENABLE_HARDENED_RUNTIME = YES; INFOPLIST_FILE = "$(SRCROOT)/xcode-github-app/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; diff --git a/xcode-github-app/XGAPreferencesViewController.m b/xcode-github-app/XGAPreferencesViewController.m index 984c124..52615e0 100644 --- a/xcode-github-app/XGAPreferencesViewController.m +++ b/xcode-github-app/XGAPreferencesViewController.m @@ -21,6 +21,9 @@ @interface XGAPreferencesViewController () @property (strong) IBOutlet NSTableView *tableView; @property (strong) IBOutlet NSNumberFormatter *refreshTimeFormatter; @property (strong) XGAAddServerPanel *addServerPanel; +@property (strong) IBOutlet NSTextField *perfectBuildMessageTextField; +@property (strong) IBOutlet NSTextField *failedBuildMessageTextField; +@property (strong) IBOutlet NSTextField *successfulBuildMessageTextField; @end @implementation XGAPreferencesViewController diff --git a/xcode-github-app/XGAPreferencesViewController.xib b/xcode-github-app/XGAPreferencesViewController.xib index 31ba7fb..ce04a20 100644 --- a/xcode-github-app/XGAPreferencesViewController.xib +++ b/xcode-github-app/XGAPreferencesViewController.xib @@ -1,17 +1,20 @@ - + - + + + + @@ -22,15 +25,15 @@ - + - - + + - + - + - + - + @@ -88,9 +91,11 @@ - + - + + + @@ -105,6 +110,11 @@ + + + + + @@ -136,9 +146,11 @@ - + - + + + @@ -153,6 +165,11 @@ + + + + + @@ -178,7 +195,7 @@