Ants do nightly builds on cruise control
Configure CruiseControl so that it builds your projects during day time when someone commits changes, as well as night time builds fixed at some time, say 01:00, 03:00 and 05:00 for different kinds of projects. This will be integration testing that tests how well your cvs projects compile and junit tests with each other.
For compile settings in Eclipse, I enable all warnings except 2 code style ones: "Unqualified access to instance field" and "Non-externalized strings (missing/unused $NON-NLS$ tag)". I also enable all javadoc warnings (on public method level).
All this is to catch overlooked design errors as early as possible, preferrably during the implementation phase with low cost of correcting flaws. Why does it cost less in this period? Its because the business complexity aka code is hot in this phase and the coders know how to fix the errors without needing to put in a full investigation.
- First (01:00) build your reusable components, and code needed by all other projects.
- Then (03:00) build middleware that uses the reusable components and self is used by applications.
- Lastly (05:00) build your applications. These builds upon the reusable components and the middleware.
- Clean simply removes the compilation directory, I usually name it 'build'. My ant script puts everything built into this directory to facilitate an easy complete clean operation.
- CleanSub cleans subprojects by calling their respecti
- Build target compiles the java files into class files and when needed also compiles several class files into a jar file. For web applications this step would also compile html, jsp, css, jar, property files and images into a war file. This step should really not take more than 10 seconds, so try to avoid unzipping/zipping jar files here and instead just package jar files into war as they are. If you really must clean up the jar contents, make a 'dep' target which is only run whenever one of its contents changes. It is possible to make an automatic test for this using the ant
tag uptodate. The build target should handle the project itself and also do subprojects builds. Again, if you edited a few files in this project or in a subproject, this build shouldn't take more than 10 sec if you want to keep a fast development cycle - which you want. - Test target runs junit tests [and possibly integration tests, which I haven't done much yet] on the code. If you're a javadoc fanatic like me, you would probably have ant produce a javadoc report as well. If you set it to fail on errors, you get a good way of validating the javadoc amount. Although, for quality javadoc content, only peer review helps.
- Run sample test runs.
For compile settings in Eclipse, I enable all warnings except 2 code style ones: "Unqualified access to instance field" and "Non-externalized strings (missing/unused $NON-NLS$ tag)". I also enable all javadoc warnings (on public method level).
All this is to catch overlooked design errors as early as possible, preferrably during the implementation phase with low cost of correcting flaws. Why does it cost less in this period? Its because the business complexity aka code is hot in this phase and the coders know how to fix the errors without needing to put in a full investigation.
Kommentarer
Legg inn en kommentar