11
11
product = "%s.app" % (app ,)
12
12
label = "dev"
13
13
base_version = "0.15"
14
+ signing_key = "Developer ID Application: Rowan James"
14
15
15
16
artifact_prefix = "%s-%s" % (app , label )
16
17
workspace = "%s.xcodeproj/project.xcworkspace" % (app ,)
@@ -41,6 +42,7 @@ def release():
41
42
42
43
build_config (release_configuration )
43
44
45
+ build_dir = os .path .join (build_base_dir , release_configuration )
44
46
built_product = os .path .join (build_dir , product )
45
47
sign_app (built_product )
46
48
@@ -53,7 +55,6 @@ def release():
53
55
54
56
def debug ():
55
57
try :
56
- build_dir = os .path .join
57
58
build_config (debug_configuration )
58
59
59
60
except BuildError as e :
@@ -68,12 +69,12 @@ def build(configuration):
68
69
release ()
69
70
70
71
def assert_clean ():
71
- status = subprocess . check_output (["git" , "status" , "--porcelain" ])
72
+ status = check_string_output (["git" , "status" , "--porcelain" ])
72
73
if len (status ):
73
74
raise BuildError ("Working copy must be clean" )
74
75
75
76
def 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" ])
77
78
if ref != branch :
78
79
raise BuildError ("HEAD must be %s, but is %s" % (branch , ref ))
79
80
@@ -86,12 +87,12 @@ def clean_config(config):
86
87
xcodebuild (app , workspace , config , ["clean" ], build_dir )
87
88
88
89
def commit_count ():
89
- count = subprocess . check_output (["git" , "rev-list" , "HEAD" , "--count" ])
90
+ count = check_string_output (["git" , "rev-list" , "HEAD" , "--count" ])
90
91
return count
91
92
92
93
def 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" ]))
95
96
marketing_version = "%s.%s %s" % (base_version , build_number , label )
96
97
build_version = "%s.%s" % (base_version , build_number )
97
98
subprocess .check_call (["agvtool" , "new-marketing-version" , marketing_version ])
@@ -102,13 +103,16 @@ def xcodebuild(scheme, workspace, configuration, commands, build_dir):
102
103
cmd = cmd + commands
103
104
cmd .append ('CONFIGURATION_BUILD_DIR=%s' % (build_dir ))
104
105
try :
105
- output = subprocess . check_output (cmd )
106
+ output = check_string_output (cmd )
106
107
return output
107
108
except subprocess .CalledProcessError as e :
108
109
raise BuildError (str (e ))
109
110
111
+ def check_string_output (command ):
112
+ return subprocess .check_output (command ).decode ().strip ()
113
+
110
114
def 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 )
112
116
113
117
def package_app (app_path , image_path , image_name ):
114
118
package .package (app_path , image_path , image_name )
0 commit comments