Skip to content

Commit

Permalink
Merge pull request #92 from vineetchoudhary/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
vineetchoudhary authored Jan 17, 2018
2 parents 1998204 + db4e42d commit b941618
Show file tree
Hide file tree
Showing 43 changed files with 2,225 additions and 171 deletions.
207 changes: 178 additions & 29 deletions AppBox.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions AppBox/AppBoxPrefixHeader.pch
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#import <ObjectiveDropboxOfficial/ObjectiveDropboxOfficial.h>

#import "Tiny.h"
#import "ABLog.h"
#import "GooglURLShortenerService.h"
#import "MBProgressHUD+ProgressHud.h"

Expand Down
10 changes: 5 additions & 5 deletions AppBox/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,20 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {

//Check for arguments
NSArray *arguments = [[NSProcessInfo processInfo] arguments];
[self addSessionLog:[NSString stringWithFormat:@"All Arguments = %@",arguments]];
[ABLog log:@"All Command Line Arguments = %@",arguments];
for (NSString *argument in arguments) {
if ([argument containsString:@"build="]) {
NSArray *components = [argument componentsSeparatedByString:@"build="];
[self addSessionLog:[NSString stringWithFormat:@"Path Components = %@",components]];
[ABLog log:@"Path Components = %@",components];
if (components.count == 2) {
[self handleProjectAtPath:[components lastObject]];
} else {
[self addSessionLog:[NSString stringWithFormat:@"Invalid command %@",arguments]];
[ABLog log:@"Invalid command %@",arguments];
exit(abExitCodeForUnstableBuild);
}
break;
} else if ([arguments indexOfObject:argument] == arguments.count - 1){
[self addSessionLog:[NSString stringWithFormat:@"Normal Run"]];
[ABLog log:@"Normal Run"];
}
}

Expand All @@ -80,8 +80,8 @@ +(AppDelegate *)appDelegate{
}

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

Expand Down
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.
22 changes: 22 additions & 0 deletions AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "[email protected]",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
25 changes: 15 additions & 10 deletions AppBox/Commands/ProjectBuildScript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@
#{1} - Project Directory

#Make Archove
#{2} - -workspace VisualStudioMobileCenterDemo.xcworkspace or -project -vsmcd.xcodeproj
#{3} - VisualStudioMobileCenterDemo
#{4} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive
#{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
#{5} - "/Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive"
#{6} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/
#{7} - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/exportoption.plist
#{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
Expand All @@ -36,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
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}"
xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" | ${8} && exit ${PIPESTATUS[0]}
fi

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

fi
Expand Down
90 changes: 90 additions & 0 deletions AppBox/Commands/xcpretty/bin/xcpretty
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
#!/usr/bin/env ruby

if RUBY_VERSION < '2.0.0'
abort "error: XCPretty requires Ruby 2.0.0 or higher."
end

if $PROGRAM_NAME == __FILE__
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
end
require 'xcpretty'
require 'optparse'

report_options = []
report_classes = []
report_formats = {
"junit" => XCPretty::JUnit,
"html" => XCPretty::HTML,
"json-compilation-database" => XCPretty::JSONCompilationDatabase
}

printer_opts = {
unicode: XCPretty::Term.unicode?,
colorize: XCPretty::Term.color?,
formatter: XCPretty::Simple
}

