Jogamp
Fix generated files dependency check; remove unused include paths
authorWade Walker <wwalker3@austin.rr.com>
Sun, 25 Oct 2015 19:36:39 +0000 (14:36 -0500)
committerWade Walker <wwalker3@austin.rr.com>
Sun, 8 Nov 2015 20:05:33 +0000 (14:05 -0600)
Fixed the dependency check for generated files; previously we were
looking at the wrong path, and always regenerating all files. Also
removed some include paths that don't contain any files, and renamed
some filesets so it's more clear what they contain.

make/build.xml

index 01939e9..b0d4e48 100644 (file)
 
         <!-- The source directories. -->
         <property name="src"   value="${project.root}/${rootrel.src}" />
-        <property name="src.c" value="${project.root}/${rootrel.src.c}" />
         <property name="src.java" value="${project.root}/${rootrel.src.java}" />
         <property name="build" value="${project.root}/${rootrel.build}" />
 
         <!-- The generated source directories. -->
         <property name="src.generated" value="${build}/gensrc" />
         <property name="src.generated.java" value="${src.generated}/java" />
-        <property name="src.generated.c" value="${src.generated}/native/jocl" />
+        <property name="src.generated.c" value="${src.generated}/native" />
 
         <!-- The compiler output directories. -->
         <property name="classes" value="${build}/classes" />
         <property name="headers.dest" value="${gen.includes}/CL" />
 
         <!-- The headers from which Java files are generated -->
-        <fileset id="stub.includes.dependencies.fileset.1" dir="${stub.includes.dir}">
+        <fileset id="stub.includes.fileset" dir="${stub.includes.dir}">
             <include name="CL11/**" />
             <include name="CL12/**" />
             <include name="CL20/**" />
         </fileset>
-        <fileset id="stub.includes.dependencies.fileset.2" dir="${gen.includes.dir}">
+        <fileset id="gen.includes.fileset" dir="${gen.includes.dir}">
             <include name="CL11/CL/**" />
             <include name="CL12/CL/**" />
             <include name="CL20/CL/**" />
         </fileset>
-        <fileset id="stub.includes.dependencies.fileset.3" file="${gluegen.jar}" />
-        <fileset id="stub.includes.dependencies.fileset.4" dir="config">
+        <fileset id="glugen.jar.fileset" file="${gluegen.jar}" />
+        <fileset id="config.files.fileset" dir="config">
             <include name="*.cfg" />
             <include name="*.java" />
             <include name="*.c" />
       -->
 
     <target name="java.generate.check">
-        <!-- Blow away all target files if any dependencies are violated
-             (the uptodate task doesn't allow arbitrary source and target filesets but should) -->
+        <!-- delete all generated files if any parent file is newer -->
         <dependset>
-            <srcfileset refid="stub.includes.dependencies.fileset.1" />
-            <srcfileset refid="stub.includes.dependencies.fileset.2" />
-            <srcfileset refid="stub.includes.dependencies.fileset.3" />
-            <srcfileset refid="stub.includes.dependencies.fileset.4" />
+            <srcfileset refid="stub.includes.fileset" />
+            <srcfileset refid="gen.includes.fileset" />
+            <srcfileset refid="glugen.jar.fileset" />
+            <srcfileset refid="config.files.fileset" />
             <targetfileset dir=".">
                 <include name="${src.generated.java}/**/*.java" />
                 <include name="${src.generated.c}/**/*.c" />
             </targetfileset>
         </dependset>
 
-        <!-- Now check for the presence of one well-known file -->
+        <!-- if one well-known generated file survived and is older than the parent files, we can skip file generation -->
         <uptodate property="java.generate.skip"
-                  targetfile="${src.generated.c}/CLImpl11_JNI.c">
-            <srcfiles refid="stub.includes.dependencies.fileset.1" />
-            <srcfiles refid="stub.includes.dependencies.fileset.2" />
-            <srcfiles refid="stub.includes.dependencies.fileset.3" />
-            <srcfiles refid="stub.includes.dependencies.fileset.4" />
+                  targetfile="${src.generated.c}/jocl11/CLImpl11_JNI.c">
+            <srcfiles refid="stub.includes.fileset" />
+            <srcfiles refid="gen.includes.fileset" />
+            <srcfiles refid="glugen.jar.fileset" />
+            <srcfiles refid="config.files.fileset" />
         </uptodate>
     </target>
 
                     <sysincludepath path="${stub.includes.gluegen.cc}"/>
                     <includepath path="${jogl.root}/make/stub_includes/opengl"/>
                     <includepath path="${gen.includes.dir}/CL11"/>
-                    <!-- This is for the generated headers for handwritten C code -->
-                    <includepath path="${src.generated.c}" />
-                    <includepath path="${src.c}"/>
                 </compiler>
 
                 <compiler extends="@{compiler.cfg.id}" >
                     <sysincludepath path="${stub.includes.gluegen.cc}"/>
                     <includepath path="${jogl.root}/make/stub_includes/opengl"/>
                     <includepath path="${gen.includes.dir}/CL12"/>
-                    <!-- This is for the generated headers for handwritten C code -->
-                    <includepath path="${src.generated.c}" />
-                    <includepath path="${src.c}"/>
                 </compiler>
 
                 <compiler extends="@{compiler.cfg.id}" >
                     <sysincludepath path="${stub.includes.gluegen.cc}"/>
                     <includepath path="${jogl.root}/make/stub_includes/opengl"/>
                     <includepath path="${gen.includes.dir}/CL20"/>
-                    <!-- This is for the generated headers for handwritten C code -->
-                    <includepath path="${src.generated.c}" />
-                    <includepath path="${src.c}"/>
                 </compiler>
 
                 <linker extends="@{linker.cfg.id}" />
http://JogAmp.org git info: FAQ, tutorial and man pages.