# HG changeset patch # User paulb # Date 1093744731 0 # Node ID 523f924a230e0fc32caae82536e68032fdc50362 # Parent d2b3c44bb50b37ade88ddddcc92b113c88702315 [project @ 2004-08-29 01:58:51 by paulb] Added library copying to the build script. Moved the appname discovery to a separate function. diff -r d2b3c44bb50b -r 523f924a230e examples/JavaServlet/build.py --- a/examples/JavaServlet/build.py Sat Aug 28 20:24:19 2004 +0000 +++ b/examples/JavaServlet/build.py Sun Aug 29 01:58:51 2004 +0000 @@ -72,6 +72,9 @@ new_filename = filename[len(os.path.join(prefix, "x")) - 1:] copy_file(filename, os.path.join(destination, new_filename)) +def get_appname(handler): + return os.path.split(os.path.splitext(handler)[0])[1] + def make_app(handler, appdir, webstack_home): """ @@ -80,7 +83,7 @@ found. """ - appname = os.path.split(os.path.splitext(handler)[0])[1] + appname = get_appname(handler) print "Making", appname os.mkdir(appname) @@ -132,11 +135,22 @@ print " eg. .../WebStack-x.y/examples/Common/Simple" print " * The location of the WebStack package distribution." print " eg. .../WebStack-x.y" + print "You can also specify some additional libraries for the application..." + print " eg. $CATALINA_HOME/common/lib/activation.jar" + print " $CATALINA_HOME/common/lib/mail.jar" sys.exit(1) print "Making application directory..." make_app(sys.argv[1], sys.argv[2], sys.argv[3]) + if len(sys.argv) > 4: + print "Copying additional libraries..." + appname = get_appname(sys.argv[1]) + for library in sys.argv[4:]: + library_dir, library_name = os.path.split(library) + library_dest = os.path.join(appname, "WEB-INF", "lib", library_name) + copy_file(library, library_dest) + print "Now copy or move the application directory to your servlet container." # vim: tabstop=4 expandtab shiftwidth=4