diff options
author | Mark Spruiell <mes@zeroc.com> | 2003-02-05 03:08:15 +0000 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2003-02-05 03:08:15 +0000 |
commit | b7164277e3a3377c5d3eb5337c204482bd95f992 (patch) | |
tree | 9863cde99cb4f4dd177937cd8da8638e5293823f /java | |
parent | Added interrupted() member function to Ice.Application, as for the C++ (diff) | |
download | ice-b7164277e3a3377c5d3eb5337c204482bd95f992.tar.bz2 ice-b7164277e3a3377c5d3eb5337c204482bd95f992.tar.xz ice-b7164277e3a3377c5d3eb5337c204482bd95f992.zip |
adding makebindist.py
Diffstat (limited to 'java')
-rwxr-xr-x | java/makebindist.py | 171 | ||||
-rwxr-xr-x | java/makedist.py | 126 |
2 files changed, 198 insertions, 99 deletions
diff --git a/java/makebindist.py b/java/makebindist.py new file mode 100755 index 00000000000..cceb80c9cbf --- /dev/null +++ b/java/makebindist.py @@ -0,0 +1,171 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003 +# ZeroC, Inc. +# Billerica, MA, USA +# +# All Rights Reserved. +# +# Ice is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License version 2 as published by +# the Free Software Foundation. +# +# ********************************************************************** + +import os, sys, shutil, fnmatch, re + +# +# Show usage information. +# +def usage(): + print "Usage: " + sys.argv[0] + " [options] [tag]" + print + print "Options:" + print "-h Show this message." + print + print "If no tag is specified, HEAD is used." + +# +# Check arguments +# +tag = "-rHEAD" +for x in sys.argv[1:]: + if x == "-h": + usage() + sys.exit(0) + elif x.startswith("-"): + print sys.argv[0] + ": unknown option `" + x + "'" + print + usage() + sys.exit(1) + else: + tag = "-r" + x + +if not os.environ.has_key("ICE_HOME"): + print "The ICE_HOME environment variable is not set." + sys.exit(1) + +# +# Remove any existing distribution directory and create a new one. +# +distdir = "bindist" +if os.path.exists(distdir): + shutil.rmtree(distdir) +os.mkdir(distdir) +os.chdir(distdir) +cwd = os.getcwd() + +# +# Export Config.h from CVS. +# +os.system("cvs -z5 -d cvs.mutablerealms.com:/home/cvsroot export " + tag + " ice/include/IceUtil/Config.h") + +# +# Get Ice version. +# +config = open("ice/include/IceUtil/Config.h", "r") +version = re.search("ICE_STRING_VERSION \"([0-9\.]*)\"", config.read()).group(1) + +# +# Verify Ice version in CVS export matches the one in ICE_HOME. +# +config = open(os.environ["ICE_HOME"] + "/include/IceUtil/Config.h", "r") +version2 = re.search("ICE_STRING_VERSION \"([0-9\.]*)\"", config.read()).group(1) + +shutil.rmtree("ice") + +if version != version2: + print sys.argv[0] + ": the CVS version (" + version + ") does not match ICE_HOME (" + version2 + ")" + sys.exit(1) + +icever = "Ice-" + version +os.mkdir(icever) + +# +# Get platform. +# +platform = "" +if sys.platform.startswith("win") or sys.platform.startswith("cygwin"): + platform = "win32" +elif sys.platform.startswith("linux"): + platform = "linux" +else: + print "unknown platform (" + sys.platform + ")!" + sys.exit(1) + +# +# Copy executables and libraries. +# +icehome = os.environ["ICE_HOME"] +executables = [ ] +libraries = [ ] +symlinks = 0 +if platform == "win32": + winver = version.replace(".", "") + debug = "" + if not os.path.exists(icehome + "/bin/glacier" + winver + ".dll"): + debug = "d" + executables = [ \ + "glacier.exe",\ + "icecpp.exe",\ + "slice2freezej.exe",\ + "slice2java.exe",\ + "slice2xsd.exe",\ + "glacier" + winver + debug + ".dll",\ + "icessl" + winver + debug + ".dll",\ + "ice" + winver + debug + ".dll",\ + "iceutil" + winver + debug + ".dll",\ + "slice" + winver + debug + ".dll",\ + ] + libraries = [ \ + ] +else: + executables = [ \ + "glacierrouter",\ + "glacierstarter",\ + "icecpp",\ + "slice2freezej",\ + "slice2java",\ + "slice2xsd",\ + ] + libraries = [ \ + "libGlacier.so",\ + "libIceSSL.so",\ + "libIce.so",\ + "libIceUtil.so",\ + "libSlice.so",\ + ] + symlinks = 1 + +bindir = icever + "/bin" +libdir = icever + "/lib" +os.mkdir(bindir) +os.mkdir(libdir) +for x in executables: + shutil.copyfile(icehome + "/bin/" + x, bindir + "/" + x) +if symlinks: + for x in libraries: + libname = x + '.' + version + shutil.copyfile(icehome + "/lib/" + libname, libdir + "/" + libname) + os.chdir(libdir) + os.symlink(libname, x) + os.chdir(cwd) +else: + for x in libraries: + shutil.copyfile(icehome + "/lib/" + x, libdir + "/" + x) + +# +# Create binary archives. +# +os.system("tar cvzf " + icever + "-bin-" + platform + ".tar.gz " + icever) +os.system("zip -9ry " + icever + "-bin-" + platform + ".zip " + icever) + +# +# Copy files (README, etc.). +# + +# +# Done. +# +shutil.rmtree(icever) diff --git a/java/makedist.py b/java/makedist.py index 7caad318615..edac88150b9 100755 --- a/java/makedist.py +++ b/java/makedist.py @@ -23,8 +23,6 @@ def usage(): print print "Options:" print "-h Show this message." - print "-b Create a platform-specific binary archives. If not specified," - print " only source archives will be created." print "-d Skip SGML documentation conversion." print print "If no tag is specified, HEAD is used." @@ -44,20 +42,19 @@ def find(path, patt): return result # +# Are we on Windows? +# +win32 = sys.platform.startswith("win") or sys.platform.startswith("cygwin") + +# # Check arguments # tag = "-rHEAD" -binary = 0 skipDocs = 0 for x in sys.argv[1:]: if x == "-h": usage() sys.exit(0) - elif x == "-b": - if not os.environ.has_key("ICE_HOME"): - print "The ICE_HOME environment variable is not set." - sys.exit(1) - binary = 1 elif x == "-d": skipDocs = 1 elif x.startswith("-"): @@ -68,6 +65,10 @@ for x in sys.argv[1:]: else: tag = "-r" + x +if win32 and not skipDocs: + print sys.argv[0] + ": the documentation cannot be built on Windows." + sys.exit(1) + # # Remove any existing "dist" directory and create a new one. # @@ -138,10 +139,27 @@ for x in filesToRemove: os.remove(x) # +# Build sources. +# +cwd = os.getcwd() +os.chdir("icej") +os.system("ant") + +# +# Clean out the lib directory but save Ice.jar. +# +os.rename(os.path.join("lib", "Ice.jar"), "Ice.jar") +shutil.rmtree("lib") +os.mkdir("lib") +os.rename("Ice.jar", os.path.join("lib", "Ice.jar")) + +os.chdir(cwd) + +# # Get Ice version. # config = open(os.path.join("icej", "src", "IceUtil", "Version.java"), "r") -version = re.search("ICE_STRING_VERSION = \"(.*)\"", config.read()).group(1) +version = re.search("ICE_STRING_VERSION = \"([0-9\.]*)\"", config.read()).group(1) # # Create source archives. @@ -156,96 +174,6 @@ os.system("zip -9 -r " + icever + ".zip " + icever) # # -# Create binary archives if requested. -# -if binary: - cwd = os.getcwd() - os.chdir(icever) - - # - # Build classes. - # - os.system("ant") - - os.chdir(cwd) - - # - # Get platform. - # - platform = "" - if sys.platform.startswith("win") or sys.platform.startswith("cygwin"): - platform = "win32" - elif sys.platform.startswith("linux"): - platform = "linux" - else: - print "unknown platform!" - sys.exit(1) - - # - # Copy executables and libraries. - # - executables = [ ] - libraries = [ ] - symlinks = 0 - if platform == "win32": - winver = version.replace(".", "") - executables = [ \ - "glacierrouter.exe",\ - "glacierstarter.exe",\ - "icecpp.exe",\ - "slice2freezej.exe",\ - "slice2java.exe",\ - "slice2xsd.exe",\ - ] - libraries = [ \ - "glacier" + winver + ".dll",\ - "icessl" + winver + ".dll",\ - "ice" + winver + ".dll",\ - "iceutil" + winver + ".dll",\ - "slice" + winver + ".dll",\ - ] - else: - executables = [ \ - "glacierrouter",\ - "glacierstarter",\ - "icecpp",\ - "slice2freezej",\ - "slice2java",\ - "slice2xsd",\ - ] - libraries = [ \ - "libGlacier.so",\ - "libIceSSL.so",\ - "libIce.so",\ - "libIceUtil.so",\ - "libSlice.so",\ - ] - symlinks = 1 - - bindir = os.path.join(icever, "bin") - libdir = os.path.join(icever, "lib") - os.mkdir(bindir) - icehome = os.environ["ICE_HOME"] - for x in executables: - shutil.copyfile(os.path.join(icehome, "bin", x), os.path.join(bindir, x)) - if symlinks: - for x in libraries: - libname = x + '.' + version - shutil.copyfile(os.path.join(icehome, "lib", libname), os.path.join(libdir, libname)) - os.chdir(libdir) - os.symlink(libname, x) - os.chdir(cwd) - else: - for x in libraries: - shutil.copyfile(os.path.join(icehome, "lib", x), os.path.join(libdir, x)) - - # - # Create binary archives. - # - os.system("tar cvzf " + icever + "-bin-" + platform + ".tar.gz " + icever) - os.system("zip -9ry " + icever + "-bin-" + platform + ".zip " + icever) - -# # Done. # shutil.rmtree(icever) |