From 20dd451bc8bc4f36957147469141f0c50d5fb7ed Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 20:59:01 +0000 Subject: [PATCH 01/19] Add a second test file --- README2.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 README2.md diff --git a/README2.md b/README2.md new file mode 100644 index 0000000..e69de29 From 18be423194cddea3e9f72ae71dccca2d817f316e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 21:35:34 +0000 Subject: [PATCH 02/19] Add a test groovy script --- test.gsh | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 test.gsh diff --git a/test.gsh b/test.gsh new file mode 100644 index 0000000..a38bfaf --- /dev/null +++ b/test.gsh @@ -0,0 +1,6 @@ +// Methods in this file will end up as object methods on the object that load returns. +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; From 51b4b03be8bc3eb71be393c527a34e7819766023 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 21:57:56 +0000 Subject: [PATCH 03/19] Add a test groovy script --- test.gsh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 test.gsh diff --git a/test.gsh b/test.gsh new file mode 100644 index 0000000..23fcfc0 --- /dev/null +++ b/test.gsh @@ -0,0 +1,7 @@ +// Methods in this file will end up as object methods on the object that load returns. +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; + From 61a6840f7c6de1def6be97283bd131c934af4a8b Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 28 Nov 2017 23:58:55 +0000 Subject: [PATCH 04/19] Start of versioning script --- versionnumbering/versioninfo.gsh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 versionnumbering/versioninfo.gsh diff --git a/versionnumbering/versioninfo.gsh b/versionnumbering/versioninfo.gsh new file mode 100644 index 0000000..579b976 --- /dev/null +++ b/versionnumbering/versioninfo.gsh @@ -0,0 +1,29 @@ +// Methods in this file will end up as object methods on the object that load returns. + +def makeVersionFolder(String versionFolder) { + dir("${versionFolder}") { + + + + + + + +def generateVersionFiles(String versionFolder, + Integer BaseGitNumber, + String SrcFolder, + String SrcBranch) { + echo """Building version folder at: ${versionFolder} + base git number: ${BaseGitNumber} + source folder: ${SrcFolder} + source branch: ${SrcBranch}""" + + dir + + + +def lookAtThis(String whoAreYou) { + echo "Look at this, ${whoAreYou}! You loaded this from another file!" +} + +return this; From 9f307dd502323554587e129f7235eccfe2ea8970 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 30 Nov 2017 18:25:01 +0000 Subject: [PATCH 05/19] Add python script and eclipse project files for version numbering --- .project | 17 +++ .pydevproject | 8 ++ versionnumbering/versioninfo.py | 192 ++++++++++++++++++++++++++++++++ 3 files changed, 217 insertions(+) create mode 100644 .project create mode 100644 .pydevproject create mode 100644 versionnumbering/versioninfo.py diff --git a/.project b/.project new file mode 100644 index 0000000..e329c3f --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + Common Build Scripts + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/.pydevproject b/.pydevproject new file mode 100644 index 0000000..d111c07 --- /dev/null +++ b/.pydevproject @@ -0,0 +1,8 @@ + + + +/${PROJECT_DIR_NAME} + +python interpreter +python35 + diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py new file mode 100644 index 0000000..0567097 --- /dev/null +++ b/versionnumbering/versioninfo.py @@ -0,0 +1,192 @@ +# encoding: utf-8 +''' +versionnumbering -- shortdesc + +versionnumbering generates a version folder with a common set of version information files in it + +@author: dan + +@copyright: 2017 Global Inkjet Systems Ltd. All rights reserved. +''' +import os +import sys +import shutil +import subprocess + +from argparse import ArgumentParser +from argparse import RawDescriptionHelpFormatter + +__all__ = [] +__version__ = 0.1 +__date__ = '2017-11-29' +__updated__ = '2017-11-29' + +def resetFolder(versionfolder): + print("Removing folders and contents of: {0}".format(versionfolder)) + try: + shutil.rmtree(versionfolder) + except FileNotFoundError: + pass + + print("Creating folder: {0}".format(versionfolder)) + os.makedirs(versionfolder) + +def getGitRevision(gitrootpath, basenumber): + cwd = os.getcwd() + + path = os.path.expanduser(gitrootpath) + print("Changing current working directory to: {0}".format(path)) + os.chdir(path) + + gitvar = "GIT_EXECUTABLE" + if gitvar in os.environ and os.environ[gitvar]: + gitexecutable = os.environ[gitvar] + else: + print("Expecting GIT_EXECUTABLE environment variable to have path to git. Defaulting to 'git'") + gitexecutable = "git" + + print("Determining revision info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "rev-list", "HEAD", "--count"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + changecount = completed.stdout.decode("utf-8").strip() + print("Change count: {0}".format(changecount)) + adjustedchangecount = int(changecount) + int(basenumber) + print("Adjusted change count: {0}".format(adjustedchangecount)) + + print("Determining current revision info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "rev-parse", "HEAD"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + revision = completed.stdout.decode("utf-8").strip() + print("Revision: {0}".format(revision)) + + os.chdir(cwd) + print("Restored current working directory to: {0}".format(cwd)) + + return (adjustedchangecount, revision) + +def getVersionPrefix(sourcebranch): + print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) + + defaultversionprefix = "1.30000.0" + splits = sourcebranch.split('/') + if len(splits) < 1: + print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix)) + return defaultversionprefix + + sourcebranch = splits[-1] + + if sourcebranch.lower().endswith("master"): # Special case + return "1.20000.0." + + splits = sourcebranch.split('.') + versionprefix = "" + if len(splits) < 1: + print("This source branch name has no decimal points in its name so defaulting to: {0}".format(defaultversionprefix)) + versionprefix = defaultversionprefix + else: + splitnumbercount = 0 + for split in splits: + if split.isdigit(): + versionprefix += split + "." + splitnumbercount += 1 + else: + break + if splitnumbercount > 2: + break + if splitnumbercount == 0: + print("No leading numbers were found in source branch name so defaulting to: {0}".format(defaultversionprefix)) + versionprefix = defaultversionprefix + elif splitnumbercount == 1: + versionprefix += "0.0." + elif splitnumbercount == 2: + versionprefix += "0." + + print("Determined version prefix to be: {0}".format(versionprefix)) + return versionprefix + +def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp): + with open(os.path.join(versionfolder, "buildjobname.txt"), 'w') as f: + f.write(buildjobname) + + with open(os.path.join(versionfolder, "prefix.txt"), 'w') as f: + f.write(versionprefix) + + with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: + f.write(gitrevision) + + with open(os.path.join(versionfolder, "buildnumber.txt"), 'w') as f: + f.write(buildnumber) + + with open(os.path.join(versionfolder, "buildstamp.txt"), 'w') as f: + f.write(buildstamp) + +def main(argv=None): # IGNORE:C0111 + '''Command line options.''' + + if argv is None: + argv = sys.argv + else: + sys.argv.extend(argv) + + program_name = os.path.basename(sys.argv[0]) + program_version = "v%s" % __version__ + program_build_date = str(__updated__) + program_version_message = '%%(prog)s %s (%s)' % (program_version, program_build_date) + program_shortdesc = __import__('__main__').__doc__.split("\n")[1] + program_license = '''%s + + Created by dan on %s. + Copyright 2017 Global Inkjet Systems Ltd. All rights reserved. + + Distributed on an "AS IS" basis without warranties + or conditions of any kind, either express or implied. + +USAGE +''' % (program_shortdesc, str(__date__)) + + try: + # Setup argument parser + parser = ArgumentParser(description=program_license, formatter_class=RawDescriptionHelpFormatter) + parser.add_argument("-s", "--sourcebranch", dest="sourcebranch", action="store", default="origin/master", help="source branch name to discover version number [default: %(default)s]") + parser.add_argument("-v", "--versionfolder", dest="versionfolder", action="store", default="version", help="version folder to be created [default: %(default)s]") + parser.add_argument("-g", "--gitroot", dest="gitrootfolder", action="store", default="GitRepository", help="root path of source files [default: %(default)s]") + parser.add_argument("-b", "--baseversionnumber", dest="baseversionnumber", action="store", default=int(1000), help="base git version number [default: %(default)s]") + parser.add_argument("-j", "--buildjobname", dest="buildjobname", action="store", default="-", help="build job name [default: %(default)s]") + parser.add_argument("-n", "--buildnumber", dest="buildnumber", action="store", default="1", help="build number [default: %(default)s]") + + # Process arguments + args = parser.parse_args() + + sourcebranch = args.sourcebranch + versionfolder = args.versionfolder + gitrootfolder = args.gitrootfolder + baseversionnumber = args.baseversionnumber + buildjobname = args.buildjobname + buildnumber = args.buildnumber + + print("Source branch:", sourcebranch, "version folder:", versionfolder, "Git root:", gitrootfolder) + print("Base version number:", baseversionnumber, "Build job name:", buildjobname, "Build number:", buildnumber) + + resetFolder(versionfolder) + + (gitrevisioncount, gitrevision) = getGitRevision(gitrootfolder, baseversionnumber) + + versionprefix = getVersionPrefix(sourcebranch) + + buildstamp = versionprefix + str(gitrevisioncount) + print("Build stamp is: {0}".format(buildstamp)) + + writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp) + + return 0 + except Exception as e: + print("Error while creating version info:", e.__repr__()) + return 1 + except Exception as e: + indent = len(program_name) * " " + print(program_name + ": " + repr(e) + "\n") + print(indent + " for help use --help") + return 2 + +if __name__ == "__main__": + sys.exit(main()) From 93caaec49afb99a61b6f324212cb24f557eb5c48 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 30 Nov 2017 18:39:49 +0000 Subject: [PATCH 06/19] Remove redundant file --- versionnumbering/versioninfo.gsh | 29 ----------------------------- 1 file changed, 29 deletions(-) delete mode 100644 versionnumbering/versioninfo.gsh diff --git a/versionnumbering/versioninfo.gsh b/versionnumbering/versioninfo.gsh deleted file mode 100644 index 579b976..0000000 --- a/versionnumbering/versioninfo.gsh +++ /dev/null @@ -1,29 +0,0 @@ -// Methods in this file will end up as object methods on the object that load returns. - -def makeVersionFolder(String versionFolder) { - dir("${versionFolder}") { - - - - - - - -def generateVersionFiles(String versionFolder, - Integer BaseGitNumber, - String SrcFolder, - String SrcBranch) { - echo """Building version folder at: ${versionFolder} - base git number: ${BaseGitNumber} - source folder: ${SrcFolder} - source branch: ${SrcBranch}""" - - dir - - - -def lookAtThis(String whoAreYou) { - echo "Look at this, ${whoAreYou}! You loaded this from another file!" -} - -return this; From d347fd921fc36354143f48b49434f89090d500ad Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Fri, 1 Dec 2017 17:03:09 +0000 Subject: [PATCH 07/19] Output git remote info into version folder --- versionnumbering/versioninfo.py | 51 ++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 20 deletions(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 0567097..35e91cd 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -59,10 +59,16 @@ def getGitRevision(gitrootpath, basenumber): revision = completed.stdout.decode("utf-8").strip() print("Revision: {0}".format(revision)) + print("Determining remote info using git command: {0}".format(gitexecutable)) + completed = subprocess.run([gitexecutable, "remote", "show", "origin"], stdout=subprocess.PIPE) + print("Command {0} returned: {1}".format(completed.args, completed.returncode)) + remoteinfo = completed.stdout.decode("utf-8") + print("Remote info: {0}".format(remoteinfo)) + os.chdir(cwd) print("Restored current working directory to: {0}".format(cwd)) - return (adjustedchangecount, revision) + return (adjustedchangecount, revision, remoteinfo) def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) @@ -104,7 +110,7 @@ def getVersionPrefix(sourcebranch): print("Determined version prefix to be: {0}".format(versionprefix)) return versionprefix -def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp): +def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp): with open(os.path.join(versionfolder, "buildjobname.txt"), 'w') as f: f.write(buildjobname) @@ -114,6 +120,9 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, b with open(os.path.join(versionfolder, "revision.txt"), 'w') as f: f.write(gitrevision) + with open(os.path.join(versionfolder, "remoteinfo.txt"), 'w') as f: + f.write(remoteinfo) + with open(os.path.join(versionfolder, "buildnumber.txt"), 'w') as f: f.write(buildnumber) @@ -157,31 +166,33 @@ USAGE # Process arguments args = parser.parse_args() - sourcebranch = args.sourcebranch - versionfolder = args.versionfolder - gitrootfolder = args.gitrootfolder - baseversionnumber = args.baseversionnumber - buildjobname = args.buildjobname - buildnumber = args.buildnumber + try: + sourcebranch = args.sourcebranch + versionfolder = args.versionfolder + gitrootfolder = args.gitrootfolder + baseversionnumber = args.baseversionnumber + buildjobname = args.buildjobname + buildnumber = args.buildnumber - print("Source branch:", sourcebranch, "version folder:", versionfolder, "Git root:", gitrootfolder) - print("Base version number:", baseversionnumber, "Build job name:", buildjobname, "Build number:", buildnumber) + print("Source branch:", sourcebranch, "version folder:", versionfolder, "Git root:", gitrootfolder) + print("Base version number:", baseversionnumber, "Build job name:", buildjobname, "Build number:", buildnumber) - resetFolder(versionfolder) + resetFolder(versionfolder) - (gitrevisioncount, gitrevision) = getGitRevision(gitrootfolder, baseversionnumber) + (gitrevisioncount, gitrevision, remoteinfo) = getGitRevision(gitrootfolder, baseversionnumber) - versionprefix = getVersionPrefix(sourcebranch) + versionprefix = getVersionPrefix(sourcebranch) - buildstamp = versionprefix + str(gitrevisioncount) - print("Build stamp is: {0}".format(buildstamp)) + buildstamp = versionprefix + str(gitrevisioncount) + print("Build stamp is: {0}".format(buildstamp)) - writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, buildnumber, buildstamp) + writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, remoteinfo, buildnumber, buildstamp) + + return 0 + except Exception as e: + print("Error while creating version info:", e.__repr__()) + return 1 - return 0 - except Exception as e: - print("Error while creating version info:", e.__repr__()) - return 1 except Exception as e: indent = len(program_name) * " " print(program_name + ": " + repr(e) + "\n") From d33f6828a4e6a95abcaf4884b0d14ea9b1fad018 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 2 Dec 2017 10:43:53 +0000 Subject: [PATCH 08/19] Add differences folder --- differences/.project | 17 +++ differences/.pydevproject | 8 ++ differences/show_release_differences.py | 151 ++++++++++++++++++++++++ 3 files changed, 176 insertions(+) create mode 100644 differences/.project create mode 100644 differences/.pydevproject create mode 100644 differences/show_release_differences.py diff --git a/differences/.project b/differences/.project new file mode 100644 index 0000000..75af0fc --- /dev/null +++ b/differences/.project @@ -0,0 +1,17 @@ + + + Release_difference + + + + + + org.python.pydev.PyDevBuilder + + + + + + org.python.pydev.pythonNature + + diff --git a/differences/.pydevproject b/differences/.pydevproject new file mode 100644 index 0000000..c3434da --- /dev/null +++ b/differences/.pydevproject @@ -0,0 +1,8 @@ + + + +/${PROJECT_DIR_NAME} + +python 3.0 +Default + diff --git a/differences/show_release_differences.py b/differences/show_release_differences.py new file mode 100644 index 0000000..1d525b9 --- /dev/null +++ b/differences/show_release_differences.py @@ -0,0 +1,151 @@ +''' +Created on 2 Mar 2017 + +@author: Dan +''' +import subprocess +import os +import sys +import re + +GIT_EXECUTABLE = os.getenv("GIT_EXECUTABLE") +if GIT_EXECUTABLE == None: + print("Please define the GIT_EXECUTABLE environment variable to the git executable path") + sys.exit(1) + +WORKING_PATH = os.getenv("WORKING_PATH") +if WORKING_PATH == None: + print("Please define the WORKING_PATH environment variable to the git repository path to use") + sys.exit(1) + +CURRENT_RELEASE = os.getenv("CURRENT_RELEASE") +if CURRENT_RELEASE == None: + print("Please define the CURRENT_RELEASE version") + sys.exit(1) + +PREVIOUS_RELEASE = os.getenv("PREVIOUS_RELEASE") +if PREVIOUS_RELEASE == None: + print("Please define the PREVIOUS_RELEASE version") + sys.exit(1) + +DIFFERENCE_OPTIONS = os.getenv("DIFFERENCE_OPTIONS") +if DIFFERENCE_OPTIONS == None: + DIFFERENCE_OPTIONS = "" + +class GitException(Exception): + def __init__(self, message): + self.message = message + + def __repr__(self): + return self.message + +def printDivider(times = 1, length = 100): + for _ in range(times): + print("*" * length) + +TABSIZE = 4 +def printTabbed(string, tabs = 0): + print("{0}{1}".format(" " * (TABSIZE * tabs), string)) + +def getGitLogDifferences(workingPath, previousRelease, currentRelease, tripledot = False): + gitExecutable = GIT_EXECUTABLE + if tripledot: + releaseExpression = previousRelease + "..." + currentRelease + else: + releaseExpression = previousRelease + ".." + currentRelease + currentdir = os.getcwd() + os.chdir(workingPath) + gitlog = [] + printTabbed("Executing: {0} {1} {2} {3}".format(gitExecutable, "log", "--oneline", releaseExpression)) + proc = subprocess.Popen([gitExecutable, "log", "--oneline", releaseExpression], stdout=subprocess.PIPE) + while True: + line = proc.stdout.readline() + if line: + linestring = line.decode('utf-8').rstrip() + gitlog.append(linestring) + #printTabbed(linestring, 1) + else: + break + proc.wait() + if proc.returncode > 0: + raise GitException("Git executable returned an error") + os.chdir(currentdir) + return gitlog + +expectedpattern = re.compile("^.* +(?:[gG][iI][sS][ _-]*|[tT]rac \#*|\#\s*)(\d+):*(.*)$") +revertpattern = re.compile('^(\S*) Revert " *GIS-(\d+):* (.*)"$') +mergepattern = re.compile("^(.*)((?:Merge branch '.*'|Merge remote-tracking branch '.*'|Merge commit '.*'|Add '.*' from commit).*)$") + +def processLog(gitlog): + reverts = [] + merges = {} + other = [] + numbered = {} + for line in gitlog: + expectedmatch = expectedpattern.match(line) + revertmatch = revertpattern.match(line) + mergematch = mergepattern.match(line) + if expectedmatch == None and revertmatch == None and mergematch == None: + other.append(line) + if revertmatch: + gisnumber = "GIS-" + revertmatch.group(2) + description = revertmatch.group(3) + reverts.append("Revert: {0} {1}".format(gisnumber, description)) + if mergematch: + merge = mergematch.group(2) + if not merge in merges: + merges[merge] = 1 + else: + merges[merge] += 1 + if expectedmatch: + gisnumber = "GIS-" + expectedmatch.group(1) + description = expectedmatch.group(2) + if not gisnumber in numbered: + numbered[gisnumber] = [] + numbered[gisnumber].append(description) + return (reverts, merges, other, numbered) + +def showDifferences(differences): + (revertslog, mergeslog, otherlog, numberedlog) = differences + printDivider() + printTabbed("GIS-Numbers Log:") + for (gisnumber, descriptions) in sorted(numberedlog.items()): + printTabbed(gisnumber, 1) + descriptions = numberedlog[gisnumber]; + for description in descriptions: + printTabbed(description, 2) + printDivider() + printTabbed("Revert log:") + for reversion in sorted(revertslog): + printTabbed(reversion, 1) + printDivider() + printTabbed("Merges log:") + for merge in sorted(mergeslog): + printTabbed(merge, 1) + printDivider() + printTabbed("Other log:") + for other in sorted(otherlog): + printTabbed(other, 1) + +def main(): + workingPath = WORKING_PATH + previous = PREVIOUS_RELEASE + now = CURRENT_RELEASE + printDivider(times = 4) + printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, previous, now)) + gitlog = getGitLogDifferences(workingPath, previous, now) + showDifferences(processLog(gitlog)) + if 'opposite' in DIFFERENCE_OPTIONS.lower(): + printDivider(times = 4) + printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, now, previous)) + gitlog = getGitLogDifferences(workingPath, now, previous) + showDifferences(processLog(gitlog)) + if 'notcommon' in DIFFERENCE_OPTIONS.lower(): + printDivider(times = 4) + printTabbed("Looking for changes that are not common to {1} or {2} at path: {0}".format(workingPath, now, previous)) + gitlog = getGitLogDifferences(workingPath, now, previous, tripledot = True) + showDifferences(processLog(gitlog)) + sys.exit(0) + +if __name__ == '__main__': + main() \ No newline at end of file From e58acae19d89d804ca1bfc9b9426fe91d7f9f010 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 2 Dec 2017 21:46:11 +0000 Subject: [PATCH 09/19] Tested version of differences generation --- .settings/org.eclipse.core.resources.prefs | 2 + differences/show_release_differences.py | 207 ++++++++++++------- version/differences.txt | 230 +++++++++++++++++++++ versionnumbering/versioninfo.py | 21 +- 4 files changed, 375 insertions(+), 85 deletions(-) create mode 100644 .settings/org.eclipse.core.resources.prefs create mode 100644 version/differences.txt diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 0000000..1174a06 --- /dev/null +++ b/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//versionnumbering/versioninfo.py=utf-8 diff --git a/differences/show_release_differences.py b/differences/show_release_differences.py index 1d525b9..a778892 100644 --- a/differences/show_release_differences.py +++ b/differences/show_release_differences.py @@ -1,36 +1,26 @@ ''' -Created on 2 Mar 2017 +showreleasedifferences -- shortdesc -@author: Dan +showreleasedifferences generates a version folder with a common set of version information files in it + +@author: dan + +@copyright: 2017 Global Inkjet Systems Ltd. All rights reserved. ''' import subprocess import os import sys import re -GIT_EXECUTABLE = os.getenv("GIT_EXECUTABLE") -if GIT_EXECUTABLE == None: - print("Please define the GIT_EXECUTABLE environment variable to the git executable path") - sys.exit(1) +from argparse import ArgumentParser +from argparse import RawDescriptionHelpFormatter -WORKING_PATH = os.getenv("WORKING_PATH") -if WORKING_PATH == None: - print("Please define the WORKING_PATH environment variable to the git repository path to use") - sys.exit(1) +__all__ = [] +__version__ = 0.1 +__date__ = '2017-11-29' +__updated__ = '2017-11-29' -CURRENT_RELEASE = os.getenv("CURRENT_RELEASE") -if CURRENT_RELEASE == None: - print("Please define the CURRENT_RELEASE version") - sys.exit(1) - -PREVIOUS_RELEASE = os.getenv("PREVIOUS_RELEASE") -if PREVIOUS_RELEASE == None: - print("Please define the PREVIOUS_RELEASE version") - sys.exit(1) - -DIFFERENCE_OPTIONS = os.getenv("DIFFERENCE_OPTIONS") -if DIFFERENCE_OPTIONS == None: - DIFFERENCE_OPTIONS = "" +gitExecutable = os.getenv("GIT_EXECUTABLE", default="git") class GitException(Exception): def __init__(self, message): @@ -39,31 +29,34 @@ class GitException(Exception): def __repr__(self): return self.message -def printDivider(times = 1, length = 100): +def makeFolder(versionfolder): + print("Creating folder (if not already there): {0}".format(versionfolder)) + os.makedirs(versionfolder, exist_ok = True) + +def printDivider(outfh, times = 1, length = 100): for _ in range(times): - print("*" * length) + outfh.write("{0}\n".format("*" * length)) TABSIZE = 4 -def printTabbed(string, tabs = 0): - print("{0}{1}".format(" " * (TABSIZE * tabs), string)) +def printTabbed(outfh, string, tabs = 0): + outfh.write("{0}{1}\n".format(" " * (TABSIZE * tabs), string)) -def getGitLogDifferences(workingPath, previousRelease, currentRelease, tripledot = False): - gitExecutable = GIT_EXECUTABLE +def getGitLogDifferences(outfh, gitrootfolder, previousRelease, currentRelease, tripledot = False): if tripledot: releaseExpression = previousRelease + "..." + currentRelease else: releaseExpression = previousRelease + ".." + currentRelease currentdir = os.getcwd() - os.chdir(workingPath) + os.chdir(gitrootfolder) gitlog = [] - printTabbed("Executing: {0} {1} {2} {3}".format(gitExecutable, "log", "--oneline", releaseExpression)) + printTabbed(outfh, "Executing: {0} {1} {2} {3}".format(gitExecutable, "log", "--oneline", releaseExpression)) proc = subprocess.Popen([gitExecutable, "log", "--oneline", releaseExpression], stdout=subprocess.PIPE) while True: line = proc.stdout.readline() if line: linestring = line.decode('utf-8').rstrip() gitlog.append(linestring) - #printTabbed(linestring, 1) + #printTabbed(outfh, linestring, 1) else: break proc.wait() @@ -72,15 +65,23 @@ def getGitLogDifferences(workingPath, previousRelease, currentRelease, tripledot os.chdir(currentdir) return gitlog -expectedpattern = re.compile("^.* +(?:[gG][iI][sS][ _-]*|[tT]rac \#*|\#\s*)(\d+):*(.*)$") -revertpattern = re.compile('^(\S*) Revert " *GIS-(\d+):* (.*)"$') +jiraprojectpattern = { + 'GIS' : ( re.compile("^.* +(?:[gG][iI][sS][ _-]*|[tT]rac \#*|\#\s*)(\d+):*(.*)$"), + re.compile('^(\S*) Revert " *GIS-(\d+):* (.*)"$'), + ), + 'IMB': ( re.compile("^.* +(?:[Ii][Mm][Bb][ _-]*|\#\s*)(\d+):*(.*)$"), + re.compile('^(\S*) Revert " *IMB-(\d+):* (.*)"$'), + ), + } + mergepattern = re.compile("^(.*)((?:Merge branch '.*'|Merge remote-tracking branch '.*'|Merge commit '.*'|Add '.*' from commit).*)$") -def processLog(gitlog): +def processLog(gitlog, jirakeyprefix): reverts = [] merges = {} other = [] numbered = {} + (expectedpattern, revertpattern) = jiraprojectpattern[jirakeyprefix] for line in gitlog: expectedmatch = expectedpattern.match(line) revertmatch = revertpattern.match(line) @@ -88,7 +89,7 @@ def processLog(gitlog): if expectedmatch == None and revertmatch == None and mergematch == None: other.append(line) if revertmatch: - gisnumber = "GIS-" + revertmatch.group(2) + gisnumber = jirakeyprefix + "-" + revertmatch.group(2) description = revertmatch.group(3) reverts.append("Revert: {0} {1}".format(gisnumber, description)) if mergematch: @@ -98,54 +99,116 @@ def processLog(gitlog): else: merges[merge] += 1 if expectedmatch: - gisnumber = "GIS-" + expectedmatch.group(1) + gisnumber = jirakeyprefix + "-" + expectedmatch.group(1) description = expectedmatch.group(2) if not gisnumber in numbered: numbered[gisnumber] = [] numbered[gisnumber].append(description) return (reverts, merges, other, numbered) -def showDifferences(differences): +def showDifferences(differences, jirakeyprefix, outfh): (revertslog, mergeslog, otherlog, numberedlog) = differences - printDivider() - printTabbed("GIS-Numbers Log:") + printDivider(outfh) + printTabbed(outfh, jirakeyprefix + "-Numbers Log:") for (gisnumber, descriptions) in sorted(numberedlog.items()): - printTabbed(gisnumber, 1) + printTabbed(outfh, gisnumber, 1) descriptions = numberedlog[gisnumber]; for description in descriptions: - printTabbed(description, 2) - printDivider() - printTabbed("Revert log:") + printTabbed(outfh, description, 2) + printDivider(outfh) + printTabbed(outfh, "Revert log:") for reversion in sorted(revertslog): - printTabbed(reversion, 1) - printDivider() - printTabbed("Merges log:") + printTabbed(outfh, reversion, 1) + printDivider(outfh) + printTabbed(outfh, "Merges log:") for merge in sorted(mergeslog): - printTabbed(merge, 1) - printDivider() - printTabbed("Other log:") + printTabbed(outfh, merge, 1) + printDivider(outfh) + printTabbed(outfh, "Other log:") for other in sorted(otherlog): - printTabbed(other, 1) + printTabbed(outfh, other, 1) -def main(): - workingPath = WORKING_PATH - previous = PREVIOUS_RELEASE - now = CURRENT_RELEASE - printDivider(times = 4) - printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, previous, now)) - gitlog = getGitLogDifferences(workingPath, previous, now) - showDifferences(processLog(gitlog)) - if 'opposite' in DIFFERENCE_OPTIONS.lower(): - printDivider(times = 4) - printTabbed("Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(workingPath, now, previous)) - gitlog = getGitLogDifferences(workingPath, now, previous) - showDifferences(processLog(gitlog)) - if 'notcommon' in DIFFERENCE_OPTIONS.lower(): - printDivider(times = 4) - printTabbed("Looking for changes that are not common to {1} or {2} at path: {0}".format(workingPath, now, previous)) - gitlog = getGitLogDifferences(workingPath, now, previous, tripledot = True) - showDifferences(processLog(gitlog)) - sys.exit(0) +def main(argv=None): # IGNORE:C0111 + '''Command line options.''' -if __name__ == '__main__': - main() \ No newline at end of file + if argv is None: + argv = sys.argv + else: + sys.argv.extend(argv) + + program_name = os.path.basename(sys.argv[0]) + program_version = "v%s" % __version__ + program_build_date = str(__updated__) + program_version_message = '%%(prog)s %s (%s)' % (program_version, program_build_date) + program_shortdesc = __import__('__main__').__doc__.split("\n")[1] + program_license = '''%s + + Created by dan on %s. + Copyright 2017 Global Inkjet Systems Ltd. All rights reserved. + + Distributed on an "AS IS" basis without warranties + or conditions of any kind, either express or implied. + +USAGE +''' % (program_shortdesc, str(__date__)) + + try: + # Setup argument parser + parser = ArgumentParser(description=program_license, formatter_class=RawDescriptionHelpFormatter) + parser.add_argument("-g", "--gitroot", dest="gitrootfolder", action="store", default="GitRepository", help="root path of source files [default: %(default)s]") + parser.add_argument("-s", "--sourceversion", dest="sourceversion", action="store", default="origin/master", help="source version branch or tag to discover compare against [default: %(default)s]") + parser.add_argument("-p", "--previousversion", dest="previousversion", action="store", default="origin/master", help="source branch or tag to compare with [default: %(default)s]") + parser.add_argument("-j", "--jirakeyprefix", dest="jirakeyprefix", action="store", default="GIS", help="jira key prefix [default: %(default)s]") + parser.add_argument("-o", "--outputoptions", dest="outputoptions", action="store", default="", help="output options: Can be: opposite notcommon [default: %(default)s]") + parser.add_argument("-v", "--versionfolder", dest="versionfolder", action="store", default="", help="version folder where differences file stored [default: %(default)s]") + + # Process arguments + args = parser.parse_args() + + try: + gitrootfolder = args.gitrootfolder + sourceversion = args.sourceversion + previousversion = args.previousversion + jirakeyprefix = args.jirakeyprefix + outputoptions = args.outputoptions + versionfolder = args.versionfolder + + print("Git root:", gitrootfolder, "Source version:", sourceversion, "Previous source version:", previousversion) + print("Jira key prefix:", jirakeyprefix, "Output options:", outputoptions, "Version folder:", versionfolder) + + if versionfolder: + makeFolder(versionfolder) + outfh = open(os.path.join(versionfolder, "differences.txt"), 'w') + else: + outfh = sys.stdout + + printDivider(outfh, times = 4) + printTabbed(outfh, "Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(gitrootfolder, previousversion, sourceversion)) + gitlog = getGitLogDifferences(outfh, gitrootfolder, previousversion, sourceversion) + showDifferences(processLog(gitlog, jirakeyprefix), jirakeyprefix, outfh) + if 'opposite' in outputoptions.lower(): + printDivider(outfh, times = 4) + printTabbed(outfh, "Looking for changes in {2} that are not in {1} of the repository at path: {0}".format(gitrootfolder, sourceversion, previousversion)) + gitlog = getGitLogDifferences(outfh, gitrootfolder, sourceversion, previousversion) + showDifferences(processLog(gitlog, jirakeyprefix), jirakeyprefix, outfh) + if 'notcommon' in outputoptions.lower(): + printDivider(outfh, times = 4) + printTabbed(outfh, "Looking for changes that are not common to {1} or {2} at path: {0}".format(gitrootfolder, sourceversion, previousversion)) + gitlog = getGitLogDifferences(outfh, gitrootfolder, sourceversion, previousversion, tripledot = True) + showDifferences(processLog(gitlog, jirakeyprefix), jirakeyprefix, outfh) + + if versionfolder: + outfh.close() + return 0 + except Exception as e: + print("Error while determining differences:", e.__repr__()) + return 1 + + except Exception as e: + indent = len(program_name) * " " + print(program_name + ": " + repr(e) + "\n") + print(indent + " for help use --help") + return 2 + +if __name__ == "__main__": + sys.exit(main()) diff --git a/version/differences.txt b/version/differences.txt new file mode 100644 index 0000000..7ec3ad6 --- /dev/null +++ b/version/differences.txt @@ -0,0 +1,230 @@ +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +Looking for changes in origin/master that are not in origin/1.5.4 of the repository at path: /home/dan/home2/Development/inksystem +Executing: git log --oneline origin/1.5.4..origin/master +**************************************************************************************************** +IMB-Numbers Log: + IMB-11 + Further minor change to tooltip + Changed tooltip for PWN Frequency on ink pumps + Changed the Tooltips for PWM frequency and duty cycle + IMB-12 + Changed the order the events are generated in to prevent master from resetting slave + When a vent command is sent to a slave, it will demand a vent from its master + IMB-14 + Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow + IMB-4 + - Add more logging + IMB-42 + Master sets the slaves to dormant when pre-idling + IMB-43 + Added purge abort for HP Type 2 + Fixed shared controlled flow transition for purge all slaves + Added Idle transitions from Purge + Added missing definition + Added explicit transitions for standby for all states for flowmode 1-3 + IMB-47 + - Tidied up checkStateR to be consistent with setValueR + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + IMB-50 + Temperature setpoint set when entering flow configuration to ensure correct heater operation + IMB-6 + Removed a white-space in the output + IMB-7 + Changed the formatting of the output + IMB-8 + When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. + Added pre-flow to post-flow transitions and vice-versa + In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other +**************************************************************************************************** +Revert log: +**************************************************************************************************** +Merges log: + Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic + Merge branch 'master' of hydra:gis/inksystem + Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.5' + Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic +**************************************************************************************************** +Other log: + 095290c GIS-1621 - Make compilation work in case-sensitive linux + 0a8505d GIS-1621 - Remove test code + 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology + 149e0bf GIS 6221: Added logging for gravity mode + 169125b GIS-6221: Corrected Typo + 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued + 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h + 41ac373 GIS-6253: Fixed bugs + 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD + 468798e Update release notes whitespace + 4c2badc GIS-1621 - 16 bit integer is not printing correctly + 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle + 541c3bb GIS-6253: Added gravity flowmode + 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis + 577444e Update release notes for 1.5.5 + 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue + 603de5a GIS-6221: Fixed more typos + 628b57d GIS 6221: Fixed typo + 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 6da6243 GIS-6221 Changed purge configuration, return from purge still to do + 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity + 83f5517 Update 1.5.5 release notes with known issues + 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis + 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down + 92c135e GIS 6462 Fixed typo + 9400923 GIS-6516: Slave resets from vent when master is reset + 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h + a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master + a900a24 GIS-6221: Changed Idle to be driven from Inlet Side + b2f4383 GIS-1620 - Correct string print + b42ea46 GIS-1621 - Handle version prefix + b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow + b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode + bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 + bd69b60 GIS-6253: Fixed typos + c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode + c666970 GIS-6570 - Add some logging for diagnosis + c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby + c962c65 GIS-6221 Added Purge Return via Idle + ca1e7b5 GIS-6253: Added the files for gravity flowmode + ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value + cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 + d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems + da69186 GIS 6492: Dumpconfig now outputs the software version + df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" + e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) + e6b0227 GIS-6221 Corrected vent operation for outlet bottle + ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy + f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes + f7109ff GIS 43: Added purge to idle transitions for Gravity Mode + f87280b GIS 43: Fixed transition in cfm + f999765 GIS-6253: Removed redundant function + ff37df8 GIS-6253: Fixed typos + ff92b79 GIS 6591: Added statement on Master settings +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +Looking for changes in origin/1.5.4 that are not in origin/master of the repository at path: /home/dan/home2/Development/inksystem +Executing: git log --oneline origin/master..origin/1.5.4 +**************************************************************************************************** +IMB-Numbers Log: +**************************************************************************************************** +Revert log: +**************************************************************************************************** +Merges log: +**************************************************************************************************** +Other log: +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +**************************************************************************************************** +Looking for changes that are not common to origin/master or origin/1.5.4 at path: /home/dan/home2/Development/inksystem +Executing: git log --oneline origin/master...origin/1.5.4 +**************************************************************************************************** +IMB-Numbers Log: + IMB-11 + Further minor change to tooltip + Changed tooltip for PWN Frequency on ink pumps + Changed the Tooltips for PWM frequency and duty cycle + IMB-12 + Changed the order the events are generated in to prevent master from resetting slave + When a vent command is sent to a slave, it will demand a vent from its master + IMB-14 + Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow + IMB-4 + - Add more logging + IMB-42 + Master sets the slaves to dormant when pre-idling + IMB-43 + Added purge abort for HP Type 2 + Fixed shared controlled flow transition for purge all slaves + Added Idle transitions from Purge + Added missing definition + Added explicit transitions for standby for all states for flowmode 1-3 + IMB-47 + - Tidied up checkStateR to be consistent with setValueR + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. + IMB-50 + Temperature setpoint set when entering flow configuration to ensure correct heater operation + IMB-6 + Removed a white-space in the output + IMB-7 + Changed the formatting of the output + IMB-8 + When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. + Added pre-flow to post-flow transitions and vice-versa + In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other +**************************************************************************************************** +Revert log: +**************************************************************************************************** +Merges log: + Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic + Merge branch 'master' of hydra:gis/inksystem + Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic + Merge remote-tracking branch 'remotes/origin/1.5.5' + Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic +**************************************************************************************************** +Other log: + 095290c GIS-1621 - Make compilation work in case-sensitive linux + 0a8505d GIS-1621 - Remove test code + 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology + 149e0bf GIS 6221: Added logging for gravity mode + 169125b GIS-6221: Corrected Typo + 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued + 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h + 41ac373 GIS-6253: Fixed bugs + 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD + 468798e Update release notes whitespace + 4c2badc GIS-1621 - 16 bit integer is not printing correctly + 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle + 541c3bb GIS-6253: Added gravity flowmode + 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis + 577444e Update release notes for 1.5.5 + 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue + 603de5a GIS-6221: Fixed more typos + 628b57d GIS 6221: Fixed typo + 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 6da6243 GIS-6221 Changed purge configuration, return from purge still to do + 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity + 83f5517 Update 1.5.5 release notes with known issues + 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis + 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. + 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down + 92c135e GIS 6462 Fixed typo + 9400923 GIS-6516: Slave resets from vent when master is reset + 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h + a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master + a900a24 GIS-6221: Changed Idle to be driven from Inlet Side + b2f4383 GIS-1620 - Correct string print + b42ea46 GIS-1621 - Handle version prefix + b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow + b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode + bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 + bd69b60 GIS-6253: Fixed typos + c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode + c666970 GIS-6570 - Add some logging for diagnosis + c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby + c962c65 GIS-6221 Added Purge Return via Idle + ca1e7b5 GIS-6253: Added the files for gravity flowmode + ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value + cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 + d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems + da69186 GIS 6492: Dumpconfig now outputs the software version + df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" + e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) + e6b0227 GIS-6221 Corrected vent operation for outlet bottle + ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy + f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes + f7109ff GIS 43: Added purge to idle transitions for Gravity Mode + f87280b GIS 43: Fixed transition in cfm + f999765 GIS-6253: Removed redundant function + ff37df8 GIS-6253: Fixed typos + ff92b79 GIS 6591: Added statement on Master settings diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index 35e91cd..c8c79fe 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -21,6 +21,8 @@ __version__ = 0.1 __date__ = '2017-11-29' __updated__ = '2017-11-29' +gitExecutable = os.getenv("GIT_EXECUTABLE", default="git") + def resetFolder(versionfolder): print("Removing folders and contents of: {0}".format(versionfolder)) try: @@ -38,29 +40,22 @@ def getGitRevision(gitrootpath, basenumber): print("Changing current working directory to: {0}".format(path)) os.chdir(path) - gitvar = "GIT_EXECUTABLE" - if gitvar in os.environ and os.environ[gitvar]: - gitexecutable = os.environ[gitvar] - else: - print("Expecting GIT_EXECUTABLE environment variable to have path to git. Defaulting to 'git'") - gitexecutable = "git" - - print("Determining revision info using git command: {0}".format(gitexecutable)) - completed = subprocess.run([gitexecutable, "rev-list", "HEAD", "--count"], stdout=subprocess.PIPE) + print("Determining revision info using git command: {0}".format(gitExecutable)) + completed = subprocess.run([gitExecutable, "rev-list", "HEAD", "--count"], stdout=subprocess.PIPE) print("Command {0} returned: {1}".format(completed.args, completed.returncode)) changecount = completed.stdout.decode("utf-8").strip() print("Change count: {0}".format(changecount)) adjustedchangecount = int(changecount) + int(basenumber) print("Adjusted change count: {0}".format(adjustedchangecount)) - print("Determining current revision info using git command: {0}".format(gitexecutable)) - completed = subprocess.run([gitexecutable, "rev-parse", "HEAD"], stdout=subprocess.PIPE) + print("Determining current revision info using git command: {0}".format(gitExecutable)) + completed = subprocess.run([gitExecutable, "rev-parse", "HEAD"], stdout=subprocess.PIPE) print("Command {0} returned: {1}".format(completed.args, completed.returncode)) revision = completed.stdout.decode("utf-8").strip() print("Revision: {0}".format(revision)) - print("Determining remote info using git command: {0}".format(gitexecutable)) - completed = subprocess.run([gitexecutable, "remote", "show", "origin"], stdout=subprocess.PIPE) + print("Determining remote info using git command: {0}".format(gitExecutable)) + completed = subprocess.run([gitExecutable, "remote", "show", "origin"], stdout=subprocess.PIPE) print("Command {0} returned: {1}".format(completed.args, completed.returncode)) remoteinfo = completed.stdout.decode("utf-8") print("Remote info: {0}".format(remoteinfo)) From 2fab1a566ec16460835b4aefda492ad56b435490 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 2 Dec 2017 21:48:37 +0000 Subject: [PATCH 10/19] Remove redundant files --- README.md | 0 README2.md | 0 version/differences.txt | 230 ---------------------------------------- 3 files changed, 230 deletions(-) delete mode 100644 README.md delete mode 100644 README2.md delete mode 100644 version/differences.txt diff --git a/README.md b/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/README2.md b/README2.md deleted file mode 100644 index e69de29..0000000 diff --git a/version/differences.txt b/version/differences.txt deleted file mode 100644 index 7ec3ad6..0000000 --- a/version/differences.txt +++ /dev/null @@ -1,230 +0,0 @@ -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -Looking for changes in origin/master that are not in origin/1.5.4 of the repository at path: /home/dan/home2/Development/inksystem -Executing: git log --oneline origin/1.5.4..origin/master -**************************************************************************************************** -IMB-Numbers Log: - IMB-11 - Further minor change to tooltip - Changed tooltip for PWN Frequency on ink pumps - Changed the Tooltips for PWM frequency and duty cycle - IMB-12 - Changed the order the events are generated in to prevent master from resetting slave - When a vent command is sent to a slave, it will demand a vent from its master - IMB-14 - Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow - IMB-4 - - Add more logging - IMB-42 - Master sets the slaves to dormant when pre-idling - IMB-43 - Added purge abort for HP Type 2 - Fixed shared controlled flow transition for purge all slaves - Added Idle transitions from Purge - Added missing definition - Added explicit transitions for standby for all states for flowmode 1-3 - IMB-47 - - Tidied up checkStateR to be consistent with setValueR - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - IMB-50 - Temperature setpoint set when entering flow configuration to ensure correct heater operation - IMB-6 - Removed a white-space in the output - IMB-7 - Changed the formatting of the output - IMB-8 - When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. - Added pre-flow to post-flow transitions and vice-versa - In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other -**************************************************************************************************** -Revert log: -**************************************************************************************************** -Merges log: - Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic - Merge branch 'master' of hydra:gis/inksystem - Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.5' - Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic -**************************************************************************************************** -Other log: - 095290c GIS-1621 - Make compilation work in case-sensitive linux - 0a8505d GIS-1621 - Remove test code - 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology - 149e0bf GIS 6221: Added logging for gravity mode - 169125b GIS-6221: Corrected Typo - 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued - 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h - 41ac373 GIS-6253: Fixed bugs - 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD - 468798e Update release notes whitespace - 4c2badc GIS-1621 - 16 bit integer is not printing correctly - 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle - 541c3bb GIS-6253: Added gravity flowmode - 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis - 577444e Update release notes for 1.5.5 - 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue - 603de5a GIS-6221: Fixed more typos - 628b57d GIS 6221: Fixed typo - 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 6da6243 GIS-6221 Changed purge configuration, return from purge still to do - 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity - 83f5517 Update 1.5.5 release notes with known issues - 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis - 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down - 92c135e GIS 6462 Fixed typo - 9400923 GIS-6516: Slave resets from vent when master is reset - 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h - a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master - a900a24 GIS-6221: Changed Idle to be driven from Inlet Side - b2f4383 GIS-1620 - Correct string print - b42ea46 GIS-1621 - Handle version prefix - b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow - b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode - bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 - bd69b60 GIS-6253: Fixed typos - c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode - c666970 GIS-6570 - Add some logging for diagnosis - c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby - c962c65 GIS-6221 Added Purge Return via Idle - ca1e7b5 GIS-6253: Added the files for gravity flowmode - ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value - cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 - d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems - da69186 GIS 6492: Dumpconfig now outputs the software version - df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" - e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) - e6b0227 GIS-6221 Corrected vent operation for outlet bottle - ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy - f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes - f7109ff GIS 43: Added purge to idle transitions for Gravity Mode - f87280b GIS 43: Fixed transition in cfm - f999765 GIS-6253: Removed redundant function - ff37df8 GIS-6253: Fixed typos - ff92b79 GIS 6591: Added statement on Master settings -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -Looking for changes in origin/1.5.4 that are not in origin/master of the repository at path: /home/dan/home2/Development/inksystem -Executing: git log --oneline origin/master..origin/1.5.4 -**************************************************************************************************** -IMB-Numbers Log: -**************************************************************************************************** -Revert log: -**************************************************************************************************** -Merges log: -**************************************************************************************************** -Other log: -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -**************************************************************************************************** -Looking for changes that are not common to origin/master or origin/1.5.4 at path: /home/dan/home2/Development/inksystem -Executing: git log --oneline origin/master...origin/1.5.4 -**************************************************************************************************** -IMB-Numbers Log: - IMB-11 - Further minor change to tooltip - Changed tooltip for PWN Frequency on ink pumps - Changed the Tooltips for PWM frequency and duty cycle - IMB-12 - Changed the order the events are generated in to prevent master from resetting slave - When a vent command is sent to a slave, it will demand a vent from its master - IMB-14 - Fixed state transition in Controlled Flow Master where it could get stuck in pre-flow - IMB-4 - - Add more logging - IMB-42 - Master sets the slaves to dormant when pre-idling - IMB-43 - Added purge abort for HP Type 2 - Fixed shared controlled flow transition for purge all slaves - Added Idle transitions from Purge - Added missing definition - Added explicit transitions for standby for all states for flowmode 1-3 - IMB-47 - - Tidied up checkStateR to be consistent with setValueR - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - - The thermistor will only generate an event if a threshold has been crossed, or when "timeToSendAnotherEvent" is true. - IMB-50 - Temperature setpoint set when entering flow configuration to ensure correct heater operation - IMB-6 - Removed a white-space in the output - IMB-7 - Changed the formatting of the output - IMB-8 - When returning from a purge it now calls the same code as when going into idle, as they effectively were identical. - Added pre-flow to post-flow transitions and vice-versa - In gravity mode: removed the activation of the vacuum pump which speeds up ramps. This caused vent and pump to "fight" each other -**************************************************************************************************** -Revert log: -**************************************************************************************************** -Merges log: - Merge branch '1.10023.j6221-Type2_Pneumatic' of hydra:gis/inksystem into 1.10023.j6221-Type2_Pneumatic - Merge branch 'master' of hydra:gis/inksystem - Merge remote-tracking branch 'remotes/origin/1.10025.j6416-EthernetCongestion' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.2' into 1.10023.j6221-Type2_Pneumatic - Merge remote-tracking branch 'remotes/origin/1.5.5' - Merge remote-tracking branch 'remotes/origin/master' into 1.10023.j6221-Type2_Pneumatic -**************************************************************************************************** -Other log: - 095290c GIS-1621 - Make compilation work in case-sensitive linux - 0a8505d GIS-1621 - Remove test code - 0e8ccce GIS-6380 Removed ambiguous "absolute pressure" terminology - 149e0bf GIS 6221: Added logging for gravity mode - 169125b GIS-6221: Corrected Typo - 23c37d0 GIS 43: System will abort purge in a safe manner if standby command is issued - 37dd24b GIS 6479: Controlled flow master now goes through pre-flow. Fixed ordering in controlevent.c and .h - 41ac373 GIS-6253: Fixed bugs - 45cdfbe GIS 6591: Fixed if statement which outputs ITPD and OTPD - 468798e Update release notes whitespace - 4c2badc GIS-1621 - 16 bit integer is not printing correctly - 4c9a1aa GIS-6221 Vent the outlet bottle when purging to prevent "kick" on return from idle - 541c3bb GIS-6253: Added gravity flowmode - 5562461 GIS-6570 - Handle 0 length buffers being sent for TCP transmission; Add some logging for diagnosis - 577444e Update release notes for 1.5.5 - 5c6416b GIS-6416 - Instrument number of buffers on socket transmit queue and grapher empty buffer queue - 603de5a GIS-6221: Fixed more typos - 628b57d GIS 6221: Fixed typo - 6526df4 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 6da6243 GIS-6221 Changed purge configuration, return from purge still to do - 7d263d0 GIS 6591: Change the output of the settings command on Telnet for clarity - 83f5517 Update 1.5.5 release notes with known issues - 85fc901 GIS-6570 - Handle condition when no bytes are consumed by sck_send (because the connection has died) for TCP transmission; Add some logging for diagnosis - 8a2db28 GIS-6221 Corrected behaviour at idle. When idling, the pressure is now only vacuum pump driven in one direction. - 8df4c1b GIS-1621 - Settings BSP files have changed unexpectedly from 1.5.4 - maybe causing a slow down - 92c135e GIS 6462 Fixed typo - 9400923 GIS-6516: Slave resets from vent when master is reset - 9964521 GIS 6253: Added methods for gravity mode logging in inkchannelinterface.cpp/h - a1f0025 GIS 43: Added PreIdle with slaves in controlled flow master - a900a24 GIS-6221: Changed Idle to be driven from Inlet Side - b2f4383 GIS-1620 - Correct string print - b42ea46 GIS-1621 - Handle version prefix - b498cd5 GIS 6462 Added on the fly idle pressure change in shared pressure controlled flow - b4e1b8c GIS 6221: Resolved merge conflicts and applied fixes from 1.5.3 to the Type 2 High Pressure mode - bbc5e45 GIS 6221 - Changed High Pressure Type 2 to flowmode 6 - bd69b60 GIS-6253: Fixed typos - c568789 GIS 6221 - Bug fixes High Pressure Type 2 Flow mode - c666970 GIS-6570 - Add some logging for diagnosis - c7bbf29 Fixed shared controlled flow transition for purge all slaves to standby - c962c65 GIS-6221 Added Purge Return via Idle - ca1e7b5 GIS-6253: Added the files for gravity flowmode - ca4473b GIS-1621 - Only send pressure updates if there is a 4 point difference in value - cb06440 GIS 6221: Changed descriptions of Flowmodes. Changed output of settings to show purge pressure for flowmode 5 and 6 - d4dd54d GIS 6462: Added on-the-fly pressure change for Shared Pressure Controlled Flow systems - da69186 GIS 6492: Dumpconfig now outputs the software version - df64abd Revert "GIS-1621 - Only send pressure updates if there is a 4 point difference in value" - e51971f GIS 6379: The purge pressure is only shown on High Pressure systems (flowmode 4 and 5) - e6b0227 GIS-6221 Corrected vent operation for outlet bottle - ec13b60 GIS-6416 - Handle multiple writes to a TCP stream until it becomes busy - f018a86 GIS 6479: Added an applysettings command to allow on the fly pressure and temperature changes - f7109ff GIS 43: Added purge to idle transitions for Gravity Mode - f87280b GIS 43: Fixed transition in cfm - f999765 GIS-6253: Removed redundant function - ff37df8 GIS-6253: Fixed typos - ff92b79 GIS 6591: Added statement on Master settings From 4dbbbf2b4247eb39770d2c9f4d4498ed1f4a8c0d Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Dec 2017 13:13:23 +0000 Subject: [PATCH 11/19] Provide a comma seperated build stamp --- versionnumbering/versioninfo.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index c8c79fe..a4162e0 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -124,6 +124,10 @@ def writeversionfiles(versionfolder, buildjobname, versionprefix, gitrevision, r with open(os.path.join(versionfolder, "buildstamp.txt"), 'w') as f: f.write(buildstamp) + buildstampcommasep = buildstamp.replace(".", ",") + with open(os.path.join(versionfolder, "buildstampcommasep.txt"), 'w') as f: + f.write(buildstampcommasep) + def main(argv=None): # IGNORE:C0111 '''Command line options.''' From 584a016c493000ae456182f37b4c50bdf739f9c9 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Thu, 7 Dec 2017 13:33:27 +0000 Subject: [PATCH 12/19] Move code to common position --- build/eclipsebuild/eclipsebuild.gsh | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 build/eclipsebuild/eclipsebuild.gsh diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh new file mode 100644 index 0000000..e7dcd09 --- /dev/null +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -0,0 +1,34 @@ +// Build and export files +def doBuild(apps) { + for (appInfo in apps ) { + if (appInfo[0]) + { + retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) + if (isUnix()) { + sh "${BUILD_COMMAND} -build ${appInfo[1]}/${BUILD_VARIANT}" + } + else { + bat "%BUILD_COMMAND% -build ${appInfo[1]}/${BUILD_VARIANT}" + } + } + echo "Looking at: ${appInfo[2]}" + script { + env.destFolder = "${WORKSPACE}/export/${appInfo[1]}" + env.srcFile = "${WORKSPACE}/${appInfo[2]}" + } + dir (env.destFolder) { + if (appInfo[2]) { + echo "Copy ${srcFile} to ${destFolder}" + if (isUnix()) { + sh 'cp \"${srcFile}\" ${destFolder}' + } + else { + bat 'copy \"%srcFile%\" %destFolder%' + } + } + } + } + } +} + +return this; \ No newline at end of file From aeb712f07339a59e87b47703c71e9e4444313871 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 13:24:11 +0000 Subject: [PATCH 13/19] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index e7dcd09..579a413 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -1,23 +1,28 @@ // Build and export files def doBuild(apps) { for (appInfo in apps ) { - if (appInfo[0]) + env.build = appInfo[0] + env.project = appInfo[1] + env.variants = appInfo[2] + env.exportpath = appInfo[3] + if (build) { - retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) + for (build_variant in variants) { + retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) if (isUnix()) { - sh "${BUILD_COMMAND} -build ${appInfo[1]}/${BUILD_VARIANT}" + sh "${BUILD_COMMAND} -build ${project}/${build_variant}" } else { - bat "%BUILD_COMMAND% -build ${appInfo[1]}/${BUILD_VARIANT}" + bat "%BUILD_COMMAND% -build ${project}/${build_variant}" } } - echo "Looking at: ${appInfo[2]}" + echo "Export path at: ${exportpath}" script { - env.destFolder = "${WORKSPACE}/export/${appInfo[1]}" - env.srcFile = "${WORKSPACE}/${appInfo[2]}" + env.destFolder = "${WORKSPACE}/export/${project}" + env.srcFile = "${WORKSPACE}/${exportpath}" } dir (env.destFolder) { - if (appInfo[2]) { + if (exportpath) { echo "Copy ${srcFile} to ${destFolder}" if (isUnix()) { sh 'cp \"${srcFile}\" ${destFolder}' From 12a002f5a5dbe22a22255019d5ea27364005c179 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 15:35:20 +0000 Subject: [PATCH 14/19] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 1 + 1 file changed, 1 insertion(+) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 579a413..c7876d2 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -20,6 +20,7 @@ def doBuild(apps) { script { env.destFolder = "${WORKSPACE}/export/${project}" env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = "${srcFile}" } dir (env.destFolder) { if (exportpath) { From ff5b8f515e7514a31e5aecbb7022c8344b81f9a5 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 15:43:11 +0000 Subject: [PATCH 15/19] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index c7876d2..a4ee79a 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -20,16 +20,16 @@ def doBuild(apps) { script { env.destFolder = "${WORKSPACE}/export/${project}" env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = "${srcFile}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") } dir (env.destFolder) { if (exportpath) { - echo "Copy ${srcFile} to ${destFolder}" + echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh 'cp \"${srcFile}\" ${destFolder}' + sh 'cp \"${srcFileExpanded}\" ${destFolder}' } else { - bat 'copy \"%srcFile%\" %destFolder%' + bat 'copy \"%srcFileExpanded%\" %destFolder%' } } } From c21c6348a423654bb9a9d863863877b2bf4ba371 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 16:16:09 +0000 Subject: [PATCH 16/19] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 50 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index a4ee79a..6e24393 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -1,38 +1,38 @@ // Build and export files def doBuild(apps) { for (appInfo in apps ) { - env.build = appInfo[0] - env.project = appInfo[1] - env.variants = appInfo[2] - env.exportpath = appInfo[3] - if (build) - { + build = appInfo[0] + project = appInfo[1] + variants = appInfo[2] + exportpath = appInfo[3] + if (build) { for (build_variant in variants) { retry(3) { // Eclipse occasionally raises exceptions (rather than the builds failing) - if (isUnix()) { - sh "${BUILD_COMMAND} -build ${project}/${build_variant}" - } - else { - bat "%BUILD_COMMAND% -build ${project}/${build_variant}" - } - } - echo "Export path at: ${exportpath}" - script { - env.destFolder = "${WORKSPACE}/export/${project}" - env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") - } - dir (env.destFolder) { - if (exportpath) { - echo "Copy ${srcFileExpanded} to ${destFolder}" if (isUnix()) { - sh 'cp \"${srcFileExpanded}\" ${destFolder}' + sh "${BUILD_COMMAND} -build ${project}/${build_variant}" } else { - bat 'copy \"%srcFileExpanded%\" %destFolder%' + bat "%BUILD_COMMAND% -build ${project}/${build_variant}" } } - } + echo "Export path at: ${exportpath}" + script { + env.destFolder = "${WORKSPACE}/export/${project}" + env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + } + dir (env.destFolder) { + if (exportpath) { + echo "Copy ${srcFileExpanded} to ${destFolder}" + if (isUnix()) { + sh 'cp \"${srcFileExpanded}\" ${destFolder}' + } + else { + bat 'copy \"%srcFileExpanded%\" %destFolder%' + } + } + } + } } } } From e76809830b161294c1c832747423df3728ac033e Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 16:26:19 +0000 Subject: [PATCH 17/19] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 6e24393..351f9d5 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -17,7 +17,7 @@ def doBuild(apps) { } echo "Export path at: ${exportpath}" script { - env.destFolder = "${WORKSPACE}/export/${project}" + env.destFolder = "${WORKSPACE}/export/${build_variant}/${project}" env.srcFile = "${WORKSPACE}/${exportpath}" env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") } From 75d8716a0a6ceb1e53a64984fd9765b5323cb8f8 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Tue, 19 Dec 2017 16:30:18 +0000 Subject: [PATCH 18/19] Make variants of build all in one run --- build/eclipsebuild/eclipsebuild.gsh | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/build/eclipsebuild/eclipsebuild.gsh b/build/eclipsebuild/eclipsebuild.gsh index 351f9d5..26ed411 100644 --- a/build/eclipsebuild/eclipsebuild.gsh +++ b/build/eclipsebuild/eclipsebuild.gsh @@ -15,20 +15,22 @@ def doBuild(apps) { bat "%BUILD_COMMAND% -build ${project}/${build_variant}" } } - echo "Export path at: ${exportpath}" - script { - env.destFolder = "${WORKSPACE}/export/${build_variant}/${project}" - env.srcFile = "${WORKSPACE}/${exportpath}" - env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") - } - dir (env.destFolder) { - if (exportpath) { - echo "Copy ${srcFileExpanded} to ${destFolder}" - if (isUnix()) { - sh 'cp \"${srcFileExpanded}\" ${destFolder}' - } - else { - bat 'copy \"%srcFileExpanded%\" %destFolder%' + if (exportpath) { + echo "Export path at: ${exportpath}" + script { + env.destFolder = "${WORKSPACE}/export/${build_variant}/${project}" + env.srcFile = "${WORKSPACE}/${exportpath}" + env.srcFileExpanded = srcFile.replace("-BUILDVARIANT-", "${build_variant}") + } + dir (env.destFolder) { + if (exportpath) { + echo "Copy ${srcFileExpanded} to ${destFolder}" + if (isUnix()) { + sh 'cp \"${srcFileExpanded}\" ${destFolder}' + } + else { + bat 'copy \"%srcFileExpanded%\" %destFolder%' + } } } } From 82b7ef85bd50d57db1b3bdfe458430ca2c5ab8a8 Mon Sep 17 00:00:00 2001 From: Damian Smith Date: Fri, 12 Jan 2018 15:57:39 +0000 Subject: [PATCH 19/19] Update versioninfo.py so that default prefix ends with a period (1.30000.0.) --- versionnumbering/versioninfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versionnumbering/versioninfo.py b/versionnumbering/versioninfo.py index a4162e0..59b5225 100644 --- a/versionnumbering/versioninfo.py +++ b/versionnumbering/versioninfo.py @@ -68,7 +68,7 @@ def getGitRevision(gitrootpath, basenumber): def getVersionPrefix(sourcebranch): print("Determining version number prefix from source branch name: {0}".format(sourcebranch)) - defaultversionprefix = "1.30000.0" + defaultversionprefix = "1.30000.0." splits = sourcebranch.split('/') if len(splits) < 1: print("Source branch name is invalid. Defaulting to: {0}".format(defaultversionprefix))