|
From: <ls...@us...> - 2008-08-24 08:13:32
|
Revision: 4489
http://jnode.svn.sourceforge.net/jnode/?rev=4489&view=rev
Author: lsantha
Date: 2008-08-24 08:13:29 +0000 (Sun, 24 Aug 2008)
Log Message:
-----------
Significantly improved the performance of openjdk-annotate task.
Modified Paths:
--------------
trunk/all/build.xml
trunk/builder/src/builder/org/jnode/ant/taskdefs/AnnotateTask.java
Modified: trunk/all/build.xml
===================================================================
--- trunk/all/build.xml 2008-08-24 05:36:29 UTC (rev 4488)
+++ trunk/all/build.xml 2008-08-24 08:13:29 UTC (rev 4489)
@@ -751,17 +751,15 @@
</target>
<target name="openjdk-annotate" depends="assemble-projects">
- <echo message="openjdk-annotate"/>
<taskdef name="oj-annotate" classname="org.jnode.ant.taskdefs.AnnotateTask"
classpathref="cp-jnode"/>
<oj-annotate annotationFile="${root.dir}/all/conf/openjdk-annotations.properties"
- buildStartTime="${hotswap.class.tstamp}" pattern="${hotswap.class.tstamp.pattern}"
- trace="false" failonerror="true">
- <fileset dir="${root.dir}/core/build/classes">
- <patternset includes="**/*.class"/>
- </fileset>
- </oj-annotate>
+ buildStartTime="${hotswap.class.tstamp}"
+ pattern="${hotswap.class.tstamp.pattern}"
+ trace="false"
+ failonerror="true"
+ basedir="${root.dir}/core/build/classes"/>
</target>
<!-- check that all native methods are properly implemented for JNode -->
Modified: trunk/builder/src/builder/org/jnode/ant/taskdefs/AnnotateTask.java
===================================================================
--- trunk/builder/src/builder/org/jnode/ant/taskdefs/AnnotateTask.java 2008-08-24 05:36:29 UTC (rev 4488)
+++ trunk/builder/src/builder/org/jnode/ant/taskdefs/AnnotateTask.java 2008-08-24 08:13:29 UTC (rev 4489)
@@ -65,6 +65,7 @@
private String buildStartTime = "";
private String pattern = "";
private long startTime = 0;
+ private String baseDir;
private Properties annotations = new Properties();
@@ -76,8 +77,15 @@
throw new BuildException("invalid buildStartTime or pattern", e);
}
- if (readProperties()) {
- processFiles();
+ try {
+ if (readProperties()) {
+ for(String file : classesFiles){
+ File classFile = new File(baseDir, file);
+ processFile(classFile);
+ }
+ }
+ } catch (IOException ioe) {
+ throw new BuildException(ioe);
}
}
@@ -108,6 +116,10 @@
this.pattern = pattern;
}
+ public void setBaseDir(String baseDir) {
+ this.baseDir = baseDir;
+ }
+
/**
* Read the properties file. For now, it simply contains a list of
* classes that need the SharedStatics annotation.
@@ -191,16 +203,15 @@
*/
@Override
protected void processFile(File classFile) throws IOException {
+ if (classFile.lastModified() < startTime) {
+ return;
+ }
+
String annotations = getAnnotations(classFile);
if (annotations == null) {
return;
}
- if (classFile.lastModified() < startTime) {
- System.out.println("Skipping already annotated file " + classFile.getName());
- return;
- }
-
File tmpFile = new File(classFile.getParentFile(), classFile.getName() + ".tmp");
FileInputStream fis = null;
boolean classIsModified = false;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|