User: vharcq
Date: 02/03/30 02:56:12
Modified: core/src/xdoclet GenerationManager.java
Log:
Add timestamp chacking for xjavadoc.jar
Revision Changes Path
1.2 +29 -7 xdoclet/core/src/xdoclet/GenerationManager.java
Index: GenerationManager.java
===================================================================
RCS file: /cvsroot/xdoclet/xdoclet/core/src/xdoclet/GenerationManager.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -w -r1.1 -r1.2
--- GenerationManager.java 30 Mar 2002 10:52:27 -0000 1.1
+++ GenerationManager.java 30 Mar 2002 10:56:12 -0000 1.2
@@ -22,6 +22,7 @@
public class GenerationManager {
private static File xdocletJar = getXdocletJar();
+ private static File xjavadocJar = getXjavadocJar();
private boolean guessGenerationNeeded = true;
private URL templateUrl;
@@ -82,8 +83,9 @@
return true;
}
- // 1. Check the classpath for timestamp on XDOCLET JAR
+ // 1. Check the classpath for timestamp on XDOCLET JAR and XJAVADOC JAR
File xdocletJar = getXdocletJar();
+ File xjavadocJar = getXjavadocJar();
if( file.lastModified() < xdocletJar.lastModified() )
{
@@ -94,6 +96,15 @@
if( cat.isDebugEnabled() )
cat.debug( "Reject file '" + file.getName() + "' because of
timestamp of " + xdocletJar.getName() );
+ if( file.lastModified() < xjavadocJar.lastModified() )
+ {
+ if( cat.isDebugEnabled() )
+ cat.debug( "Generation needed for '" + file.getName()
+ "' because of timestamp of " + xjavadocJar.getName() );
+ return true;
+ }
+ if( cat.isDebugEnabled() )
+ cat.debug( "Reject file '" + file.getName() + "' because of
timestamp of " + xjavadocJar.getName() );
+
// 2. Check the bean timestamp
if( file.lastModified() < clazz.lastModified() )
{
@@ -266,6 +277,17 @@
private static File getXdocletJar()
{
String path_str =
TemplateSubTask.class.getProtectionDomain().getCodeSource().getLocation().getFile().toString();
+
+ if( path_str != null && path_str.startsWith( "/" ) )
+ {
+ path_str = path_str.substring( 1 );
+ }
+ return new File( path_str );
+ }
+
+ private static File getXjavadocJar()
+ {
+ String path_str =
XClass.class.getProtectionDomain().getCodeSource().getLocation().getFile().toString();
if( path_str != null && path_str.startsWith( "/" ) )
{
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel