Skip to content

Commit

Permalink
Merge pull request #93 from vineetchoudhary/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
vineetchoudhary authored Jan 18, 2018
2 parents 90fd5b5 + 55bb58a commit df702ac
Show file tree
Hide file tree
Showing 17 changed files with 187 additions and 72 deletions.
4 changes: 4 additions & 0 deletions AppBox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
E13161F21E9777DF00586052 /* RepoBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = E13161F11E9777DF00586052 /* RepoBuilder.m */; };
E13946121DF2AFCF00B3FAD0 /* XCProject.m in Sources */ = {isa = PBXBuildFile; fileRef = E13946111DF2AFCF00B3FAD0 /* XCProject.m */; };
E13946161DF2FBAD00B3FAD0 /* ProjectBuildScript.sh in Resources */ = {isa = PBXBuildFile; fileRef = E13946141DF2FBAD00B3FAD0 /* ProjectBuildScript.sh */; };
E14237C22010A6F600F83501 /* CreateIPAScript.sh in Resources */ = {isa = PBXBuildFile; fileRef = E14237C12010A16300F83501 /* CreateIPAScript.sh */; };
E143637B1DF59AFD00FB10CA /* LogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E143637A1DF59AFD00FB10CA /* LogViewController.m */; };
E14A441F1F277590006A9102 /* XCArchiveResult.m in Sources */ = {isa = PBXBuildFile; fileRef = E14A441E1F277590006A9102 /* XCArchiveResult.m */; };
E14A44221F2775A2006A9102 /* XCArchiveParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E14A44211F2775A2006A9102 /* XCArchiveParser.m */; };
Expand Down Expand Up @@ -281,6 +282,7 @@
E13946111DF2AFCF00B3FAD0 /* XCProject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCProject.m; sourceTree = "<group>"; };
E13946131DF2AFFF00B3FAD0 /* AppBoxPrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppBoxPrefixHeader.pch; sourceTree = "<group>"; };
E13946141DF2FBAD00B3FAD0 /* ProjectBuildScript.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ProjectBuildScript.sh; sourceTree = "<group>"; };
E14237C12010A16300F83501 /* CreateIPAScript.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = CreateIPAScript.sh; sourceTree = "<group>"; };
E14363791DF59AFD00FB10CA /* LogViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogViewController.h; sourceTree = "<group>"; };
E143637A1DF59AFD00FB10CA /* LogViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LogViewController.m; sourceTree = "<group>"; };
E14A441D1F277590006A9102 /* XCArchiveResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCArchiveResult.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -906,6 +908,7 @@
E172E13B1DEEB3B900405EF2 /* GetSchemeScript.sh */,
E10B82211DF0498600BBE0CD /* TeamIDScript.sh */,
E13946141DF2FBAD00B3FAD0 /* ProjectBuildScript.sh */,
E14237C12010A16300F83501 /* CreateIPAScript.sh */,
E191F7C21E1E7B2A00D2A590 /* ALAppStore.sh */,
E119EF5F1E3735EA00A7798E /* XCodePath.sh */,
E1C024721E9B9DC700C87CC9 /* InstallPrivateKey.sh */,
Expand Down Expand Up @@ -1236,6 +1239,7 @@
E119EF601E373C9B00A7798E /* ALAppStore.sh in Resources */,
E1C024731E9B9DD500C87CC9 /* InstallPrivateKey.sh in Resources */,
E1D12EEA1EC2F5230065E59A /* EmailPreferencesViewController.xib in Resources */,
E14237C22010A6F600F83501 /* CreateIPAScript.sh in Resources */,
DBCD1563200BCD1C00C003E6 /* PreferencesViewController.xib in Resources */,
E10B82221DF0498800BBE0CD /* TeamIDScript.sh in Resources */,
E16D72E51E8912790031FB7C /* XCodePath.sh in Resources */,
Expand Down
6 changes: 4 additions & 2 deletions AppBox/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
//Check for update
[UpdateHandler isNewVersionAvailableCompletion:^(bool available, NSURL *url) {
if (available){
[UpdateHandler showUpdateAlertWithUpdateURL:url];
if (![UserData updateAlertEnable]){
[UpdateHandler showUpdateAlertWithUpdateURL:url];
}
}
}];

Expand Down Expand Up @@ -81,7 +83,7 @@ +(AppDelegate *)appDelegate{

-(void)addSessionLog:(NSString *)sessionLog{
NSLog(@"%@",sessionLog);
[_sessionLog appendFormat: @"%@",sessionLog];
[_sessionLog appendFormat: @"%@\n",sessionLog];
[[NSNotificationCenter defaultCenter] postNotificationName:abSessionLogUpdated object:nil];
}

Expand Down
Binary file modified AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions AppBox/Commands/CreateIPAScript.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/sh

# CreateIPAScript.sh
# AppBox
#
# Created by Vineet Choudhary on 18/01/18.
# Copyright © 2018 Developer Insider. All rights reserved.

#{1} - Project Directory

#Make Archove
#{2} - Project Workspace or XcodeProject -workspace VisualStudioMobileCenterDemo.xcworkspace or -project -vsmcd.xcodeproj
#{3} - Project Scheme - VisualStudioMobileCenterDemo
#{4} - Project Archive Path - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive


#Make IPA
#{4} - Project Archive Path - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive
#{5} - IPA Export Path - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/
#{6} - IPA Export options plist - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/exportoption.plist


#Others
#{7} - Xcode Version
#{8} - xcpretty path


#change directory to project
cd "${1}"

####################################
# Make IPA #
####################################
echo "Creating IPA..."

#check either selected xcode is 9 or higher
if [[ "${7}" > "9" || "${7}" == "9" ]]
then
echo "Creating IPA with Xcode 9"
xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration
else
echo "Creating IPA with Xcode 8"
xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}"
fi
echo "End of build script."
22 changes: 4 additions & 18 deletions AppBox/Commands/ProjectBuildScript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ then
if [[ "${7}" > "9" || "${7}" == "9" ]]
then
echo "Building Project with Xcode 9"
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | ${8} && exit ${PIPESTATUS[0]}
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | "${8}" && exit ${PIPESTATUS[0]}
else
echo "Building Project with Xcode 8"
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" | ${8} && exit ${PIPESTATUS[0]}
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" | "${8}" && exit ${PIPESTATUS[0]}
fi

