Skip to content

Commit d997e35

Browse files
committed
Merge branch 'release-2.0-nightly' into release-2.0
2 parents cb5fef2 + 17ef464 commit d997e35

File tree

5 files changed

+40
-21
lines changed

5 files changed

+40
-21
lines changed

util/createBinaryDistr.py

Lines changed: 36 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/usr/bin/python
1+
#!/usr/bin/python
22
# @file createBinaryDistr.py
33
# @author David Zemon
44
# @project PropWare
@@ -17,6 +17,7 @@
1717
import subprocess
1818
from time import sleep
1919
from shutil import copy2
20+
import argparse
2021

2122
from propwareImporter import importAll
2223
import propwareUtils
@@ -29,13 +30,12 @@ class CreateBinaryDistr:
2930
"jpg", "lang", "pdf", "png"]
3031
BLACKLISTED_DIRECTORIES = ["docs", ".idea", ".settings", ".git", propwareUtils.DOWNLOADS_DIRECTORY]
3132
BRANCHES = ["master", "development", "release-2.0", "release-2.0-nightly"]
33+
TAGS = ["v1.1", "v1.2", "v2.0-beta1"]
3234
CURRENT_SUGGESTION = "release-2.0"
3335

3436
def __init__(self):
35-
CreateBinaryDistr.BRANCHES.sort()
3637
self.successes = []
3738

38-
def run(self):
3939
propwareUtils.checkProperWorkingDirectory()
4040

4141
# Import all extra libraries
@@ -45,22 +45,29 @@ def run(self):
4545
os.chdir("..")
4646
CreateBinaryDistr.cleanOldArchives()
4747

48+
def run(self, branches, areTags=False):
49+
assert (isinstance(branches, list))
50+
assert (isinstance(areTags, bool))
51+
52+
branches.sort()
53+
self.successes = []
54+
4855
try:
49-
for branch in CreateBinaryDistr.BRANCHES:
50-
self.runInBranch(branch)
56+
for branch in branches:
57+
self.runInBranch(branch, areTags)
5158
except Exception as e:
5259
print(e, file=sys.stderr)
5360
finally:
5461
CreateBinaryDistr.attemptCleanExit()
5562

56-
self.printSummary()
63+
self.printSummary(branches)
5764

58-
def runInBranch(self, branch):
65+
def runInBranch(self, branch, isTag):
5966
# Clean any leftover crud
6067
CreateBinaryDistr.clean()
6168

6269
# Attempt to checkout the next branch
63-
if 0 == CreateBinaryDistr.checkout(branch):
70+
if 0 == CreateBinaryDistr.checkout(branch, isTag):
6471
# Compile the static libraries and example projects
6572
CreateBinaryDistr.compile()
6673

@@ -111,18 +118,21 @@ def clean():
111118
raise e
112119

113120
@staticmethod
114-
def checkout(branch):
121+
def checkout(branch, isTag=False):
122+
assert (isinstance(isTag, bool))
123+
115124
try:
116125
subprocess.check_output(["git", "checkout", branch])
117126
except subprocess.CalledProcessError:
118127
print("Failed to checkout " + branch, file=sys.stderr)
119128
return 1
120129

121-
try:
122-
subprocess.check_output(["git", "pull"])
123-
except subprocess.CalledProcessError:
124-
print("Failed to pull latest sources", file=sys.stderr)
125-
return 1
130+
if not isTag:
131+
try:
132+
subprocess.check_output(["git", "pull"])
133+
except subprocess.CalledProcessError:
134+
print("Failed to pull latest sources", file=sys.stderr)
135+
return 1
126136

127137
return 0
128138

@@ -154,15 +164,15 @@ def attemptCleanExit():
154164
print("Caused by: " + str(e), file=sys.stderr)
155165
print(e.output.decode(), file=sys.stderr)
156166

157-
def printSummary(self):
167+
def printSummary(self, branches):
158168
# Let the stdout and stderr buffers catch up
159169
sleep(1)
160170

161171
print("\n\nSummary:")
162172
self.successes.sort()
163173
for branch in self.successes:
164174
print("\tPASS: " + branch)
165-
for branch in CreateBinaryDistr.BRANCHES:
175+
for branch in branches:
166176
if branch not in self.successes:
167177
print("\tFAIL: " + branch)
168178

@@ -176,5 +186,14 @@ def __str__(self):
176186

177187

178188
if "__main__" == __name__:
189+
parser = argparse.ArgumentParser(description="Create binary distributions of all branches (and optionally tags too)"
190+
" of PropWare")
191+
parser.add_argument("--tags", action="store_true",
192+
help="Create binary distributions for all tagged commits as well")
193+
args = parser.parse_args()
194+
179195
runMe = CreateBinaryDistr()
180-
runMe.run()
196+
runMe.run(CreateBinaryDistr.BRANCHES)
197+
198+
if args.tags:
199+
runMe.run(CreateBinaryDistr.TAGS, True)

util/importLibpropeller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/usr/bin/python
1+
#!/usr/bin/python
22
# @file importLibpropeller.py
33
# @author David Zemon
44
# @project PropWare

util/propgcc-map-sizes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/usr/bin/python
1+
#!/usr/bin/python
22
# File: ${file}
33
# Author: David Zemon
44
# Project: PropWare

util/propwareImporter.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/usr/bin/python
1+
#!/usr/bin/python
22
# File: ${file}
33
# Author: David Zemon
44
# Project: PropWare

util/propwareUtils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#/usr/bin/python
1+
#!/usr/bin/python
22
# File: ${file}
33
# Author: David Zemon
44
# Project: PropWare

0 commit comments

Comments
 (0)