1111product = "%s.app" % (app ,)
1212label = "dev"
1313base_version = "0.15"
14+ signing_key = "Developer ID Application: Rowan James"
1415
1516artifact_prefix = "%s-%s" % (app , label )
1617workspace = "%s.xcodeproj/project.xcworkspace" % (app ,)
@@ -41,6 +42,7 @@ def release():
4142
4243 build_config (release_configuration )
4344
45+ build_dir = os .path .join (build_base_dir , release_configuration )
4446 built_product = os .path .join (build_dir , product )
4547 sign_app (built_product )
4648
@@ -53,7 +55,6 @@ def release():
5355
5456def debug ():
5557 try :
56- build_dir = os .path .join
5758 build_config (debug_configuration )
5859
5960 except BuildError as e :
@@ -68,12 +69,12 @@ def build(configuration):
6869 release ()
6970
7071def assert_clean ():
71- status = subprocess . check_output (["git" , "status" , "--porcelain" ])
72+ status = check_string_output (["git" , "status" , "--porcelain" ])
7273 if len (status ):
7374 raise BuildError ("Working copy must be clean" )
7475
7576def assert_branch (branch = "master" ):
76- ref = subprocess . check_output (["git" , "rev-parse" , "--abbrev-ref" , "HEAD" ]). strip ( )
77+ ref = check_string_output (["git" , "rev-parse" , "--abbrev-ref" , "HEAD" ])
7778 if ref != branch :
7879 raise BuildError ("HEAD must be %s, but is %s" % (branch , ref ))
7980
@@ -86,12 +87,12 @@ def clean_config(config):
8687 xcodebuild (app , workspace , config , ["clean" ], build_dir )
8788
8889def commit_count ():
89- count = subprocess . check_output (["git" , "rev-list" , "HEAD" , "--count" ])
90+ count = check_string_output (["git" , "rev-list" , "HEAD" , "--count" ])
9091 return count
9192
9293def set_versions (base_version , build_number , label ):
93- print (subprocess . check_output (["agvtool" , "mvers" , "-terse1" ]))
94- print (subprocess . check_output (["agvtool" , "vers" , "-terse" ]))
94+ print ("mvers: " + check_string_output (["agvtool" , "mvers" , "-terse1" ]))
95+ print ("vers: " + check_string_output (["agvtool" , "vers" , "-terse" ]))
9596 marketing_version = "%s.%s %s" % (base_version , build_number , label )
9697 build_version = "%s.%s" % (base_version , build_number )
9798 subprocess .check_call (["agvtool" , "new-marketing-version" , marketing_version ])
@@ -102,13 +103,16 @@ def xcodebuild(scheme, workspace, configuration, commands, build_dir):
102103 cmd = cmd + commands
103104 cmd .append ('CONFIGURATION_BUILD_DIR=%s' % (build_dir ))
104105 try :
105- output = subprocess . check_output (cmd )
106+ output = check_string_output (cmd )
106107 return output
107108 except subprocess .CalledProcessError as e :
108109 raise BuildError (str (e ))
109110
111+ def check_string_output (command ):
112+ return subprocess .check_output (command ).decode ().strip ()
113+
110114def sign_app (app_path ):
111- sign .sign_everything_in_app (app_path , verbose = 2 )
115+ sign .sign_everything_in_app (app_path , key = signing_key )
112116
113117def package_app (app_path , image_path , image_name ):
114118 package .package (app_path , image_path , image_name )
0 commit comments