1.1 --- a/examples/JavaServlet/build.py Sat Aug 28 20:24:19 2004 +0000
1.2 +++ b/examples/JavaServlet/build.py Sun Aug 29 01:58:51 2004 +0000
1.3 @@ -72,6 +72,9 @@
1.4 new_filename = filename[len(os.path.join(prefix, "x")) - 1:]
1.5 copy_file(filename, os.path.join(destination, new_filename))
1.6
1.7 +def get_appname(handler):
1.8 + return os.path.split(os.path.splitext(handler)[0])[1]
1.9 +
1.10 def make_app(handler, appdir, webstack_home):
1.11
1.12 """
1.13 @@ -80,7 +83,7 @@
1.14 found.
1.15 """
1.16
1.17 - appname = os.path.split(os.path.splitext(handler)[0])[1]
1.18 + appname = get_appname(handler)
1.19 print "Making", appname
1.20
1.21 os.mkdir(appname)
1.22 @@ -132,11 +135,22 @@
1.23 print " eg. .../WebStack-x.y/examples/Common/Simple"
1.24 print " * The location of the WebStack package distribution."
1.25 print " eg. .../WebStack-x.y"
1.26 + print "You can also specify some additional libraries for the application..."
1.27 + print " eg. $CATALINA_HOME/common/lib/activation.jar"
1.28 + print " $CATALINA_HOME/common/lib/mail.jar"
1.29 sys.exit(1)
1.30
1.31 print "Making application directory..."
1.32 make_app(sys.argv[1], sys.argv[2], sys.argv[3])
1.33
1.34 + if len(sys.argv) > 4:
1.35 + print "Copying additional libraries..."
1.36 + appname = get_appname(sys.argv[1])
1.37 + for library in sys.argv[4:]:
1.38 + library_dir, library_name = os.path.split(library)
1.39 + library_dest = os.path.join(appname, "WEB-INF", "lib", library_name)
1.40 + copy_file(library, library_dest)
1.41 +
1.42 print "Now copy or move the application directory to your servlet container."
1.43
1.44 # vim: tabstop=4 expandtab shiftwidth=4