OptionParser.new do |opts|
opts.banner = "Usage: xcodebuild [options] | xcpretty"
opts.on('-t', '--test', 'Use RSpec style output') do
printer_opts[:formatter] = XCPretty::RSpec
end
opts.on('-s', '--simple', 'Use simple output (default)') do
printer_opts[:formatter] = XCPretty::Simple
end
opts.on('-k', '--knock', 'Use knock output') do
printer_opts[:formatter] = XCPretty::Knock
end
opts.on('--tap', 'Use TAP output') do
printer_opts[:formatter] = XCPretty::TestAnything
end
opts.on('-f', '--formatter PATH', 'Use formatter returned from evaluating the specified Ruby file') do |path|
printer_opts[:formatter] = XCPretty.load_custom_class(path)
end
opts.on('-c', '--[no-]color', 'Use colorized output. Default is auto') do |value|
printer_opts[:colorize] = value
end
opts.on('--[no-]utf', 'Use unicode characters in output. Default is auto.') do |value|
printer_opts[:unicode] = value
end
opts.on("-r", "--report FORMAT or PATH", "Run FORMAT or PATH reporter",
" Choices: #{report_formats.keys.join(', ')}") do |format|
if report_formats.key?(format)
report_classes << report_formats[format]
else
report_classes << XCPretty.load_custom_class(format)
end
report_options << {}
end
opts.on('-o', '--output PATH', 'Write report output to PATH') do |path|
unless opts = report_options.last
XCPretty.exit_with_error('Expected report format to be specified before output path')
end
opts[:path] = path
end
opts.on('--screenshots', 'Collect screenshots in the HTML report') do
unless opts = report_options.last
XCPretty.exit_with_error('Expected screenshot argument to be specified after report format')
end
opts[:screenshots] = true
end
opts.on_tail('-h', '--help', 'Show this message') { puts opts; exit }
opts.on_tail("-v", "--version", "Show version") { puts XCPretty::VERSION; exit }
opts.parse!

if STDIN.tty?
XCPretty.exit_with_error(opts.help)
end
end

printer = XCPretty::Printer.new(printer_opts)
reporters = report_classes.compact.each_with_index.map { |k, i| k.new(report_options[i]) }

STDIN.each_line do |line|
printer.pretty_print(line)
reporters.each { |r| r.handle(line) }
end

printer.finish
reporters.each(&:finish)

38 changes: 38 additions & 0 deletions AppBox/Commands/xcpretty/lib/xcpretty.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
require 'xcpretty/version'
require 'xcpretty/printer'
require 'xcpretty/syntax'
require 'xcpretty/snippet'
require 'xcpretty/term'
require 'xcpretty/formatters/formatter'
require 'xcpretty/formatters/simple'
require 'xcpretty/formatters/rspec'
require 'xcpretty/formatters/knock'
require 'xcpretty/formatters/tap'
require 'xcpretty/reporters/reporter'
require 'xcpretty/reporters/junit'
require 'xcpretty/reporters/html'
require 'xcpretty/reporters/json_compilation_database'

module XCPretty

def self.class_from_path(path)
source = File.read(path)
klass = eval(source, nil, path)
raise unless klass.is_a?(Class)
klass
end

def self.load_custom_class(path)
$LOAD_PATH.unshift File.dirname(path)
class_from_path(path)
rescue SyntaxError => e
exit_with_error("Expected custom source file to return a class. #{e}")
end

def self.exit_with_error(message)
$stderr.puts "[!] #{message}"
exit 1
end

end

72 changes: 72 additions & 0 deletions AppBox/Commands/xcpretty/lib/xcpretty/ansi.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
module XCPretty
module ANSI

attr_accessor :colorize

FORMATTED_MATCHER = %r{\e\[(\d+)[;]?(\d+)?m(.*)\e\[0m}

EFFECT = {
reset: '0',
bold: '1',
underline: '4'
}

COLORS = {
black: '30',
red: '31',
green: '32',
yellow: '33',
blue: '34',
cyan: '36',
white: '37',
plain: '39'
}

def colorize?
!!@colorize
end

def white(text)
ansi_parse(text, :plain, :bold)
end

def red(text)
ansi_parse(text, :red)
end

def green(text)
ansi_parse(text, :green, :bold)
end

def cyan(text)
ansi_parse(text, :cyan)
end

def yellow(text)
ansi_parse(text, :yellow)
end

def applied_effects(text)
effects = []
if text =~ FORMATTED_MATCHER
colors = COLORS.invert[$1]
effect = EFFECT.invert[$2]
effects << colors if colors
effects << effect if effect
end
effects
end

def strip(text)
text =~ FORMATTED_MATCHER ? $3 : text
end

def ansi_parse(text, color, effect=nil)
return text unless colorize?
colors_code = COLORS[color] || ''
effect_code = EFFECT[effect] ? ';' + EFFECT[effect] : ''
"\e[#{colors_code}#{effect_code}m#{text}\e[#{EFFECT[:reset]}m"
end
end
end

Loading

0 comments on commit b941618

Please sign in to comment.