Skip to content

Commit 79c92e5

Browse files
committed
Fix new build script
1 parent 159023d commit 79c92e5

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

GitX.xcodeproj/project.pbxproj

+2
Original file line numberDiff line numberDiff line change
@@ -1828,6 +1828,7 @@
18281828
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
18291829
CLANG_ENABLE_OBJC_ARC = YES;
18301830
COPY_PHASE_STRIP = NO;
1831+
CURRENT_PROJECT_VERSION = 0.12;
18311832
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
18321833
GCC_OPTIMIZATION_LEVEL = 0;
18331834
GCC_PREPROCESSOR_DEFINITIONS = "DEBUG=1";
@@ -1848,6 +1849,7 @@
18481849
ALWAYS_SEARCH_USER_PATHS = NO;
18491850
ARCHS = "$(ARCHS_STANDARD_64_BIT)";
18501851
CLANG_ENABLE_OBJC_ARC = YES;
1852+
CURRENT_PROJECT_VERSION = 0.12;
18511853
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
18521854
GCC_WARN_ABOUT_RETURN_TYPE = YES;
18531855
GCC_WARN_UNUSED_VARIABLE = YES;

build.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
product="%s.app" % (app,)
1212
label="dev"
1313
base_version="0.15"
14+
signing_key="Developer ID Application: Rowan James"
1415

1516
artifact_prefix= "%s-%s" % (app, label)
1617
workspace="%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

5456
def 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

7071
def 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

7576
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"])
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

8889
def 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

9293
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"]))
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+
110114
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)
112116

113117
def package_app(app_path, image_path, image_name):
114118
package.package(app_path, image_path, image_name)

sign.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def sign_frameworks_in_app(app_path, key, verbose=0):
2424
for framework in glob.glob(frameworkDir + '/*.framework'):
2525
sign(framework, key, verbose=verbose)
2626

27-
def sign_resources_in_app(app_path, verbose=0):
27+
def sign_resources_in_app(app_path, key, verbose=0):
2828
executableFlags = stat.S_IEXEC | stat.S_IXGRP | stat.S_IXOTH
2929
resourcesDir = os.path.join(app_path, 'Contents/Resources')
3030
for filename in os.listdir(resourcesDir):
@@ -33,7 +33,7 @@ def sign_resources_in_app(app_path, verbose=0):
3333
st = os.stat(filename)
3434
mode = st.st_mode
3535
if mode & executableFlags:
36-
sign(filename)
36+
sign(filename, key, verbose)
3737

3838
def sign_everything_in_app(app_path, key, verbose=0):
3939
sign_frameworks_in_app(app_path, key, verbose=verbose)

0 commit comments

Comments
 (0)