Hi Aaron,
Great work so far! Here is a thought and a hint.
Thought: At some point, Hackystat will require Java 1.5. Before that time, however, the
best thing would be for Hackystat to build using either 1.4 or 1.5. (That way, if we
discover some issue with 1.5 after some initial usage, we aren't hosed and can continue
to deploy with 1.4 until we clear up all of the problems with 1.5.)
Hint: To make the build.xml file support either 1.4 or 1.5, it will at a minimum need
some conditionalization for the differences between Tomcat 5.0.x and Tomcat 5.5.x. One
idea to think about is the following:
<condition property="hackystat.java-1.5">
<equals arg1="1.5" arg2="${java.specification.version}"/>
</condition>
<condition property="hackystat.java-1.4">
<equals arg1="1.4" arg2="${java.specification.version}"/>
</condition>
This code should result in either the property hackystat.java-1.5 or hackystat.java-1.4
being set (but not both), which enables you to, for example, write tasks that only
execute under a given version of java
<target name="deployTomcat5.5" if="hackystat.java1.5">
:
</target>
<target name="deployTomcat5.0" if="hackystat.java1.4">
:
</target>
A side effect of this is that you can now write a general deploy task:
<target name="deployTomcat" depends="deployTomcat5.0,deployTomcat5.5"/>
and when you call it, the appropriate Tomcat target will be called depending upon the
Java in use.
Comments on this from anyone?
Cheers,
Philip
--On Thursday, August 18, 2005 11:31 PM -1000 Aaron Kagawa <[EMAIL PROTECTED]>
wrote:
Here is a follow up the Ant replace task problem.. I haven't figured out
exactly what
the heck is going on but here is some interesting information
1) I've done a lot of googling and found nothing.
2) "ant -verbose junitAll" works fine. "ant -q junitAll" and "ant junitAll"
doesnot
work.
3) I've tried to put a little sleep task in between the junitreport and the
replace.
that didn't work.
4) I found a Hacked solution.. I switched the call to the junit sensor and the
replace
task (previously the replace was first followed by the call the junit sensor).
so now
it looks like
<antcall target= "check-junit" />
<antcall target= "sendJUnitDataToHackystat" />
<!-- Get rid of references to hackystat.admin.userkey in the junit output
files. -->
<replace dir= "${report.module.dir}" token= "${hackystat.admin.userkey}"
value=
"*ADMIN-KEY*" />
<!-- Need by hackyDevSite, to arrange move junit xml report to parent dir
and
rename it according to hackystat module name. -->
<copy file= "${report.module.dir}/TESTS-TestSuites.xml" tofile=
"${report.module.dir}/../${module.name}.xml" />
And now everything appears to be ok. what the heck!
I didn't commit my changes.. I will continue to look at the problem to figure
why. I
will probably commit my changes after double checking that everything is still
ok in
the Java 1.4 world.
thanks, aaron
3) there are appears to be a problem with Ant 1.6.5's replace task.. I get the
following exception when the build.utils.xml tries to replace the Admin key
after
running the unittests. The funny thing is that I stripped out the Ant xml code
and ran
the replace task in its own little build.xml file and everything works. There
seems to
be a problem with the replace task when other things are executed before it. I
haven't
figured out why yet. the task works fine in Java 1.4!
[echo] (hackyBuildUtils) Running JUnit tests on module hackyStatistics.
BUILD FAILED
C:\java\cvs\hackyBuild\build.xml:499: The following error occurred while executi
ng this line:
C:\java\cvs\hackyBuild\build.utils.xml:725: The following error occurred while e
xecuting this line:
C:\java\cvs\hackyBuild\build.utils.xml:486: IOException in C:\java\cvs\hackyBuil
d\build\reports\junit\hackyStatistics\org\hackystat\stdext\statistic\0_TestDataS
equence.html - java.io.IOException:Failed to delete C:\java\cvs\hackyBuild\build
\reports\junit\hackyStatistics\org\hackystat\stdext\statistic\0_TestDataSequence
.html while trying to rename C:\java\cvs\hackyBuild\build\reports\junit\hackySta
tistics\org\hackystat\stdext\statistic\rep1420225305.tmp