else
Expand All @@ -54,24 +54,10 @@ else
if [[ "${7}" > "9" || "${7}" == "9" ]]
then
echo "Building Project with Xcode 9"
xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | ${8} && exit ${PIPESTATUS[0]}
xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | "${8}" && exit ${PIPESTATUS[0]}
else
echo "Building Project with Xcode 8"
xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" | ${8} && exit ${PIPESTATUS[0]}
xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" | "${8}" && exit ${PIPESTATUS[0]}
fi

fi

####################################
# Make IPA #
####################################
echo "Creating IPA..."
#check either selected xcode is 9 or higher
if [[ "${7}" > "9" || "${7}" == "9" ]]
then
echo "Creating IPA with Xcode 9"
xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration
else
echo "Creating IPA with Xcode 8"
xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}"
fi
1 change: 1 addition & 0 deletions AppBox/Common/Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ typedef enum : NSUInteger {
ScriptTypeGetScheme,
ScriptTypeTeamId,
ScriptTypeBuild,
ScriptTypeCreateIPA,
ScriptTypeXcodePath,
ScriptTypeAppStoreValidation,
ScriptTypeAppStoreUpload,
Expand Down
2 changes: 1 addition & 1 deletion AppBox/Common/LogManager/ABLog.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@implementation ABLog

+(void)log:(NSString *)format, ...{
if ([UserData debugLog]) {
if (![UserData debugLog]) {
va_list args;
va_start(args, format);
NSLogv(format, args);
Expand Down
2 changes: 1 addition & 1 deletion AppBox/Common/UpdateHandler/UpdateHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ + (void)isNewVersionAvailableCompletion:(void (^)(bool available, NSURL *url))co
NSString *currentVersion = [[versionString componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:abEmptyString];

//log current and latest version
[ABLog log:@"Current Version - %@ <=> Latest Version - %@", versionString, tag];
[ABLog log:@"\n\nCurrent Version - %@ <=> Latest Version - %@\n\n", versionString, tag];

//return result based on version strings
completion(([newVesion compare:currentVersion] == NSOrderedDescending),[NSURL URLWithString:[responseObj valueForKey:@"html_url"]]);
Expand Down
6 changes: 3 additions & 3 deletions AppBox/Common/UploadManager/UploadManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ -(void)uploadIPAFile:(NSURL *)ipaFileURL{
}


if ([AppDelegate appDelegate].isInternetConnected){
[self showStatus:@"Ready to upload..." andShowProgressBar:NO withProgress:-1];
}else{
if (![AppDelegate appDelegate].isInternetConnected){
[self showStatus:abNotConnectedToInternet andShowProgressBar:YES withProgress:-1];
}

Expand Down Expand Up @@ -403,6 +401,8 @@ -(void)updateProgressBytesWritten:(int64_t)bytesWritten totalBytesWritten:(int64


-(void)dbUploadFile:(NSString *)file to:(NSString *)path mode:(DBFILESWriteMode *)mode{
[[AppDelegate appDelegate] addSessionLog:@"Uploading IPA File..."];

//Upload large ipa file with dropbox session api
if (_project.ipaFileSize.integerValue > 150 && self.dbFileType == DBFileTypeIPA) {
[self dbUploadLargeFile:file to:path mode:mode];
Expand Down
2 changes: 2 additions & 0 deletions AppBox/Common/UserData/UserData.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@

+(BOOL)debugLog;
+(void)setEnableDebugLog:(BOOL)debugLog;
+(BOOL)updateAlertEnable;
+(void)setUpdateAlertEnable:(BOOL)updateAlert;

@end
13 changes: 12 additions & 1 deletion AppBox/Common/UserData/UserData.m
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,24 @@ +(void)setUploadChunkSize:(NSInteger)chunkSize{
[[NSUserDefaults standardUserDefaults] synchronize];
}

#pragma mark - CI Settings -
#define DebugLogEnable @"DebugLogEnable"
+(BOOL)debugLog{
return [[NSUserDefaults standardUserDefaults] boolForKey:DebugLogEnable];
}

+(void)setEnableDebugLog:(BOOL)debugLog{
[[NSUserDefaults standardUserDefaults] boolForKey:DebugLogEnable];
[[NSUserDefaults standardUserDefaults] setBool:debugLog forKey:DebugLogEnable];
[[NSUserDefaults standardUserDefaults] synchronize];
}

#define UpdateAlertEnable @"UpdateAlertEnable"
+(BOOL)updateAlertEnable{
return [[NSUserDefaults standardUserDefaults] boolForKey:UpdateAlertEnable];
}

+(void)setUpdateAlertEnable:(BOOL)updateAlert{
[[NSUserDefaults standardUserDefaults] setBool:updateAlert forKey:UpdateAlertEnable];
[[NSUserDefaults standardUserDefaults] synchronize];
}

Expand Down
2 changes: 1 addition & 1 deletion AppBox/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.2.0</string>
<string>2.3.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
Expand Down
Loading

0 comments on commit df702ac

Please sign in to comment.