tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Raghavan <jayragha...@yahoo.com>
Subject can you spot the error in my build.{xml/bat} file
Date Tue, 31 Oct 2000 18:49:22 GMT
I am trying to get my ant build going but get this
error:
BUILD FATAL ERROR: srcdir does not exist!

All else goes well, i.e. the destination dir structure
etc. get created, files get copied.  java compilation
using javac is where the really problem as it cannot
find the source directory.

My build.xml:
<project name="Hello, World" default="dist"
basedir=".">

<!-- Simple "Hello, World" project to provide a
concrete example of
     the recommendations in the Application
Developer's Guide.

     NOTE:  Before using this file as is, you should
review the
     values for the properties that are defined below.
     In particular, it is assumed that you wish to
install this
     application under context path "/myapp" in the
Tomcat installation
     defined by your TOMCAT_HOME environment variable.
-->

<!-- set global properties for this build -->
  <property name="app.name"       value="myapp"/>
  <property name="deploy.home"   
value="${tomcat.home}/webapps/${app.name}"/>
  <property name="dist.home"     
value="${deploy.home}"/>
  <property name="dist.jar"      
value="${app.name}.jar"/>
  <property name="dist.war"      
value="${app.name}.war"/>
  <property name="javadoc.home"  
value="${deploy.home}/javadoc"/>
  <property name="sourceDir"	  value="."/>


  <target name="prepare">
    <mkdir dir="${deploy.home}"/>
    <copydir src="web" dest="${deploy.home}"/>
    <mkdir dir="${deploy.home}/WEB-INF"/>
    <copyfile src="etc/web.xml"
dest="${deploy.home}/WEB-INF/web.xml"/>
    <mkdir dir="${deploy.home}/WEB-INF/classes"/>
    <mkdir dir="${deploy.home}/WEB-INF/lib"/>
    <copydir src="lib" dest="${deploy.home}/lib"/>
    <mkdir dir="${javadoc.home}"/>
  </target>


  <target name="clean">
    <deltree dir="${deploy.home}"/>
  </target>


  <target name="compile" depends="prepare">
    <javac srcdir="${sourceDir}"
destdir="${deploy.home}/WEB-INF/classes"
           classpath="${deploy.home}/WEB-INF/classes"
           debug="on" optimize="off"
deprecation="off"/>
  </target>


  <target name="javadoc" depends="prepare">
    <!-- TODO -->
  </target>


  <target name="all"
depends="clean,prepare,compile,javadoc">
  </target>


  <target name="dist" depends="prepare,compile">
    <jar jarfile="${dist.home}/${dist.jar}"
         basedir="." items="*"/>
    <jar jarfile="${dist.home}/${dist.war}"
         basedir="${deploy.home}" items="*"/>
  </target>


</project>

my build.bat:
@echo off
rem build.bat -- Build Script for the "Hello, World"
Application
rem $Id: build.bat,v 1.1 2000/04/04 22:01:13 craigmcc
Exp $

if "%CLASSPATH%" == "" goto noclasspath

:haveclasspath
set _CLASSPATH=%CLASSPATH%
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME\classes
goto restofclasspath

:noclasspath
set _CLASSPATH=
set CLASSPATH=%TOMCAT_HOME%\classes

:restofclasspath
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\ant.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\jasper.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\servlet.jar
set
CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\webserver.jar
set CLASSPATH=%CLASSPATH%;%TOMCAT_HOME%\lib\xml.jar

rem Execute ANT to perform the requested build target
java org.apache.tools.ant.Main
-Dtomcat.home=%TOMCAT_HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9

set CLASSPATH=%_CLASSPATH%
set _CLASSPATH=


all help appreciated.

Jay



=====
Jay Raghavan

__________________________________________________
Do You Yahoo!?
Yahoo! Messenger - Talk while you surf!  It's FREE.
http://im.yahoo.com/

Mime
View raw message