From eb5adf40b8762e29d1256487f7fd228d29ba4b56 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Wed, 30 Oct 2013 17:40:16 +0000 Subject: [PATCH 01/15] build.xml: Package source archive including submodules --- build.xml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/build.xml b/build.xml index 9e23913a3c7..a5cb4d3b957 100644 --- a/build.xml +++ b/build.xml @@ -438,15 +438,40 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- - + + + + + + - + + + + + + + + + + + + + + + + + + From 67acc03e35ddd03b38c7b98fc078fdd2c360866a Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Tue, 5 Nov 2013 13:54:05 +0000 Subject: [PATCH 02/15] build: Add plainversion --- build.py | 20 +++++++++++++++++++- build.xml | 28 +++++++++++++++++----------- 2 files changed, 36 insertions(+), 12 deletions(-) diff --git a/build.py b/build.py index 5e2c1bbc893..7a0407cb842 100755 --- a/build.py +++ b/build.py @@ -100,13 +100,31 @@ def choose_omero_version(): if not omero_build: omero_version = re.sub("([-]DEV)?-\d+-[a-f0-9]+(-dirty)?",\ "-DEV", omero_version) - return [ "-Domero.version=%s%s" % (omero_version, omero_build) ] except: print "Error getting version for BUILD_NUMBER=%s" % omero_build if err: print err sys.exit(1) + command = [ find_java(), "omero",BUILD_PY,"-q","plainversion" ] + err = "" + try: + p = popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + omero_plain_version, err = p.communicate() + omero_plain_version = omero_plain_version.split()[1] + if not omero_build: + omero_plain_version = re.sub("([-]DEV)?-\d+-[a-f0-9]+(-dirty)?",\ + "-DEV", omero_plain_version) + except: + print "Error getting plain version for BUILD_NUMBER=%s" % omero_build + if err: + print err + sys.exit(1) + + + return [ "-Domero.version=%s%s" % (omero_version, omero_build), + "-Domero.plainversion=%s%s" % (omero_plain_version, omero_build) ] + def handle_tools(args): _ = os.path.sep.join diff --git a/build.xml b/build.xml index a5cb4d3b957..5ad74a28b6e 100644 --- a/build.xml +++ b/build.xml @@ -438,40 +438,40 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- - + - + - + - + - + - + - + - + - - + @@ -1070,6 +1070,12 @@ omero.version=${omero.version} ${version.describe}-ice${versions.ice_lib} + + + + ${version.describe} + + *.maxmem.* settings From 5f026b0203f277a5d192e2e5a0d568490db013b6 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Tue, 5 Nov 2013 14:00:43 +0000 Subject: [PATCH 03/15] build: Restore creation of broken OMERO.source in release-src - Correct version to use plainversion. - Add archive prefix. --- build.xml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build.xml b/build.xml index 5ad74a28b6e..a3c0e11864b 100644 --- a/build.xml +++ b/build.xml @@ -472,6 +472,16 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- includes="openmicroscopy-${omero.plainversion}/**" /> + + + + + + + + + + From 98ba84a99210e68965b4406b974b038907f55c44 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Tue, 5 Nov 2013 14:03:52 +0000 Subject: [PATCH 04/15] build: release-src ensures target exists --- build.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/build.xml b/build.xml index a3c0e11864b..5a537fbedc9 100644 --- a/build.xml +++ b/build.xml @@ -439,6 +439,7 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- + From fee1273f48ab1b64aa97292a22c5fc3803936204 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Wed, 6 Nov 2013 15:22:17 +0000 Subject: [PATCH 05/15] build: Create tar source archive as well as zip --- build.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build.xml b/build.xml index 5a537fbedc9..74da65029b9 100644 --- a/build.xml +++ b/build.xml @@ -472,6 +472,12 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- basedir="${target.dir}" includes="openmicroscopy-${omero.plainversion}/**" /> + From 8d86b1fea43abf325f342c9a705988967b5187af Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Thu, 14 Nov 2013 14:33:38 +0000 Subject: [PATCH 06/15] omeis: Remove obsolete CVS directory --- components/rendering/src/omeis/CVS/Entries | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 components/rendering/src/omeis/CVS/Entries diff --git a/components/rendering/src/omeis/CVS/Entries b/components/rendering/src/omeis/CVS/Entries deleted file mode 100644 index f383a02d18a..00000000000 --- a/components/rendering/src/omeis/CVS/Entries +++ /dev/null @@ -1,3 +0,0 @@ -D/ds//// -D/io//// -D/proxy//// From b5b4ac09ed744a1efda1bf1bd3fc5aa457f968f5 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Wed, 15 Jan 2014 14:23:14 +0000 Subject: [PATCH 07/15] build: Move git archive creation to components/antlib/scripts/source-archive --- build.xml | 54 ++-------------- components/antlib/scripts/source-archive | 78 ++++++++++++++++++++++++ 2 files changed, 83 insertions(+), 49 deletions(-) create mode 100755 components/antlib/scripts/source-archive diff --git a/build.xml b/build.xml index 74da65029b9..25930185149 100644 --- a/build.xml +++ b/build.xml @@ -440,55 +440,11 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + diff --git a/components/antlib/scripts/source-archive b/components/antlib/scripts/source-archive new file mode 100755 index 00000000000..6d1df89f3b3 --- /dev/null +++ b/components/antlib/scripts/source-archive @@ -0,0 +1,78 @@ +#!/usr/bin/python + +from __future__ import print_function + +import os +from subprocess import call, Popen, PIPE +import sys +import zipfile + +# Due to "git archive" not supporting archiving of submodules in +# addition to the base tree, this requires additional support in order +# to create a complete and functional source archive. +# +# This script archives the base tree, and then uses "git submodule +# foreach" to archive each submodule separately, setting the correct +# path prefix for each archive, so that they may all be unpacked in +# the same root to result in a complete and functional source tree. +# It then repacks each of these zip files into a single zip which is +# the source release, taking care to preserve timestamps and exectute +# permissions, etc. This is done via ZipInfo objects, and the +# repacking is done entirely in memory so that this should work on any +# platform irrespective of filesystem support for the archive +# attributes. It excludes .gitignore files at this point to avoid +# polluting the release with version control files. + +if __name__ == "__main__": + if len(sys.argv) != 3: + raise Exception('Usage: %s releasename targetdir') + + release = sys.argv[1] + target = os.path.abspath(sys.argv[2]) + + print("Releasing %s" % (release)) + + # Create base archive + base_archive_status = call(['git', 'archive', '--format', 'zip', + '--prefix', "%s/" % (release), + '--output', "%s/%s-base.zip" % (target, release), + 'HEAD']) + if base_archive_status != 0: + raise Exception('Failed to create git base archive') + + zips = list(["%s/%s-base.zip" % (target, release)]) + + # Create submodule archives + submodule_archive = Popen(['git', 'submodule', 'foreach', '--quiet', '--recursive', + "npath=\"$(echo \"$path\" | tr / _)\"; \ + zip=\"%s/%s-submod-${npath}.zip\"; \ + git archive --format zip --prefix \"%s/${path}/\" --output \"${zip}\" HEAD || exit 1; \ + echo \"${zip}\"" % (target, release, release)], + stdout=PIPE) + submodule_zips = submodule_archive.communicate()[0] + if submodule_archive.returncode != 0: + raise Exception('Failed to create git submodule archives') + + zips.extend(submodule_zips.splitlines()) + + # Create destination zip file + print(" - creating %s/%s.zip" % (target, release)) + basezip = zipfile.ZipFile("%s/%s.zip" % (target, release), 'w') + + # Repack each of the separate zips into the destination zip + for name in zips: + subzip = zipfile.ZipFile(name, 'r') + print(" - repacking %s" % (name)) + # Iterate over the ZipInfo objects from the archive + for info in subzip.infolist(): + # Skip unwanted .gitignore files + if os.path.basename(info.filename) == '.gitignore': + continue + # Repack a single zip object; preserve the metadata + # directly via the ZipInfo object and rewrite the content + # (which unfortunately requires decompression and + # recompression rather than a direct copy) + basezip.writestr(info, subzip.open(info.filename).read()) + + # Remove repacked zip + os.remove(name) From f797f5a4ca5090d997fe92ee8418ad10eba24431 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Mon, 3 Feb 2014 10:36:18 +0000 Subject: [PATCH 08/15] build: Embed version as gitversion.xml --- build.xml | 38 ++++++++++++++++++++---- components/antlib/scripts/source-archive | 23 ++++++++++---- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/build.xml b/build.xml index 25930185149..5913b837f0c 100644 --- a/build.xml +++ b/build.xml @@ -55,12 +55,17 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- + + + + + @@ -422,8 +427,8 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- - + @@ -438,15 +443,24 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- - + + + + + - + + + + - + + ${omero.plainversion}-ice${versions.ice_lib} + + + ${version.describe}-ice${versions.ice_lib} - + + + + ${omero.plainversion} + + + ${version.describe} + + *.maxmem.* settings diff --git a/components/antlib/scripts/source-archive b/components/antlib/scripts/source-archive index 6d1df89f3b3..057ea5c32bb 100755 --- a/components/antlib/scripts/source-archive +++ b/components/antlib/scripts/source-archive @@ -24,11 +24,16 @@ import zipfile # polluting the release with version control files. if __name__ == "__main__": - if len(sys.argv) != 3: - raise Exception('Usage: %s releasename targetdir') + if len(sys.argv) != 4: + raise Exception('Usage: %s releasename version targetdir') release = sys.argv[1] - target = os.path.abspath(sys.argv[2]) + version = sys.argv[2] + target = os.path.abspath(sys.argv[3]) + release = "%s-%s" % (release,version) + + if not os.path.isdir('.git'): + raise Exception('Releasing is only possible from a git repository') print("Releasing %s" % (release)) @@ -65,8 +70,8 @@ if __name__ == "__main__": print(" - repacking %s" % (name)) # Iterate over the ZipInfo objects from the archive for info in subzip.infolist(): - # Skip unwanted .gitignore files - if os.path.basename(info.filename) == '.gitignore': + # Skip unwanted git and travis files + if os.path.basename(info.filename) == '.gitignore' or os.path.basename(info.filename) == '.gitmodule' or os.path.basename(info.filename) == '.travis.yml': continue # Repack a single zip object; preserve the metadata # directly via the ZipInfo object and rewrite the content @@ -76,3 +81,11 @@ if __name__ == "__main__": # Remove repacked zip os.remove(name) + + # Embed release number + basezip.writestr("%s/components/antlib/resources/gitversion.xml" % (release), +""" + + + +""" % (version)) From 35b6680aa9661e403c9bcf16d3a7a97543dd6012 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Mon, 3 Feb 2014 14:42:33 +0000 Subject: [PATCH 09/15] build: Embed short version for documentation --- build.xml | 21 ++++++++++++++++----- components/antlib/scripts/source-archive | 12 +++++++----- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/build.xml b/build.xml index 5913b837f0c..7258b60bbed 100644 --- a/build.xml +++ b/build.xml @@ -454,6 +454,7 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- + @@ -565,14 +566,12 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- - - - - + + - + @@ -1075,6 +1074,18 @@ omero.version=${omero.version} + + ${omero.shortversion} + + + + + + ${version.describe} + + + + *.maxmem.* settings diff --git a/components/antlib/scripts/source-archive b/components/antlib/scripts/source-archive index 057ea5c32bb..8e75b19d66c 100755 --- a/components/antlib/scripts/source-archive +++ b/components/antlib/scripts/source-archive @@ -24,12 +24,13 @@ import zipfile # polluting the release with version control files. if __name__ == "__main__": - if len(sys.argv) != 4: - raise Exception('Usage: %s releasename version targetdir') + if len(sys.argv) != 5: + raise Exception('Usage: %s releasename shortversion fullversion targetdir') release = sys.argv[1] - version = sys.argv[2] - target = os.path.abspath(sys.argv[3]) + shortversion = sys.argv[2] + version = sys.argv[3] + target = os.path.abspath(sys.argv[4]) release = "%s-%s" % (release,version) if not os.path.isdir('.git'): @@ -86,6 +87,7 @@ if __name__ == "__main__": basezip.writestr("%s/components/antlib/resources/gitversion.xml" % (release), """ + -""" % (version)) +""" % (shortversion, version)) From 0d69c913ed8b2fc92909f2a2a6156fc2712e8b7c Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Mon, 3 Feb 2014 14:56:19 +0000 Subject: [PATCH 10/15] build: Restore release-src as release-all dependency --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index 7258b60bbed..e0121aefd74 100644 --- a/build.xml +++ b/build.xml @@ -428,7 +428,7 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- + depends="release-clients,release-webstart,release-zip,release-src,release-docs"> From 04ab4ed4b9c4bca4357d1c43c75b30da807fe1c0 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Mon, 3 Feb 2014 15:01:28 +0000 Subject: [PATCH 11/15] build: build.py sets omero.shortversion --- build.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/build.py b/build.py index 7a0407cb842..0c1ba9caf43 100755 --- a/build.py +++ b/build.py @@ -121,9 +121,24 @@ def choose_omero_version(): print err sys.exit(1) + command = [ find_java(), "omero",BUILD_PY,"-q","shortversion" ] + err = "" + try: + p = popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + omero_short_version, err = p.communicate() + omero_short_version = omero_short_version.split()[1] + if not omero_build: + omero_short_version = re.sub("([-]DEV)?-\d+-[a-f0-9]+(-dirty)?",\ + "-DEV", omero_short_version) + except: + print "Error getting short version for BUILD_NUMBER=%s" % omero_build + if err: + print err + sys.exit(1) return [ "-Domero.version=%s%s" % (omero_version, omero_build), - "-Domero.plainversion=%s%s" % (omero_plain_version, omero_build) ] + "-Domero.plainversion=%s" % (omero_plain_version), + "-Domero.shortversion=%s" % (omero_short_version) ] def handle_tools(args): From 5c06ba25e47b6df352b3faac36a6bbc730dbc94c Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Mon, 3 Feb 2014 15:20:51 +0000 Subject: [PATCH 12/15] Revert "build: Restore release-src as release-all dependency" This reverts commit 5b0098333130d3b01eb3aaa081ab188589dfe354. --- build.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.xml b/build.xml index e0121aefd74..7258b60bbed 100644 --- a/build.xml +++ b/build.xml @@ -428,7 +428,7 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- + depends="release-clients,release-webstart,release-zip,release-docs"> From b4c592f31a3ce0b26f66f7927126c7276d81e9c6 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Mon, 3 Feb 2014 15:25:06 +0000 Subject: [PATCH 13/15] build: source-archive: Manually flush stdout --- components/antlib/scripts/source-archive | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/antlib/scripts/source-archive b/components/antlib/scripts/source-archive index 8e75b19d66c..cddca607f2f 100755 --- a/components/antlib/scripts/source-archive +++ b/components/antlib/scripts/source-archive @@ -37,6 +37,7 @@ if __name__ == "__main__": raise Exception('Releasing is only possible from a git repository') print("Releasing %s" % (release)) + sys.stdout.flush() # Create base archive base_archive_status = call(['git', 'archive', '--format', 'zip', @@ -63,12 +64,14 @@ if __name__ == "__main__": # Create destination zip file print(" - creating %s/%s.zip" % (target, release)) + sys.stdout.flush() basezip = zipfile.ZipFile("%s/%s.zip" % (target, release), 'w') # Repack each of the separate zips into the destination zip for name in zips: subzip = zipfile.ZipFile(name, 'r') print(" - repacking %s" % (name)) + sys.stdout.flush() # Iterate over the ZipInfo objects from the archive for info in subzip.infolist(): # Skip unwanted git and travis files From 76f18863d84709a494e6aa43b29016ce16e0b733 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Mon, 3 Feb 2014 16:03:41 +0000 Subject: [PATCH 14/15] build: source-archive: Generalise version filename --- build.xml | 1 + components/antlib/scripts/source-archive | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/build.xml b/build.xml index 7258b60bbed..2cbddcc557d 100644 --- a/build.xml +++ b/build.xml @@ -456,6 +456,7 @@ To get started using Eclipse, execute "./build.py build-dev" and import the top- + diff --git a/components/antlib/scripts/source-archive b/components/antlib/scripts/source-archive index cddca607f2f..a36a29cd05d 100755 --- a/components/antlib/scripts/source-archive +++ b/components/antlib/scripts/source-archive @@ -24,13 +24,14 @@ import zipfile # polluting the release with version control files. if __name__ == "__main__": - if len(sys.argv) != 5: - raise Exception('Usage: %s releasename shortversion fullversion targetdir') + if len(sys.argv) != 6: + raise Exception('Usage: %s releasename shortversion fullversion versionfile targetdir') release = sys.argv[1] shortversion = sys.argv[2] version = sys.argv[3] - target = os.path.abspath(sys.argv[4]) + versionfile = sys.argv[4] + target = os.path.abspath(sys.argv[5]) release = "%s-%s" % (release,version) if not os.path.isdir('.git'): @@ -87,7 +88,7 @@ if __name__ == "__main__": os.remove(name) # Embed release number - basezip.writestr("%s/components/antlib/resources/gitversion.xml" % (release), + basezip.writestr("%s/%s" % (release, versionfile), """ From a092b553d6a7f17947d3251317c16f7a8ab640e8 Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Tue, 4 Feb 2014 10:04:25 +0000 Subject: [PATCH 15/15] OMERO.sh: Create source release --- docs/hudson/OMERO.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/hudson/OMERO.sh b/docs/hudson/OMERO.sh index fff295b81df..a287a7c8d7b 100644 --- a/docs/hudson/OMERO.sh +++ b/docs/hudson/OMERO.sh @@ -15,6 +15,10 @@ echo Building $OMERO_BRANCH ./build.py clean ./build.py build-default test-compile ./build.py release-all +if [ -d .git ] +then + ./build.py release-src +fi # Log information echo BUILD_NUMBER=$BUILD_NUMBER > target/$OMERO_BRANCH.log