1.1 --- a/tools/JavaServlet/build.py Tue Sep 21 18:00:01 2004 +0000
1.2 +++ b/tools/JavaServlet/build.py Tue Sep 21 18:00:29 2004 +0000
1.3 @@ -75,12 +75,12 @@
1.4 def get_appname(handler):
1.5 return os.path.split(os.path.splitext(handler)[0])[1]
1.6
1.7 -def make_app(handler, appdir, webstack_home):
1.8 +def make_app(handler, appdir, webstack_home, web_xml_template_name):
1.9
1.10 """
1.11 Make the application directory from the given 'handler', application
1.12 - directory 'appdir' and the 'webstack_home' where the WebStack package can be
1.13 - found.
1.14 + directory 'appdir', the 'webstack_home' where the WebStack package can be
1.15 + found, and the deployment descriptor with the given 'web_xml_template_name'.
1.16 """
1.17
1.18 appname = get_appname(handler)
1.19 @@ -118,7 +118,7 @@
1.20
1.21 # Configure the deployment descriptor.
1.22
1.23 - f = open(os.path.join(webstack_home, "tools", "JavaServlet", "web.xml"))
1.24 + f = open(os.path.join(webstack_home, "tools", "JavaServlet", web_xml_template_name))
1.25 web_xml = f.read()
1.26 f.close()
1.27 web_xml = web_xml % (jython_home, handler_filename)
1.28 @@ -131,7 +131,7 @@
1.29
1.30 if __name__ == "__main__":
1.31 import sys
1.32 - if len(sys.argv) < 4:
1.33 + if len(sys.argv) < 5:
1.34 print "Please specify..."
1.35 print " * The location of the application handler."
1.36 print " eg. .../WebStack-x.y/examples/JavaServlet/SimpleApp.py"
1.37 @@ -139,18 +139,20 @@
1.38 print " eg. .../WebStack-x.y/examples/Common/Simple"
1.39 print " * The location of the WebStack package distribution."
1.40 print " eg. .../WebStack-x.y"
1.41 + print " * The name of the deployment descriptor template."
1.42 + print " eg. web.xml"
1.43 print "You can also specify some additional libraries for the application..."
1.44 print " eg. $CATALINA_HOME/common/lib/activation.jar"
1.45 print " $CATALINA_HOME/common/lib/mail.jar"
1.46 sys.exit(1)
1.47
1.48 print "Making application directory..."
1.49 - make_app(sys.argv[1], sys.argv[2], sys.argv[3])
1.50 + make_app(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4])
1.51
1.52 - if len(sys.argv) > 4:
1.53 + if len(sys.argv) > 5:
1.54 print "Copying additional libraries..."
1.55 appname = get_appname(sys.argv[1])
1.56 - for library in sys.argv[4:]:
1.57 + for library in sys.argv[5:]:
1.58 library_dir, library_name = os.path.split(library)
1.59 library_dest = os.path.join(appname, "WEB-INF", "lib", library_name)
1.60 copy_file(library, library_dest)