Skip to content

Commit 0f4ff73

Browse files
Merge pull request #86 from vineetchoudhary/development
Development
2 parents 7eed5df + 0e0aacf commit 0f4ff73

File tree

5 files changed

+76
-23
lines changed

5 files changed

+76
-23
lines changed

AppBox/Commands/ProjectBuildScript.sh

Lines changed: 50 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,66 @@
77
# Copyright © 2016 Developer Insider. All rights reserved.
88

99
#{1} - Project Directory
10-
cd "${1}"
11-
12-
if [[ "${2}" == *"xcodeproj" ]]
13-
then
1410

1511
#Make Archove
1612
#{2} - -workspace VisualStudioMobileCenterDemo.xcworkspace or -project -vsmcd.xcodeproj
1713
#{3} - VisualStudioMobileCenterDemo
1814
#{4} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive
1915

20-
echo "Building Project..."
21-
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}"
22-
23-
else
24-
25-
echo "Building Workspace..."
26-
xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}"
27-
28-
fi
29-
3016

3117
#Make IPA
3218
#{5} - "/Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive"
3319
#{6} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/
3420
#{7} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/exportoption.plist
3521

22+
23+
#change directory to project
24+
cd "${1}"
25+
26+
################################################
27+
# Make Archive #
28+
################################################
29+
30+
#check either project is Xcode Project or Xcode Workspace
31+
if [[ "${2}" == *"xcodeproj" ]]
32+
then
33+
echo "Building Project..."
34+
35+
#check either selected xcode is 9 or higher
36+
if [[ "${7}" > "9" || "${7}" == "9" ]]
37+
then
38+
echo "Building Project with Xcode 9"
39+
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration
40+
else
41+
echo "Building Project with Xcode 8"
42+
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}"
43+
fi
44+
45+
else
46+
echo "Building Workspace..."
47+
48+
#check either selected xcode is 9 or higher
49+
if [[ "${7}" > "9" || "${7}" == "9" ]]
50+
then
51+
echo "Building Project with Xcode 9"
52+
xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}"
53+
else
54+
echo "Building Project with Xcode 8"
55+
xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}"
56+
fi
57+
58+
fi
59+
60+
####################################
61+
# Make IPA #
62+
####################################
3663
echo "Creating IPA..."
37-
xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}"
64+
#check either selected xcode is 9 or higher
65+
if [[ "${7}" > "9" || "${7}" == "9" ]]
66+
then
67+
echo "Creatomg IPA with Xcode 9"
68+
xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration
69+
else
70+
echo "Creatomg IPA with Xcode 8"
71+
xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}"
72+
fi

AppBox/Common/UploadManager/UploadManager.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ +(void)setupDBClientsManager{
2424
#pragma mark - UnZip IPA File
2525

2626
-(void)uploadIPAFile:(NSURL *)ipaFileURL{
27+
[[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"\n\n======\n Preparing to Upload IPA - %@\n======\n\n",ipaFileURL]];
2728
NSString *ipaPath = [ipaFileURL.resourceSpecifier stringByRemovingPercentEncoding];
2829
if ([[NSFileManager defaultManager] fileExistsAtPath:ipaPath]) {
2930
[[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"\n\n======\nUploading IPA - %@\n======\n\n",ipaPath]];

AppBox/Info.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<key>CFBundlePackageType</key>
1818
<string>APPL</string>
1919
<key>CFBundleShortVersionString</key>
20-
<string>2.1.0</string>
20+
<string>2.1.1</string>
2121
<key>CFBundleSignature</key>
2222
<string>????</string>
2323
<key>CFBundleURLTypes</key>

AppBox/Model/ProjectModel/XCProject.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ - (BOOL)createExportOptionPlist{
6969
[exportOption setValue:[NSNumber numberWithBool:[UserData uploadBitcode]] forKey:@"uploadBitcode"];
7070
[exportOption setValue:[NSNumber numberWithBool:[UserData uploadSymbols]] forKey:@"uploadSymbols"];
7171
[exportOption setValue:[NSNumber numberWithBool:[UserData compileBitcode]] forKey:@"compileBitcode"];
72+
[exportOption setValue:@"automatic" forKey:@"signingStyle"];
7273
return [exportOption writeToFile:[self.exportOptionsPlistPath.resourceSpecifier stringByRemovingPercentEncoding] atomically:YES];
7374
}
7475

AppBox/ViewController/HomeViewController/HomeViewController.m

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,6 @@ - (void)viewDidLoad {
6363
[UserData setXCodeLocation:xcodePath];
6464
[UserData setApplicationLoaderLocation:applicationLoaderPath];
6565
}];
66-
67-
//Get Xcode Version
68-
[XCHandler getXcodeVersionWithCompletion:^(BOOL success, XcodeVersion version, NSString *versionString) {
69-
70-
}];
7166
}
7267

7368
- (void)viewWillAppear{
@@ -317,8 +312,25 @@ - (void)runBuildScript{
317312
//${6} export options plist Location
318313
[buildArgument addObject:[project.exportOptionsPlistPath.resourceSpecifier stringByRemovingPercentEncoding]];
319314

320-
//Run Task
321-
[self runTaskWithLaunchPath:buildScriptPath andArgument:buildArgument];
315+
316+
//Get Xcode Version
317+
[XCHandler getXcodeVersionWithCompletion:^(BOOL success, XcodeVersion version, NSString *versionString) {
318+
//${7} xcode version
319+
dispatch_async(dispatch_get_main_queue(), ^{
320+
NSString *version;
321+
if (success) {
322+
version = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:[versionString integerValue]]];
323+
} else {
324+
version = @"8";
325+
}
326+
[buildArgument addObject:version];
327+
328+
//Run Task
329+
[self runTaskWithLaunchPath:buildScriptPath andArgument:buildArgument];
330+
});
331+
332+
}];
333+
322334
}
323335

324336
- (void)runXcodePathScript{
@@ -402,6 +414,7 @@ - (void)captureStandardOutputWithTask:(NSTask *)task{
402414
[comboTeamId addItemWithObjectValue:project.teamId];
403415
[comboTeamId selectItemWithObjectValue:project.teamId];
404416
[comboBuildType selectItemWithObjectValue:project.buildType];
417+
[comboBuildScheme selectItemWithObjectValue:project.selectedSchemes];
405418
[textFieldEmail setStringValue:project.emails];
406419
[textFieldMessage setStringValue:project.personalMessage];
407420
if (project.emails.length > 0){
@@ -570,7 +583,9 @@ -(void)appStoreScriptOutputHandlerWithOutput:(NSString *)output{
570583
#pragma mark - Get IPA Info and Upload -
571584

572585
-(void)checkIPACreated{
586+
[self showStatus:@"Checking IPA File..." andShowProgressBar:YES withProgress:-1];
573587
NSString *ipaPath = [project.ipaFullPath.resourceSpecifier stringByRemovingPercentEncoding];
588+
[[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Finding IPA file at path - %@", ipaPath]];
574589
if ([[NSFileManager defaultManager] fileExistsAtPath:ipaPath]){
575590
if ([comboBuildType.stringValue isEqualToString: BuildTypeAppStore]){
576591
//get required info and upload to appstore
@@ -580,6 +595,7 @@ -(void)checkIPACreated{
580595
[uploadManager uploadIPAFile:project.ipaFullPath];
581596
}
582597
}else{
598+
[[AppDelegate appDelegate] addSessionLog:[NSString stringWithFormat:@"Not able to find IPA file at path - %@", ipaPath]];
583599
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
584600
[self checkIPACreated];
585601
});

0 commit comments

Comments
 (0)