Last active
March 10, 2019 05:08
-
-
Save roman-dzieciol/8f4d2c91d28854d6e3a0c970a9697a2f to your computer and use it in GitHub Desktop.
myxcodebuild
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
#import <Foundation/Foundation.h> | |
#import "Xcode3CommandLineBuildTool.h" | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
NSProcessInfo *processInfo = [NSProcessInfo processInfo]; | |
// Initialize the Xcode object that does actual work | |
Xcode3CommandLineBuildTool *buildTool = [Xcode3CommandLineBuildTool sharedCommandLineBuildTool]; | |
// Set name to be used in output | |
buildTool.name = [[processInfo.arguments firstObject] lastPathComponent]; | |
// Pass all commandline arguments, except for the path to binary | |
buildTool.arguments = [processInfo.arguments subarrayWithRange:NSMakeRange(1, processInfo.arguments.count-1)]; | |
// Use the same environment variables as the myxcodebuild binary | |
buildTool.environment = processInfo.environment; | |
// Use standard output & error for logging, ignore standard input | |
buildTool.standardError = [NSFileHandle fileHandleWithStandardError]; | |
buildTool.standardOutput = [NSFileHandle fileHandleWithStandardOutput]; | |
buildTool.standardInput = [NSFileHandle fileHandleWithNullDevice]; | |
// Run the command | |
[buildTool run]; | |
// Return exit code | |
return (int)buildTool.exitStatus; | |
} | |
} |
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
// Configuration settings file format documentation can be found at: | |
// https://help.apple.com/xcode/#/dev745c5c974 | |
FRAMEWORK_SEARCH_PATHS = $(inherited) /Applications/Xcode.app/Contents/Frameworks /Applications/Xcode.app/Contents/SharedFrameworks | |
LIBRARY_SEARCH_PATHS = $(inherited) /Applications/Xcode.app/Contents/PlugIns | |
LD_RUNPATH_SEARCH_PATHS = $(inherited) @executable_path /Applications/Xcode.app/Contents/Frameworks /Applications/Xcode.app/Contents/SharedFrameworks /Applications/Xcode.app/Contents/PlugIns |
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
#pragma once | |
@import Foundation; | |
@class Xcode3Project; | |
@class IDEWorkspace; | |
@class IDEXBSBuildParameters; | |
@class IDEScheme; | |
@class DVTMacroDefinitionTable; | |
@class DVTSourceControlWorkspaceBlueprint; | |
@class _TtC13IDEFoundation31IDEActivityLogEventStreamWriter; | |
@protocol IDEXBSXcodebuildSupportProvider; | |
@interface Xcode3CommandLineBuildTool : NSObject | |
@property int toolCommand; | |
@property (nonatomic) char shouldExit; | |
@property long long exitStatus; | |
@property (copy) NSString * projectName; | |
@property (retain) NSArray * targetNames; | |
@property (copy) NSString * workspaceName; | |
@property (copy) NSString * schemeName; | |
@property (copy) NSString * xcconfigPathFromOption; | |
@property (copy) NSString * xcconfigPathFromEnvVar; | |
@property (copy) NSString * actionResultsBundlePathWithBaselineOverridesFromOption; | |
@property (copy) NSString * automaticBaselineDescription; | |
@property (copy) NSString * nameOfFileToFind; | |
@property (copy) NSString * archivePath; | |
@property (copy) NSString * exportOptionsPlist; | |
@property (copy) NSString * exportDestinationPath; | |
@property (copy) NSString * buildMetricsPath; | |
@property (retain) NSArray * buildActions; | |
@property (retain) NSArray * potentialBuildActions; | |
@property (retain) NSArray * buildSettingAssignmentStrings; | |
@property (retain) Xcode3Project * project; | |
@property (retain) NSMutableArray * targets; | |
@property char allTargets; | |
@property (retain) IDEWorkspace * workspace; | |
@property (retain) NSMutableDictionary * perActionRunDestinations; | |
@property (copy) NSString * configurationName; | |
@property (retain) NSArray * architectures; | |
@property (copy) NSString * baseSdkName; | |
@property (retain) NSArray * toolchainNames; | |
@property (copy) NSArray * destinationSpecifications; | |
@property char skipUnsupportedDestinations; | |
@property (copy) NSNumber * destinationTimeout; | |
@property char parallelizeTargets; | |
@property char hideShellScriptEnvironment; | |
@property (copy) NSNumber * maxConcurrency; | |
@property (copy) NSNumber * maxDeviceTestConcurrency; | |
@property (copy) NSNumber * maxSimulatorTestConcurrency; | |
@property (retain) NSNumber * parallelTestingEnabledOverride; | |
@property (retain) NSNumber * parallelTestingWorkerCountOverride; | |
@property (retain) NSNumber * parallelTestingMaximumWorkerCount; | |
@property char dontActuallyRunCommands; | |
@property char skipUnavailableActions; | |
@property char quieterOutput; | |
@property (retain) NSString * localizationPath; | |
@property (retain) NSArray * exportLanguages; | |
@property (retain) NSString * codeCoverageEnabled; | |
@property (retain) NSString * localizableStringsDataEnabled; | |
@property (retain) NSString * addressSanitizerEnabled; | |
@property (retain) NSString * threadSanitizerEnabled; | |
@property (retain) NSString * UBSanitizerEnabled; | |
@property (retain) NSString * testRunSpecificationPathString; | |
@property (retain) NSArray * skipTestIdentifiers; | |
@property (retain) NSArray * onlyTestIdentifiers; | |
@property char runSkippedTestsOnly; | |
@property char disableConcurrentTesting; | |
@property (retain) NSMutableDictionary * testApplicationMappingOverrides; | |
@property (retain) NSString * testWithLanguage; | |
@property (retain) NSString * testWithRegion; | |
@property (retain) NSString * templateOutputPath; | |
@property (retain) NSString * templateTeamID; | |
@property (retain) NSString * templateName; | |
@property (retain) NSString * templatePlatform; | |
@property (retain) NSString * templateOptions; | |
@property (retain) NSDictionary * templateNonPermutedOptionValues; | |
@property (retain) NSArray * templateRequiredOptions; | |
@property (retain) NSString * clonedSourcePackagesDirPath; | |
@property char collectBuildTimeStatistics; | |
@property (retain) DVTMacroDefinitionTable * synthesizedMacros; | |
@property (retain) DVTMacroDefinitionTable * macrosFromCommandLine; | |
@property (retain) DVTMacroDefinitionTable * macrosFromXcconfigOption; | |
@property (retain) DVTMacroDefinitionTable * macrosFromXcconfigEnvVar; | |
@property (retain) NSMutableDictionary * userDefaults; | |
@property (retain) NSMutableDictionary * environmentUserDefaults; | |
@property (retain) NSOperationQueue * buildToolQueue; | |
@property (retain) NSString * resultBundlePath; | |
@property (copy) NSString * baseResultBundlePath; | |
@property (copy) NSString * sparseResultBundlePath; | |
@property (copy) NSString * extractOnlyTestIdentifier; | |
@property char outputAsJSON; | |
@property char readSourceControlBlueprint; | |
@property (retain) NSString * sourceControlSSHKeyPath; | |
@property (retain) DVTSourceControlWorkspaceBlueprint * sourceControlBlueprint; | |
@property char enableSourceControlKeychainAccess; | |
@property char disableSourceControlKeychainAccess; | |
@property (retain) _TtC13IDEFoundation31IDEActivityLogEventStreamWriter * activityLogStreamWriter; | |
@property (retain) IDEXBSBuildParameters * xbsBuildParameters; | |
@property (retain) NSObject<IDEXBSXcodebuildSupportProvider> * xbsXcodebuildSupportProvider; | |
@property char allowProvisioningUpdates; | |
@property char allowProvisioningDeviceRegistration; | |
@property (retain) IDEScheme * scheme; | |
@property (copy) NSString * name; | |
@property (copy) NSArray * arguments; | |
@property (copy) NSDictionary * environment; | |
@property (retain) NSFileHandle * standardInput; | |
@property (retain) NSFileHandle * standardOutput; | |
@property (retain) NSFileHandle * standardError; | |
@property (readonly) unsigned long long hash; | |
@property (readonly) Class superclass; | |
@property (readonly,copy) NSString * description; | |
@property (readonly,copy) NSString * debugDescription; | |
+ (char)useArchiveActionForInstall; | |
+ (char)enableInstallLocAction; | |
+ (id)timingLogAspect; | |
+ (id)xcodebuildDebugLogAspect; | |
+ (id)knownWorkspaceWrapperExtensions; | |
+ (id)filesInDirectory:(id)v1 withExtensions:(id)v2 errorString:(id *)v3; | |
+ (id)sharedCommandLineBuildTool; | |
- (id)init; | |
- (id)overridingProperties; | |
- (unsigned long long)_schemeLoadingTimeout; | |
- (unsigned long long)_projectLoadingTimeout; | |
- (void)_printWarningString:(id)v1; | |
- (void)_printErrorString:(id)v1 andFailWithCode:(long long)v2; | |
- (id)_supportedBuildActions; | |
- (id)_legacyBuildActionMapping; | |
- (id)_schemeCommandForBuildAction:(id)v1 outSchemeTask:(long long *)v2; | |
- (id)_actionStringForBuildAction:(id)v1; | |
- (void)_parseOptions; | |
- (id)_stringByResolvingSymlinksInPath:(id)v1; | |
- (id)_resolveSdk:(id)v1; | |
- (void)_resolveBaseSdk; | |
- (void)_resolveRunDestinationsForBuildAction:(id)v1; | |
- (id)_remainingUnavailableRunDestinationsAfterWaitingForDestinationsToBecomeAvailable:(id)v1; | |
- (id)_unavailableRunDestinationsInDestinations:(id)v1; | |
- (id)_availableDestinationsDescriptionForDestinations:(id)v1 scheme:(id)v2; | |
- (char)waitForRemoteSourcePackagesToFinishLoading; | |
- (void)_resolveInputOptionsWithTimingSection:(id)v1; | |
- (void)_workspace:(id)v1 failedToResolveContainerForProjectFile:(id)v2; | |
- (void)unableToOpenProjectAtPath:(id)v1 reason:(id)v2; | |
- (char)_shouldTestConcurrentlyForRunDestinations:(id)v1; | |
- (id)_concurrentTestOperations:(id)v1 schemeTask:(long long)v2 schemeCommand:(id)v3 executionEnvironment:(id)v4 invocationRecord:(id)v5 buildLog:(id)v6 restorePersistedBuildResults:(char)v7 deviceOperationLimit:(long long)v8 simulatorOperationLimit:(long long)v9 contextString:(id)v10 outError:(id *)v11; | |
- (void)_buildWithTimingSection:(id)v1; | |
- (void)_showBuildSettings; | |
- (void)_printVersionInfoAndExit; | |
- (id)schemeNamesInWorkspace:(id)v1; | |
- (void)_printContainerInformationAndExit; | |
- (id)_sdkForUseWithFind; | |
- (void)_printPathToExecutableAndExit; | |
- (void)_printPathToLibraryAndExit; | |
- (void)_enumerateAllPlatformsAlphabeticallyWithBlock:(void (^ /* unknown block signature */)(void))v1; | |
- (void)_writeJSONObjectTo:(id)v1 jsonObject:(id)v2; | |
- (id)_getJSONDataForSDK:(id)v1 platform:(id)v2; | |
- (char)_writeSDKListAsJSONTo:(id)v1; | |
- (void)_printShortSDKListAndExit; | |
- (void)_printDestinationListAndExit; | |
- (void)_printVerboseInfoForSDK:(id)v1 keysToEmit:(id)v2; | |
- (void)_printVerboseSDKListAndExit; | |
- (id)_availableExportArchiveOptionsSection; | |
- (void)_exportNotarizedAppAndExit; | |
- (void)_distributeArchiveAndExit; | |
- (void)_exportLocalizationsAndExit; | |
- (void)_importLocalizationsAndExit; | |
- (void)_resolvePackageDependenciesAndExit; | |
- (void)_saveProject; | |
- (void)_permuteTemplatesAndExit; | |
- (void)_createNewProjectAndExit; | |
- (void)_extractSparseResultBundle; | |
- (char)_shouldUseBuildMetricsFeature; | |
- (void)run; | |
- (long long)_buildLogVerbosity; | |
@end |
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
#pragma once | |
#import <Foundation/Foundation.h> | |
@interface Xcode3CommandLineBuildTool : NSObject | |
@property long long exitStatus; | |
@property (copy) NSString * name; | |
@property (copy) NSArray * arguments; | |
@property (copy) NSDictionary * environment; | |
@property (retain) NSFileHandle * standardInput; | |
@property (retain) NSFileHandle * standardOutput; | |
@property (retain) NSFileHandle * standardError; | |
+ (id)sharedCommandLineBuildTool; | |
- (void)run; | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment