Re: Enhydra 5.1 always recompiling dods

Mathieu MANGEOT-NAGATA <[email protected]> Mon, 5 Jan 2004 23:06:21 +0900
Newsgroups gmane.comp.java.enhydra.general
Message-ID <[email protected]>
Hello Sinisa, Petr,

I am compiling my project with enhydra5.1 that I compiled before with  
enhydra5.0 and
I have the same problem as Petr: when I execute ant make, ant executes  
everytime the dods task and regenerates every time the dods java  
classes. (I have no pb with the XMLC task by the way).

I added the force="false" attribute on the dods and XMLC tasks as you  
indicated in my build.xml file but in my case it did not change  
anything. Could you please send me any build.xml file that is OK?

Here is the output of the compiler when I relaunch ant without   
touching anything:
dods:
      [dods] Buildfile:  
/Library/Java/Extensions/enhydra5.1/dods/build/generate.xml
      [dods] dods:copy_doml:
      [dods] dods:create_tables_file:
      [dods] Regenerating DODS files from  
/Projects/PapillonEnh5.1/papillon.doml...
      [dods] dods:build_java:
      [dods]      [ejen]   Creating  
'/Projects/PapillonEnh5.1/classes/DODS_Generated_Source/main/data/ 
build_java.xml'
      [dods]      [ejen]   Creating  
'/Projects/PapillonEnh5.1/classes/DODS_Generated_Source/main/data/ 
build_sql.xml'
      [dods] dods:build_dods:
      [dods]      [ejen]   Creating  
'/Projects/PapillonEnh5.1/classes/DODS_Generated_Source/main/data/ 
build_dods.xml'
      [dods]      [copy] Copying 1 file to  
/Projects/PapillonEnh5.1/classes/DODS_Generated_Source/main/data
      [dods] dods:java:
      [dods] validate:
      [dods] [xmlvalidate] 1 file(s) have been successfully validated.
      [dods] dods:
      [dods] Regenerating DODS files from  
/Projects/PapillonEnh5.1/classes/DODS_Generated_Source/main/data/ 
papillon.doml...
      [dods] [DODS_XMLBuilder] Creating TransientXML
      [dods] [DODS_XMLBuilder] Creating  
/Projects/PapillonEnh5.1/classes/DODS_Generated_Source/main/data/main/ 
data/VolumeEntry.xml


I send here attached my build.xml file if you want to have a look.

Thank you for your help!

Mathieu


On 23 déc. 03, at 20:25, Sinisa Milosevic wrote:
> Hi,
>     If you don't want your source code to be compiled every time you  
> run the project, please change your running target from Rebuild to  
> Make.
>   Steps for changing running target:
>         1. Go to "Project" submenu (of JBuilder's main many) and chose  
> "Project Properties.." option,
>         2. Chose "Run" tab, chose your "Runtime configuration"  
> (probably the only one suggested) and click on "Edit" button,
>         3. Change "Build target" combo option from Rebuild to Make and  
> close two opened dialogs by pressing "OK" button.
> This should make you source code (java files placed in src  
> folder) compiled only if it's changed (Make target should not delete  
> classes directory on it's execution like Rebuild target).
> ----------------------------------------------------------------------- 
> -------------------
> Initially, XMLC is set to process input pages every time also.
> To change this, please edit projects build.xml file.
>
> Operation is rather simple:
>         Just comment
>             <delete dir="${basedir}/xmlc_for_compile"/>
>         command placed (hopefully) at the end of target named  
> "makexmlc". 
>
> Now, XMLC will process only the pages, which source is changed, and  
> everything else will remain as is.
> ----------------------------------------------------------------------- 
> -----------------------
> Also, initially, DODS is set to generate source code every time.
> To change this, you'll have to edit projects build.xml file (again).
>        
>  Just change initial setting of dods attribute  'force' to  
> "false".(placed in dods task, which is called in target named "dods" -  
> as a default, this attribute is set to "true").
>  Now, only if you change *.doml file new source code will be generated.
>     Sinisa Milosevic,
>
>     Together Serbia
> On Mon, 2003-12-22 at 15:52, Petr Stehlik wrote:
> Hi,
>
> JBuilder9 keeps recompiling the whole project even if there is no  
> change
> in source files - whenever I click on 'Run' it starts with XMLC and  
> then
> the whole java source files set.
>
> Any idea how to fix this?
> Petr

Mathieu MANGEOT-NAGATA
Visiting Researcher National Institute of Informatics
Hitotsubashi 2-1-2-1913 Chiyoda-ku Tokyo 101-8430 Japan
Tel: +81-3-4212-2672    Fax: +81-3-3556-1916
http://www-clips.imag.fr/geta/mathieu.mangeot
Papillon project: http://www.papillon-dictionary.org
build.xml (application/octet-stream, 13.1 KB)
<?xml version="1.0"?>
<!-- ===================================================================

   Build file for Papillon

Build Instructions:
   To build, run

     <enhydra_root>bin/ant <target>

   on the directory where this file is located with the target you want.

Most useful targets:

 - make     -> create ./output (default)
 - rebuild  -> create ./output from scratch
 - clean    -> remove all files from ./classes and ./output
 - compile  -> compile source to ./classes with javac and xmlc
 - javadocs -> creates the javadocs in "./output/javadocs"

==================================================================== -->

<project name="Papillon"
         default="make"
         basedir=".">

    <taskdef name="xmlc" classname="com.lutris.ant.taskdefs.Xmlc"/>
    <taskdef name="dods" classname="org.enhydra.ant.taskdefs.Dods"/>
  <!-- =================================================================== -->
  <!-- Initialize the properties                                           -->
  <!-- =================================================================== -->

  <!-- Set up application values -->
  <property name="project.name"    value="Papillon"/>
  <property name="project.package" value="main"/>
  <property name="project.version" value="1.5"/>
  <property name="project.year"    value="2002"/>


  <!-- PAPILLON-SPECIFIC -->
  <!-- Load the properties that are specific to the papillon conf -->
  <property file="papillon.properties"/>
	
  <!-- directory locations -->
  <property name="dir.package"   value="main"/>
  <!-- Defined in papillon.properties file -->
  <!-- property name="enhydra.root"  value="/Library/Java/Extensions/enhydra5.0"/ -->
  <!-- property name="enhydra.dir"   location="/Library/Java/Extensions/enhydra5.0"/ -->

  <property name="dir.classes"   location="classes"/>
  <property name="dir.input"     location="input"/>
  <property name="dir.java"      location="${java.home}/" />
  <property name="dir.src"       location="src"/>
  <property name="dir.sql"       location="sql"/>
  <property name="dir.output"    location="output"/>
  <property name="dir.project"   location="."/>
  <property name="dir.lib"       location="${dir.output}/lib"/>
  <property name="dir.javadocs"  location="${dir.output}/javadocs"/>
  <property name="dir.xmlc"      location="${dir.classes}/XMLC_Generated_Source/"/>

  <!-- DODS -->
  <property name="dodsbuild.dir" value="${dir.classes}/DODS_Generated_Source/main/data"/>
  <property name="xmlc.dir" 		value="${enhydra.root}/bin"/>
  <property name="xmlcbuild.dir" value="${dir.src}/main/presentation"/>
  <property name="xmlcresources.dir" value="${dir.src}/main/resources"/>
  <property name="enhydra.liboutput" value="${dir.output}/lib"/>
  <property name="library.dir" 	value="${enhydra.root}/lib"/>
  

  <!-- debug setting -->
  <property name="debug" value="on"/>

  <!-- javadoc package -->
  <property name="packages" value="main.*"/>

  <!-- DODS -->
  <!-- If dods is used? if yes, please set your database's doml file name -->
  <!-- in file dods.properties: dods.doml=yourDataBase.doml -->
  <property file="dods.properties"/>

  <!-- =================================================================== -->
  <!-- Set up papillon-secific javac class path                            -->
  <!-- =================================================================== -->
  <path id="papillon.javac.classpath">
    <pathelement path="${papillon.xalan.jar}"/>
    <pathelement path="${papillon.xerces.jar}"/>
    <pathelement path="${papillon.xmlapi.jar}"/>
    <pathelement path="${papillon.regexp.jar}"/>
    <pathelement path="${papillon.ant.jar}"/>
    <pathelement path="${papillon.uigenerator.jar}"/>
    <pathelement path="${papillon.concepts.jar}"/>
    <!-- <pathelement path="${papillon.pgsql.jar}"/> -->
  </path>


  <!-- =================================================================== -->
  <!-- Set up javac class path                                             -->
  <!-- =================================================================== -->
  <path id="javac.classpath">
     <path refid="papillon.javac.classpath" />
     <fileset dir="${enhydra.liboutput}" >
          <include name="*.jar" />
     </fileset>
  </path>

  <!-- =================================================================== -->
  <!-- Create output (default)                                             -->
  <!-- =================================================================== -->
  <target name="make" depends="archive,output" />

  <!-- =================================================================== -->
  <!-- Create output from scratch (no javadoc)                             -->
  <!-- =================================================================== -->
  <target name="rebuild" depends="clean,make" />

  <!-- =================================================================== -->
  <!-- Prepare the directory tree                                          -->
  <!-- =================================================================== -->
  <target name="prepare">
     <mkdir dir="${dir.output}"/>
     <mkdir dir="${dir.lib}"/>
     <mkdir dir="${dir.classes}"/>
     <mkdir dir="${dir.xmlc}"/>
     <mkdir dir="${dir.sql}"/>

	  <!-- DODS -->
			<!-- What is the script extension - OS dependant -->
			<condition property="script_extension" value="">
				<os family="unix"/>
			</condition>
			<condition property="script_extension" value=".bat">
				<os family="windows"/>
			</condition>

  </target>
  

	<!-- ========================================================= -->
	<!-- DODS: generate database manuplation java class            -->
	<!-- ========================================================= -->
	<target name="dods" depends="prepare" if="dods.doml" >
	  <mkdir dir="${dodsbuild.dir}"/>
	  <dods action="dods:java"
		force="false"
		domlfile="${dir.project}/${dods.doml}"
	  	outputDir="${dodsbuild.dir}"/>
	   <copy todir="${dir.classes}">
	       <fileset dir="${dodsbuild.dir}/classes" />
	   </copy>
	</target>
	
	<!-- ========================================================= -->
	<!-- copy sql files to the sql directory                       -->
	<!-- ========================================================= -->
	<target name="sql" depends="dods">
	   <copy todir="${dir.sql}">
	       <fileset dir="${dodsbuild.dir}" includes="**/*.sql"/>
	   </copy>
	   <copy todir="${dir.sql}">
	       <fileset dir="${dir.src}/sql"/>
	   </copy>
	</target>	
	

  <!-- =================================================================== -->
  <!-- Compile documents with XMLC                                         -->
  <!-- =================================================================== -->
  <target name="xmlc" depends="prepare, dods">
    <!-- First, generates the java file from html files -->
   <xmlc srcdir="${xmlcresources.dir}"
	   sourceout="${dir.xmlc}"
	   force="false"
	   packagename="${project.package}.presentation"
	   options="options.xmlc"
	   compile="false"
	   includes="**/*.html,**/*.wml"
	   verbose="false">
     <arg value="-d" />
     <arg value="${dir.classes}" />
	 </xmlc>
	 
	 <!-- Then, compile the generated files -->
	 <javac srcdir="${dir.xmlc}"
          destdir="${dir.classes}"
	  classpathref="javac.classpath"
        debug="${debug}">
   </javac>
  </target>

  <!-- =================================================================== -->
  <!-- Compile the java source                                             -->
  <!-- =================================================================== -->
	<target name="compile" depends="xmlc"> 

     <!-- compile XMLC generated java -->
     <javac srcdir="${dir.src}"
            destdir="${dir.classes}"
            excludes="**/StartServer.java"
            classpathref="javac.classpath"
	    debug="${debug}">
<!-- DODS -->
        		<classpath>
            	<pathelement location="${library.dir}/build/dods.jar" />
        		</classpath>
     </javac>

     <!-- copy resource files -->
     <copy todir="${dir.classes}/${dir.package}/presentation">
        <fileset dir="${dir.src}/${dir.package}/resources">
	   			<include name="**/*.gif"/>
	  			<include name="**/*.jpg"/>
	   			<include name="**/*.js"/>
	   			<include name="**/*.css"/>
	   			<include name="**/*.xsd"/>
        </fileset>
<!-- Special rule for the favicon because it has to be 
directly at the server root -->
        <fileset dir="${dir.src}/${dir.package}/resources/media"
                includes="favicon.ico"/>
     </copy>
  </target>

  <!-- =================================================================== -->
  <!-- Prepare output files                                                -->
  <!-- =================================================================== -->
  <target name="output" depends="prepare,sql	">
     <filter token="ENHYDRA_PATH" value="${enhydra.root}" />
     <filter token="JAVA_PATH"    value="${dir.java}" />
     <filter token="DEPLOY_PATH"  value="${dir.output}" />
     <filter token="PROJECT_PATH" value="${dir.project}" />
     <filter token="ENHYDRA_DIR" value="${enhydra.dir}" />
		
		 <!-- Papillon-specific filters -->
		 <filter token="ANT_LIB" value="${papillon.ant.jar}" />
     <filter token="XALAN_LIB"    value="${papillon.xalan.jar}" />
     <filter token="XERCES_LIB"  value="${papillon.xerces.jar}" />
     <filter token="XMLAPI_LIB"  value="${papillon.xmlapi.jar}" />
     <filter token="PGSQL_JDBC_DRIVER" value="${papillon.pgsql.jar}" />
     <filter token="REGEXP_LIB" value="${papillon.regexp.jar}" />
     <filter token="UIGENERATOR_LIB" value="${papillon.uigenerator.jar}" />
     <filter token="CONCEPTS_LIB" value="${papillon.concepts.jar}" />
     <!-- /Papillon-specific filters -->
     
     <copy todir="${dir.output}"
           filtering="off">
        <fileset dir="${dir.input}">
           <exclude name="**/*.in"/>
        </fileset>
     </copy>

     <copy todir="${dir.output}"
           filtering="on">
        <fileset dir="${dir.input}">
           <include name="**/*.in"/>
        </fileset>
     </copy>

     <move file="${dir.output}/start.in"
         tofile="${dir.output}/start"/>
		 <move file="${dir.output}/conf/multiserver.conf.in"
         tofile="${dir.output}/conf/multiserver.conf"/>
     <move file="${dir.output}/conf/${project.name}.conf.in"
         tofile="${dir.output}/conf/${project.name}.conf"/>
         
     <move file="${dir.output}/dbg-start.in"
         tofile="${dir.output}/dbg-start"/>
		 <move file="${dir.output}/conf/dbg-multiserver.conf.in"
         tofile="${dir.output}/conf/dbg-multiserver.conf"/>
     
     <move file="${dir.output}/backstart.in"
         tofile="${dir.output}/backstart"/>
     <move file="${dir.output}/conf/multiserverAdmin.conf.in"
         tofile="${dir.output}/conf/multiserverAdmin.conf"/>
      
  <!-- I put this between comments because it changes the unicode characters
  of the configuration files \u0805 => /u0805 and then they are not displayed
  correctly. Furthermore, I suppose it is a rule for Windoze. 
     <replace token="\"
              value="/"
              dir="${dir.output}"
              includes="**/*.properties,**/*.conf"/>
              -->

     <chmod file="${dir.output}/start" perm="ugo+rx"/>
     <chmod file="${dir.output}/dbg-start" perm="ugo+rx"/>
     <chmod file="${dir.output}/backstart" perm="ugo+rx"/>

  </target>


  <!-- =================================================================== -->
  <!-- Create archive                                                      -->
  <!-- =================================================================== -->
  <target name="archive" depends="prepare,compile">
 		<mkdir dir="${dir.lib}/tmp" />
 		<copy todir="${dir.lib}/tmp" includeEmptyDirs="No">
 					<fileset dir="${dir.classes}">
 						<exclude name="**/*.java" />
 						<exclude name="${dodsbuild.dir}/**/*.*" />
 					</fileset>
 		</copy>
    <jar jarfile="${dir.lib}/${project.name}.jar">
        <fileset dir="${dir.lib}/tmp"
                 excludes="**/*.java" />
    </jar>
    <delete dir="${dir.lib}/tmp" />
  </target>


  <!-- =================================================================== -->
  <!-- Create the API documentation                                        -->
  <!-- =================================================================== -->
  <target name="javadocs" depends="prepare">
     <mkdir dir="${dir.javadocs}"/>
     <javadoc packagenames="${packages}"
              sourcepath="${dir.src}"
              destdir="${dir.javadocs}"
              author="true"
              version="true"
              use="true"
              windowtitle="${project.name} API"
              doctitle="${project.name}"
              bottom="Copyright &#169; ${project.year}"/>
  </target>

  <!-- =================================================================== -->
  <!-- Clean everything                                                    -->
  <!-- =================================================================== -->
  <target name="clean">
		<delete dir="${dir.lib}"/>
		<delete dir="${dir.classes}"/>
		<delete dir="${dir.sql}"/>
		<delete dir="${dir.output}"/>
		<delete dir="${dir.xmlc}"/>
	 	<delete quiet="false">
    	<fileset dir="." includes="*.uptodate" />
		</delete>
		<delete dir="${dodsbuild.dir}/classes"/>
  </target>

</project>
smime.p7s (application/pkcs7-signature, 2.3 KB) - not displayed