diff --git a/AppBox/Commands/ProjectBuildScript.sh b/AppBox/Commands/ProjectBuildScript.sh index 66c5e26d..63cb929c 100755 --- a/AppBox/Commands/ProjectBuildScript.sh +++ b/AppBox/Commands/ProjectBuildScript.sh @@ -7,31 +7,66 @@ # Copyright © 2016 Developer Insider. All rights reserved. #{1} - Project Directory -cd "${1}" - -if [[ "${2}" == *"xcodeproj" ]] -then #Make Archove #{2} - -workspace VisualStudioMobileCenterDemo.xcworkspace or -project -vsmcd.xcodeproj #{3} - VisualStudioMobileCenterDemo #{4} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive -echo "Building Project..." -xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" - -else - -echo "Building Workspace..." -xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" - -fi - #Make IPA #{5} - "/Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive" #{6} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/ #{7} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/exportoption.plist + +#change directory to project +cd "${1}" + +################################################ +# Make Archive # +################################################ + +#check either project is Xcode Project or Xcode Workspace +if [[ "${2}" == *"xcodeproj" ]] +then + echo "Building Project..." + + #check either selected xcode is 9 or higher + if [[ "${7}" > "9" || "${7}" == "9" ]] + then + echo "Building Project with Xcode 9" + xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration + else + echo "Building Project with Xcode 8" + xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" + fi + +else + echo "Building Workspace..." + + #check either selected xcode is 9 or higher + if [[ "${7}" > "9" || "${7}" == "9" ]] + then + echo "Building Project with Xcode 9" + xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" + else + echo "Building Project with Xcode 8" + xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" + fi + +fi + +#################################### +# Make IPA # +#################################### echo "Creating IPA..." -xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" +#check either selected xcode is 9 or higher +if [[ "${7}" > "9" || "${7}" == "9" ]] +then + echo "Creatomg IPA with Xcode 9" + xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration +else + echo "Creatomg IPA with Xcode 8" + xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" +fi diff --git a/AppBox/Common/UploadManager/UploadManager.m b/AppBox/Common/UploadManager/UploadManager.m index 633deccb..5ef691bb 100644 --- a/AppBox/Common/UploadManager/UploadManager.m +++ b/AppBox/Common/UploadManager/UploadManager.m @@ -24,6 +24,7 @@ +(void)setupDBClientsManager{ #pragma mark - UnZip IPA File -(void)uploadIPAFile:(NSURL *)ipaFileURL{ + [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"\n\n======\n Preparing to Upload IPA - %@\n======\n\n",ipaFileURL]]; NSString *ipaPath = [ipaFileURL.resourceSpecifier stringByRemovingPercentEncoding]; if ([[NSFileManager defaultManager] fileExistsAtPath:ipaPath]) { [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"\n\n======\nUploading IPA - %@\n======\n\n",ipaPath]]; diff --git a/AppBox/Info.plist b/AppBox/Info.plist index 8917c101..3e8b4887 100644 --- a/AppBox/Info.plist +++ b/AppBox/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.1.0 + 2.1.1 CFBundleSignature ???? CFBundleURLTypes diff --git a/AppBox/Model/ProjectModel/XCProject.m b/AppBox/Model/ProjectModel/XCProject.m index fdbd01f4..5c64f547 100644 --- a/AppBox/Model/ProjectModel/XCProject.m +++ b/AppBox/Model/ProjectModel/XCProject.m @@ -69,6 +69,7 @@ - (BOOL)createExportOptionPlist{ [exportOption setValue:[NSNumber numberWithBool:[UserData uploadBitcode]] forKey:@"uploadBitcode"]; [exportOption setValue:[NSNumber numberWithBool:[UserData uploadSymbols]] forKey:@"uploadSymbols"]; [exportOption setValue:[NSNumber numberWithBool:[UserData compileBitcode]] forKey:@"compileBitcode"]; + [exportOption setValue:@"automatic" forKey:@"signingStyle"]; return [exportOption writeToFile:[self.exportOptionsPlistPath.resourceSpecifier stringByRemovingPercentEncoding] atomically:YES]; } diff --git a/AppBox/ViewController/HomeViewController/HomeViewController.m b/AppBox/ViewController/HomeViewController/HomeViewController.m index f79db2fc..8b763e65 100644 --- a/AppBox/ViewController/HomeViewController/HomeViewController.m +++ b/AppBox/ViewController/HomeViewController/HomeViewController.m @@ -63,11 +63,6 @@ - (void)viewDidLoad { [UserData setXCodeLocation:xcodePath]; [UserData setApplicationLoaderLocation:applicationLoaderPath]; }]; - - //Get Xcode Version - [XCHandler getXcodeVersionWithCompletion:^(BOOL success, XcodeVersion version, NSString *versionString) { - - }]; } - (void)viewWillAppear{ @@ -317,8 +312,25 @@ - (void)runBuildScript{ //${6} export options plist Location [buildArgument addObject:[project.exportOptionsPlistPath.resourceSpecifier stringByRemovingPercentEncoding]]; - //Run Task - [self runTaskWithLaunchPath:buildScriptPath andArgument:buildArgument]; + + //Get Xcode Version + [XCHandler getXcodeVersionWithCompletion:^(BOOL success, XcodeVersion version, NSString *versionString) { + //${7} xcode version + dispatch_async(dispatch_get_main_queue(), ^{ + NSString *version; + if (success) { + version = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:[versionString integerValue]]]; + } else { + version = @"8"; + } + [buildArgument addObject:version]; + + //Run Task + [self runTaskWithLaunchPath:buildScriptPath andArgument:buildArgument]; + }); + + }]; + } - (void)runXcodePathScript{ @@ -402,6 +414,7 @@ - (void)captureStandardOutputWithTask:(NSTask *)task{ [comboTeamId addItemWithObjectValue:project.teamId]; [comboTeamId selectItemWithObjectValue:project.teamId]; [comboBuildType selectItemWithObjectValue:project.buildType]; + [comboBuildScheme selectItemWithObjectValue:project.selectedSchemes]; [textFieldEmail setStringValue:project.emails]; [textFieldMessage setStringValue:project.personalMessage]; if (project.emails.length > 0){ @@ -570,7 +583,9 @@ -(void)appStoreScriptOutputHandlerWithOutput:(NSString *)output{ #pragma mark - Get IPA Info and Upload - -(void)checkIPACreated{ + [self showStatus:@"Checking IPA File..." andShowProgressBar:YES withProgress:-1]; NSString *ipaPath = [project.ipaFullPath.resourceSpecifier stringByRemovingPercentEncoding]; + [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Finding IPA file at path - %@", ipaPath]]; if ([[NSFileManager defaultManager] fileExistsAtPath:ipaPath]){ if ([comboBuildType.stringValue isEqualToString: BuildTypeAppStore]){ //get required info and upload to appstore @@ -580,6 +595,7 @@ -(void)checkIPACreated{ [uploadManager uploadIPAFile:project.ipaFullPath]; } }else{ + [[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Not able to find IPA file at path - %@", ipaPath]]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [self checkIPACreated]; });