summaryrefslogtreecommitdiff
path: root/java/makedist.py
diff options
context:
space:
mode:
authorMark Spruiell <mes@zeroc.com>2005-05-10 17:21:56 +0000
committerMark Spruiell <mes@zeroc.com>2005-05-10 17:21:56 +0000
commit45d140acbe2b1886456b40f1da46e69ea3e98484 (patch)
treece6c4383a9ee1f964b716d65d0dca840a36cae84 /java/makedist.py
parentremoving invalid assertion in finalizer (diff)
downloadice-45d140acbe2b1886456b40f1da46e69ea3e98484.tar.bz2
ice-45d140acbe2b1886456b40f1da46e69ea3e98484.tar.xz
ice-45d140acbe2b1886456b40f1da46e69ea3e98484.zip
remove generated directories; add -t option to skip building translators
Diffstat (limited to 'java/makedist.py')
-rwxr-xr-xjava/makedist.py76
1 files changed, 44 insertions, 32 deletions
diff --git a/java/makedist.py b/java/makedist.py
index ce9ad1d2402..256531f9703 100755
--- a/java/makedist.py
+++ b/java/makedist.py
@@ -19,6 +19,7 @@ def usage():
print "Options:"
print "-h Show this message."
print "-d Skip SGML documentation conversion."
+ print "-t Skip building translators and use the ones in PATH."
print "-v Be verbose."
print
print "If no tag is specified, HEAD is used."
@@ -31,10 +32,10 @@ def find(path, patt):
files = os.listdir(path)
for x in files:
fullpath = os.path.join(path, x);
+ if fnmatch.fnmatch(x, patt):
+ result.append(fullpath)
if os.path.isdir(fullpath) and not os.path.islink(fullpath):
result.extend(find(fullpath, patt))
- elif fnmatch.fnmatch(x, patt):
- result.append(fullpath)
return result
#
@@ -64,6 +65,7 @@ if sys.platform.startswith("win") or sys.platform.startswith("cygwin"):
#
tag = "-rHEAD"
skipDocs = 0
+skipTranslators = 0
verbose = 0
for x in sys.argv[1:]:
if x == "-h":
@@ -71,6 +73,8 @@ for x in sys.argv[1:]:
sys.exit(0)
elif x == "-d":
skipDocs = 1
+ elif x == "-t":
+ skipTranslators = 1
elif x == "-v":
verbose = 1
elif x.startswith("-"):
@@ -150,40 +154,41 @@ if not skipDocs:
#
# Build slice2java and slice2freezej.
#
-print "Building translators..."
-cwd = os.getcwd()
-os.chdir(os.path.join("ice", "src", "icecpp"))
-os.system("gmake")
-os.chdir(cwd)
-os.chdir(os.path.join("ice", "src", "IceUtil"))
-os.system("gmake")
-os.chdir(cwd)
-os.chdir(os.path.join("ice", "src", "Slice"))
-os.system("gmake")
-os.chdir(cwd)
-os.chdir(os.path.join("ice", "src", "slice2java"))
-os.system("gmake")
-os.chdir(cwd)
-os.chdir(os.path.join("ice", "src", "slice2freezej"))
-os.system("gmake")
-os.chdir(cwd)
+if not skipTranslators:
+ print "Building translators..."
+ cwd = os.getcwd()
+ os.chdir(os.path.join("ice", "src", "icecpp"))
+ os.system("gmake")
+ os.chdir(cwd)
+ os.chdir(os.path.join("ice", "src", "IceUtil"))
+ os.system("gmake")
+ os.chdir(cwd)
+ os.chdir(os.path.join("ice", "src", "Slice"))
+ os.system("gmake")
+ os.chdir(cwd)
+ os.chdir(os.path.join("ice", "src", "slice2java"))
+ os.system("gmake")
+ os.chdir(cwd)
+ os.chdir(os.path.join("ice", "src", "slice2freezej"))
+ os.system("gmake")
+ os.chdir(cwd)
-sys.path.append(os.path.join("ice", "config"))
-import TestUtil
+ sys.path.append(os.path.join("ice", "config"))
+ import TestUtil
-os.environ["PATH"] = os.path.join(cwd, "ice", "bin") + ":" + os.getenv("PATH", "")
+ os.environ["PATH"] = os.path.join(cwd, "ice", "bin") + ":" + os.getenv("PATH", "")
-if TestUtil.isHpUx():
- os.environ["SHLIB_PATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("SHLIB_PATH", "")
-elif TestUtil.isDarwin():
- os.environ["DYLD_LIBRARY_PATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("DYLD_LIBRRARY_PATH", "")
-elif TestUtil.isAIX():
- os.environ["LIBPATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("LIBPATH", "")
-else:
- os.environ["LD_LIBRARY_PATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("LD_LIBRARY_PATH", "")
+ if TestUtil.isHpUx():
+ os.environ["SHLIB_PATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("SHLIB_PATH", "")
+ elif TestUtil.isDarwin():
+ os.environ["DYLD_LIBRARY_PATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("DYLD_LIBRRARY_PATH", "")
+ elif TestUtil.isAIX():
+ os.environ["LIBPATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("LIBPATH", "")
+ else:
+ os.environ["LD_LIBRARY_PATH"] = os.path.join(cwd, "ice", "lib") + ":" + os.getenv("LD_LIBRARY_PATH", "")
-if os.environ.has_key("ICE_HOME"):
- del os.environ["ICE_HOME"]
+ if os.environ.has_key("ICE_HOME"):
+ del os.environ["ICE_HOME"]
#
# Remove files.
@@ -216,6 +221,13 @@ shutil.rmtree("lib")
os.mkdir("lib")
os.rename("Ice.jar", os.path.join("lib", "Ice.jar"))
+#
+# Remove "generated" subdirectories.
+#
+filesToRemove = find(".", "*generated") # generated, cgenerated, sgenerated
+for x in filesToRemove:
+ shutil.rmtree(x)
+
os.chdir(cwd)
#