Update of /cvsroot/mocklib/mocklib3/bldfiles
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31858/bldfiles
Modified Files:
build.xml directory.properties ant.properties
Added Files:
configCheckstyle.xml configDesign.xml configPmd.xml
Removed Files:
design.xml
Log Message:
change build template
Index: build.xml
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/bldfiles/build.xml,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** build.xml 23 May 2007 17:21:27 -0000 1.12
--- build.xml 5 Dec 2007 04:55:25 -0000 1.13
***************
*** 3,7 ****
Run "ant -projecthelp" to view all the possible targets and descriptions.
-->
! <project name="std_buildfile" default="createdist" basedir="..">
<!-- Now allow any of the properties to be overridden -->
--- 3,7 ----
Run "ant -projecthelp" to view all the possible targets and descriptions.
-->
! <project name="std_buildfile" default="testCheckin" basedir="..">
[...1030 lines suppressed...]
-
<!--
***********************************************************************
--- 872,887 ----
</classpath>
<fileset dir="${javacode}">
! <include name="${javadoc.pattern}" />
</fileset>
! <doctitle>
! <![CDATA[<h1>${javadoc.title} ${version}</h1>]]></doctitle>
! <bottom>
! <![CDATA[<i>${copyright}</i>
! <br>${javadoc.bottom}]]></bottom>
<link offline="true" href="http://java.sun.com/j2se/1.4.2/docs/api" packagelistLoc="${package.list}/jdk"/>
<link offline="true" href="http://www.junit.org/junit/javadoc/3.8.1" packagelistLoc="${package.list}/junit"/>
</javadoc>
</target>
<!--
***********************************************************************
--- NEW FILE: configPmd.xml ---
<?xml version="1.0"?>
<ruleset name="Custom ruleset" xmlns="http://pmd.sf.net/ruleset/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd"
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd">
<description>This ruleset checks my code for bad stuff</description>
<!-- Below are some examples of defining rulesets
We'll use the entire 'strings' ruleset
<rule ref="rulesets/strings.xml" />
Here's some rules we'll specify one at a time
<rule ref="rulesets/unusedcode.xml/UnusedLocalVariable" />
<rule ref="rulesets/unusedcode.xml/UnusedPrivateField" />
<rule ref="rulesets/imports.xml/DuplicateImports" />
<rule ref="rulesets/basic.xml/UnnecessaryConversionTemporary" />
We want to customize this rule a bit, change the message and raise the priority
<rule ref="rulesets/basic.xml/EmptyCatchBlock"
message="Must handle exceptions">
<priority>2</priority>
</rule>
Now we'll customize a rule's property value
<rule ref="rulesets/codesize.xml/CyclomaticComplexity">
<properties>
<property name="reportLevel" value="5" />
</properties>
</rule>
Note we want everything from braces.xml except WhileLoopsMustUseBraces
<rule ref="rulesets/braces.xml">
<exclude name="WhileLoopsMustUseBraces" />
</rule>
-->
<rule ref="rulesets/basic.xml"/>
<rule ref="rulesets/optimizations.xml">
<!-- using .toString instead of adding an empty string results in nullpointerexceptions
so I prefer ""+object...then if the object is null, null is printed instead of nullpointerexception -->
<exclude name="AddEmptyString"/>
<exclude name="MethodArgumentCouldBeFinal" />
<exclude name="LocalVariableCouldBeFinal"/>
</rule>
<rule ref="rulesets/braces.xml">
<exclude name="IfElseStmtsMustUseBraces"/>
<exclude name="IfStmtsMustUseBraces"/>
</rule>
<rule ref="rulesets/clone.xml"/>
<rule ref="rulesets/codesize.xml">
<!-- I would love to use this but appears not to be working. IT says the complexity is 2 and should break at 7
and causes a break with just 2 so I am confused by the error message -->
<exclude name="CyclomaticComplexity"/>
</rule>
<rule ref="rulesets/controversial.xml">
<exclude name="UnusedModifier"/>
<exclude name="AtLeastOneConstructor"/>
<exclude name="OnlyOneReturn"/>
</rule>
<rule ref="rulesets/coupling.xml"/>
<rule ref="rulesets/design.xml">
<exclude name="ImmutableField"/>
<exclude name="UncommentedEmptyMethod"/>
</rule>
<rule ref="rulesets/favorites.xml"/>
<rule ref="rulesets/finalizers.xml"/>
<rule ref="rulesets/imports.xml"/>
<rule ref="rulesets/javabeans.xml">
<!-- Quite annoying since it flags private fields that are returned from methods, otherwise would be quite nice -->
<exclude name="BeanMembersShouldSerialize"/>
</rule>
<rule ref="rulesets/junit.xml">
<exclude name="JUnitAssertionsShouldIncludeMessage"/>
</rule>
<rule ref="rulesets/logging-java.xml"/>
<rule ref="rulesets/naming.xml">
<exclude name="ShortVariable"/>
</rule>
<rule ref="rulesets/scratchpad.xml"/>
<rule ref="rulesets/strictexception.xml">
<!-- while they are correct, it is convenient to just have JUnit tests throw Exception -->
<exclude name="SignatureDeclareThrowsException"/>
<!-- unfortunately, we have seen the JVM throw catchable Errors and we want to log and record those -->
<exclude name="AvoidCatchingThrowable"/>
<exclude name="AvoidThrowingRawExceptionTypes"/>
</rule>
<rule ref="rulesets/strings.xml"/>
<rule ref="rulesets/sunsecure.xml"/>
<rule ref="rulesets/typeresolution.xml"/>
<rule ref="rulesets/unusedcode.xml"/>
<rule ref="rulesets/j2ee.xml"/>
<rule ref="rulesets/basic-jsf.xml"/>
<rule ref="rulesets/basic-jsp.xml"/>
</ruleset>
Index: directory.properties
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/bldfiles/directory.properties,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** directory.properties 11 Sep 2006 03:58:16 -0000 1.3
--- directory.properties 5 Dec 2007 04:55:25 -0000 1.4
***************
*** 26,29 ****
--- 26,31 ----
jardist =${generated}/jardist
#will contain a *.jar containing everything in ${build}
+ wardist =${generated}/wardist
+ #will contain a *.war containing everything in ${build} and ${webroot}
dist =${generated}/dist
***************
*** 32,39 ****
reports =${generated}/reports
codecov.report =${reports}/codecoverage
#contains the code coverage reports of what the unit tests
#covered
findbugs.report =${reports}/findbugs
- checkstyle.report=${reports}/checkstyle
javadoc =${reports}/javadoc
html.code =${reports}/htmlcode
--- 34,42 ----
reports =${generated}/reports
codecov.report =${reports}/codecoverage
+ pmd.report =${reports}/pmd
#contains the code coverage reports of what the unit tests
#covered
+
findbugs.report =${reports}/findbugs
javadoc =${reports}/javadoc
html.code =${reports}/htmlcode
***************
*** 43,49 ****
--- 46,54 ----
allcodecov =${generated}/codecoverage
codecov.temp =${allcodecov}/misc
+ #previously used by emma, not used by cobertura so this is useless property for now
codecov.classes =${allcodecov}/instrumented-classes
#intermediate directory that contains instrumented classes to
#run testall against so a code coverage report can be spit out.
+ codecov.instrument.file=${codecov.classes}/cobertura.ser
codecov.jar =${allcodecov}/instrumented-jar
***************
*** 68,72 ****
#testing. It usually gets deleted afterwards.
! src.gen =${generated}/src
#generated source code
--- 73,77 ----
#testing. It usually gets deleted afterwards.
! gen.src =${generated}/src
#generated source code
***************
*** 74,77 ****
--- 79,84 ----
# INPUT DIRECTORIES - don't change these after the project is started.
#-----------------------------------------------------------------------
+ project =.
+
input =input
#contains all stuff that is an input into the build
***************
*** 83,99 ****
javacode =${input}/javasrc
#Contains all *.java source files
#Contains all *.html files needed by javadoc
! #Contains all *.jpg files needed by javadoc
! #Contains all *.gif files needed by javadoc
#Contains all *.* files needed by javadoc
- #Will NOT contain any *.jpg, *.gif, *.html, *.htm needed by application
- #Use ${properties} for *.jpg, *.gif, *.html, *.htm needed by application
! properties =${input}/properties
! #contains *.property files for i18n
! #contains *.gif needed for application
! #contains *.* any other resource files needed for application
! lib =${input}/lib
#contains all *.jar needed to run the app and that need to be deployed with the app
#does not contain *.jars needed to compile the app(such as junit.jar)
--- 90,105 ----
javacode =${input}/javasrc
#Contains all *.java source files
+ #Contains all *.properties files that will go into the jar
+ #Contains all *.xml files that will go into the jar
+ #Contains all *.* that will go into the jar except doc_*.gif and doc_*.jpg
#Contains all *.html files needed by javadoc
! #Contains all doc_*.jpg files needed by javadoc
! #Contains all doc_*.gif files needed by javadoc
#Contains all *.* files needed by javadoc
! webroot =${input}/webroot
! #Contains all html, jsp, gif, jpg's, WEB-INF/web.xml, WEB-INF/faces-config.xml, etc. etc
! lib =${input}/libinclude
#contains all *.jar needed to run the app and that need to be deployed with the app
#does not contain *.jars needed to compile the app(such as junit.jar)
***************
*** 108,122 ****
#typically, there will be another directory in here called <project>
#or something. Some projects won't but most will.
-
- scripts =${input}/tests/scripts
- #DO NOT MODIFY. This is hardcoded in TestSuiteAllScripts.java.
- #contains all *.xml abbot scripts to do GUI testing.
- test.input =${input}/tests/input
- #for miscellaneous input to junit tests.
-
native =${input}/native
#contains JNI C header file
! schemas =${javacode}/schemas
#contains xsd schemas
--- 114,121 ----
#typically, there will be another directory in here called <project>
#or something. Some projects won't but most will.
native =${input}/native
#contains JNI C header file
! schemas =${input}/schemas
#contains xsd schemas
***************
*** 125,129 ****
#-----------------------------------------------------------------------
junit.pattern1=**/Test*.class
! junit.pattern2=biz/xsoftware/examples/**/Test*.class
javadoc.pattern=**/*.java
--- 124,128 ----
#-----------------------------------------------------------------------
junit.pattern1=**/Test*.class
! #junit.pattern2=**/test/IntegTest*.class
javadoc.pattern=**/*.java
--- design.xml DELETED ---
--- NEW FILE: configCheckstyle.xml ---
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.2//EN"
"http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<!--
Checkstyle configuration that checks the sun coding conventions from:
- the Java Language Specification at
http://java.sun.com/docs/books/jls/second_edition/html/index.html
- the Sun Code Conventions at http://java.sun.com/docs/codeconv/
- the Javadoc guidelines at
http://java.sun.com/j2se/javadoc/writingdoccomments/index.html
- the JDK Api documentation http://java.sun.com/j2se/docs/api/index.html
- some best practices
Checkstyle is very configurable. Be sure to read the documentation at
http://checkstyle.sf.net (or in your downloaded distribution).
Most Checks are configurable, be sure to consult the documentation.
To completely disable a check, just comment it out or delete it from the file.
Finally, it is worth reading the documentation.
-->
<module name="Checker">
<!-- Checks that a package.html file exists for each package. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html#PackageHtml -->
<!--module name="PackageHtml"/-->
<!-- Checks whether files end with a new line. -->
<!-- See http://checkstyle.sf.net/config_misc.html#NewlineAtEndOfFile -->
<!--module name="NewlineAtEndOfFile"/-->
<!-- Checks that property files contain the same keys. -->
<!-- See http://checkstyle.sf.net/config_misc.html#Translation -->
<module name="Translation"/>
<module name="TreeWalker">
<!-- Checks for Javadoc comments. -->
<!-- See http://checkstyle.sf.net/config_javadoc.html -->
<!--module name="JavadocMethod"/>
<module name="JavadocType"/>
<module name="JavadocVariable"/>
<module name="JavadocStyle"/-->
<!-- Checks for Naming Conventions. -->
<!-- See http://checkstyle.sf.net/config_naming.html -->
<module name="ConstantName">
<property name="format" value="^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$|^log$|^apiLog$"/>
</module>
<module name="LocalFinalVariableName"/>
<module name="LocalVariableName"/>
<module name="MemberName"/>
<module name="MethodName"/>
<module name="PackageName"/>
<module name="ParameterName"/>
<module name="StaticVariableName"/>
<module name="TypeName"/>
<module name="ParameterAssignment"/>
<!-- Checks for Headers -->
<!-- See http://checkstyle.sf.net/config_header.html -->
<!-- <module name="Header"> -->
<!-- The follow property value demonstrates the ability -->
<!-- to have access to ANT properties. In this case it uses -->
<!-- the ${basedir} property to allow Checkstyle to be run -->
<!-- from any directory within a project. See property -->
<!-- expansion, -->
<!-- http://checkstyle.sf.net/config.html#properties -->
<!-- <property -->
<!-- name="headerFile" -->
<!-- value="${basedir}/java.header"/> -->
<!-- </module> -->
<!-- Following interprets the header file as regular expressions. -->
<!-- <module name="RegexpHeader"/> -->
<!-- Checks for imports -->
<!-- See http://checkstyle.sf.net/config_import.html -->
<module name="AvoidStarImport"/>
<module name="IllegalImport"/> <!-- defaults to sun.* packages -->
<module name="RedundantImport"/>
<module name="UnusedImports"/>
<!-- Checks for Size Violations. -->
<!-- See http://checkstyle.sf.net/config_sizes.html -->
<module name="FileLength">
<property name="max" value="700"/>
</module>
<module name="LineLength">
<property name="max" value="150"/>
</module>
<module name="MethodLength">
<property name="max" value="75"/>
<property name="countEmpty" value="false"/>
</module>
<module name="ParameterNumber"/>
<!-- Checks for whitespace -->
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
<!--module name="EmptyForIteratorPad"/>
<module name="MethodParamPad"/>
<module name="NoWhitespaceAfter"/>
<module name="NoWhitespaceBefore"/>
<module name="OperatorWrap"/>
<module name="ParenPad"/>
<module name="TypecastParenPad"/>
<module name="TabCharacter"/>
<module name="WhitespaceAfter"/>
<module name="WhitespaceAround"/-->
<!-- Modifier Checks -->
<!-- See http://checkstyle.sf.net/config_modifiers.html -->
<module name="ModifierOrder"/>
<!--module name="RedundantModifier"/-->
<!-- Checks for blocks. You know, those {}'s -->
<!-- See http://checkstyle.sf.net/config_blocks.html -->
<module name="AvoidNestedBlocks"/>
<module name="EmptyBlock"/>
<!--module name="LeftCurly"/>
<module name="NeedBraces"/>
<module name="RightCurly"/-->
<!-- Checks for common coding problems -->
<!-- See http://checkstyle.sf.net/config_coding.html -->
<module name="AvoidInlineConditionals"/>
<module name="DoubleCheckedLocking"/> <!-- MY FAVOURITE -->
<module name="EmptyStatement"/>
<module name="EqualsHashCode"/>
<!--module name="HiddenField"/-->
<module name="IllegalInstantiation"/>
<module name="InnerAssignment"/>
<!--module name="MagicNumber"/-->
<module name="MissingSwitchDefault"/>
<module name="RedundantThrows"/>
<module name="SimplifyBooleanExpression"/>
<module name="SimplifyBooleanReturn"/>
<module name="NestedIfDepth">
</module>
<module name="NestedTryDepth"/>
<module name="ModifiedControlVariable"/>
<module name="StringLiteralEquality"/>
<module name="SuperClone"/>
<module name="PackageDeclaration"/>
<module name="ReturnCount">
<property name="max" value="3"/>
</module>
<module name="ParameterAssignment"/>
<module name="FallThrough"/>
<!-- Checks for class design -->
<!-- See http://checkstyle.sf.net/config_design.html -->
<!--module name="DesignForExtension"/-->
<module name="FinalClass"/>
<module name="HideUtilityClassConstructor"/>
<module name="InterfaceIsType"/>
<module name="VisibilityModifier">
<property name="protectedAllowed" value="true"/>
</module>
<module name="MutableException"/>
<!-- Miscellaneous other checks. -->
<!-- See http://checkstyle.sf.net/config_misc.html -->
<module name="ArrayTypeStyle"/>
<!--module name="FinalParameters"/-->
<module name="GenericIllegalRegexp">
<property name="format" value="System\.exit"/>
<property name="message" value="System.exit is not allowed."/>
</module>
<module name="GenericIllegalRegexp">
<property name="format" value="System\.out\.println"/>
<property name="message" value="Use Logger class instead."/>
</module>
<module name="GenericIllegalRegexp">
<property name="format" value="\.printStackTrace"/>
<property name="message" value="Use Logger class instead."/>
</module>
<!--module name="GenericIllegalRegexp">
<property name="format" value="\s+$"/>
<property name="message" value="Line has trailing spaces."/>
</module-->
<!--module name="TodoComment"/-->
<module name="UpperEll"/>
</module>
</module>
Index: ant.properties
===================================================================
RCS file: /cvsroot/mocklib/mocklib3/bldfiles/ant.properties,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ant.properties 12 Sep 2006 01:46:52 -0000 1.2
--- ant.properties 5 Dec 2007 04:55:25 -0000 1.3
***************
*** 9,12 ****
--- 9,34 ----
#version info may be retrieved using java -jar ${name}.jar -version
+ max.errors=0
+ #specifies the number of errors or warnings that checkstyle can have before
+ #failing the build. This number is high for legacy systems and should
+ #be 0 for new systems from scratch
+
+ pmd.maxerrors=450
+ #specifies the number of errors or warnings that pmd can have before
+ #failing the build. This number is high for legacy systems and should
+ #be 0 for new systems from scratch
+
+ totallinerate=80
+ #specifies required % lines of code to be covered when tests are executed for
+ #entire library. If this number is not met, the build will fail
+
+ webapp.enabled =false
+ #if set to true, will build a war file with all jar files in input/libinclude
+ #and will also contain all files from input/webroot
+ #and will also contain all the classes from input/javasrc
+ osgi.enabled =false
+ #if set to true, will build an osgi jar file with all the jar files from
+ #input/libinclude and all the classes from input/javasrc
+
imports =[bundle.emptystring]
exports =[bundle.emptystring]
***************
*** 14,19 ****
#The packages to make private
- build.source=5
-
manifest.mainclass = TOOLS.JAVA.Main
#The class that is run when java -jar xxxx.jar is run
--- 36,39 ----
***************
*** 26,30 ****
copyright = Copyright © 2000 Dean Hiller All Rights Reserved.
javadoc.title = Build Template
! javadoc.bottom = A Library that creates mockobjects that simulate any interface<br> \
<a href=http://sourceforge.net> \
<IMG src=http://sourceforge.net/sflogo.php?group_id=113040 width=210 height=62 border=0 alt=SourceForge Logo> \
--- 46,50 ----
copyright = Copyright © 2000 Dean Hiller All Rights Reserved.
javadoc.title = Build Template
! javadoc.bottom = If you would like a shared copyright, contact me at dea...@us...<br> \
<a href=http://sourceforge.net> \
<IMG src=http://sourceforge.net/sflogo.php?group_id=113040 width=210 height=62 border=0 alt=SourceForge Logo> \
***************
*** 52,60 ****
#
- ###########################################################
- #If you need to use castor set 'xsd.start' to the name
- #of your main xsd file, and uncomment the line
- ##########################################################
- #
- #xsd.start=yourName.xsd
- #
\ No newline at end of file
--- 72,73 ----
--- NEW FILE: configDesign.xml ---
<design>
<!-- Use this tool to create your package design which the build will compare with the
actual package dependencies. It will then tell you what parts of the code violate
the following package design.
See the documentation of the ant-contrib project to fill in the package design here
ant-contrib is at http://sourceforge.net/projects/ant-contrib. Currently, this
template is using a version from the CVS head, and the docs are up to date on the
CVS head, but not in the latest download yet as I have not asked for a new release
on ant-contrib yet(wanted to finish a few more things), but this is stable and works.
I just want to add one more feature-->
<!-- DO NOT MODIFY THE NEXT LINE -->
<package name="manifest" package="biz.xsoftware.manifest" subpackages="include" needdepends="false"/>
<!-- should erase the following... -->
<package name="default" package="default package" subpackages="include" needdepends="false"/>
<!-- should use something like this instead on a per project basis -->
<!--package name="api" package="biz.xsoftware.api" subpackages="include"/>
<package name="testapi" package="biz.xsoftware.test" subpackages="include" depends="api"/>
<package name="impl" package="biz.xsoftware.impl" subpackages="include" depends="api"/-->
<!-- Use the following to depend on junit and mocklib -->
<!--package name="junit" package="junit" subpackages="include" needdeclarations="false"/>
<package name="mocklib" package="biz.xsoftware.mock" subpackages="include" needdeclarations="false"/-->
</design>
|