tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1044710 - in /tomcat/trunk: ./ res/checkstyle/
Date Sat, 11 Dec 2010 20:38:42 GMT
Author: markt
Date: Sat Dec 11 20:38:42 2010
New Revision: 1044710

URL: http://svn.apache.org/viewvc?rev=1044710&view=rev
Log:
Add import-control checks to Checkstyle (these found the recent dependency issues)
Move checkstyle config to res/checkstyle to stop it cluttering up the root

Added:
    tomcat/trunk/res/checkstyle/
    tomcat/trunk/res/checkstyle/checkstyle.xml
      - copied unchanged from r1044249, tomcat/trunk/checkstyle.xml
    tomcat/trunk/res/checkstyle/javax-checkstyle.xml   (with props)
    tomcat/trunk/res/checkstyle/javax-import-control.xml   (with props)
    tomcat/trunk/res/checkstyle/org-checkstyle.xml   (with props)
    tomcat/trunk/res/checkstyle/org-import-control.xml   (with props)
Removed:
    tomcat/trunk/checkstyle.xml
Modified:
    tomcat/trunk/build.xml

Modified: tomcat/trunk/build.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/build.xml?rev=1044710&r1=1044709&r2=1044710&view=diff
==============================================================================
--- tomcat/trunk/build.xml (original)
+++ tomcat/trunk/build.xml Sat Dec 11 20:38:42 2010
@@ -424,7 +424,7 @@
   <target name="validate" depends="download-validate" if="${execute.validate}">
     <taskdef resource="checkstyletask.properties"
              classpath="${checkstyle.jar}" />
-    <checkstyle config="checkstyle.xml">
+    <checkstyle config="res/checkstyle/checkstyle.xml">
       <fileset dir="." >
         <patternset refid="text.files" />
         <exclude name=".*/**"/>
@@ -438,6 +438,18 @@
         <exclude name="**/tomcat-deps/**"/>
       </fileset>
     </checkstyle>
+    <!-- javax package checks -->
+    <checkstyle config="res/checkstyle/javax-checkstyle.xml">
+      <fileset dir="java/javax" >
+        <include name="**/*.java"/>
+      </fileset>
+    </checkstyle>
+    <!-- org package checks -->
+    <checkstyle config="res/checkstyle/org-checkstyle.xml">
+      <fileset dir="java/org" >
+        <include name="**/*.java"/>
+      </fileset>
+    </checkstyle>
   </target>
 
   <target name="compile" depends="build-prepare,download-compile,validate">

Added: tomcat/trunk/res/checkstyle/javax-checkstyle.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/javax-checkstyle.xml?rev=1044710&view=auto
==============================================================================
--- tomcat/trunk/res/checkstyle/javax-checkstyle.xml (added)
+++ tomcat/trunk/res/checkstyle/javax-checkstyle.xml Sat Dec 11 20:38:42 2010
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+  <!-- When adding checks, keep to the order checks are listed under         -->
+  <!-- 'Standard Checks' in the Checkstyle documentation:                    -->
+  <!-- http://checkstyle.sourceforge.net/config_coding.html                  -->
+
+  <!-- Specific checks for javax.* packages -->
+
+  <module name="TreeWalker">
+    <module name="ImportControl">
+      <property name="file" value="res/checkstyle/javax-import-control.xml"/>
+    </module>
+  </module>
+</module>
\ No newline at end of file

Propchange: tomcat/trunk/res/checkstyle/javax-checkstyle.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/trunk/res/checkstyle/javax-import-control.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/javax-import-control.xml?rev=1044710&view=auto
==============================================================================
--- tomcat/trunk/res/checkstyle/javax-import-control.xml (added)
+++ tomcat/trunk/res/checkstyle/javax-import-control.xml Sat Dec 11 20:38:42 2010
@@ -0,0 +1,50 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE import-control PUBLIC
+    "-//Puppy Crawl//DTD Import Control 1.1//EN"
+    "http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
+
+<import-control pkg="javax">
+  <allow pkg="java"/>
+  <subpackage name="annotation">
+    <allow pkg="javax.annotation"/>
+  </subpackage>
+  <subpackage name="ejb">
+    <allow pkg="javax.ejb"/>
+  </subpackage>
+  <subpackage name="el">
+    <allow pkg="javax.el"/>
+  </subpackage>
+  <subpackage name="mail">
+    <allow pkg="javax.mail"/>
+  </subpackage>
+  <subpackage name="persistence">
+    <allow pkg="javax.persistence"/>
+  </subpackage>
+  <subpackage name="servlet">
+    <allow pkg="javax.servlet"/>
+    <disallow pkg="javax.servlet.jsp" local-only="true"/>
+    <subpackage name="jsp">
+      <allow pkg="javax.el"/>
+      <allow pkg="javax.servlet.jsp"/>
+    </subpackage>
+  </subpackage>
+  <subpackage name="xml.ws">
+    <allow pkg="javax.xwl.ws"/>
+  </subpackage>
+</import-control>
\ No newline at end of file

Propchange: tomcat/trunk/res/checkstyle/javax-import-control.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/trunk/res/checkstyle/org-checkstyle.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/org-checkstyle.xml?rev=1044710&view=auto
==============================================================================
--- tomcat/trunk/res/checkstyle/org-checkstyle.xml (added)
+++ tomcat/trunk/res/checkstyle/org-checkstyle.xml Sat Dec 11 20:38:42 2010
@@ -0,0 +1,33 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE module PUBLIC
+    "-//Puppy Crawl//DTD Check Configuration 1.2//EN"
+    "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
+<module name="Checker">
+  <!-- When adding checks, keep to the order checks are listed under         -->
+  <!-- 'Standard Checks' in the Checkstyle documentation:                    -->
+  <!-- http://checkstyle.sourceforge.net/config_coding.html                  -->
+
+  <!-- Specific checks for javax.* packages -->
+
+  <module name="TreeWalker">
+    <module name="ImportControl">
+      <property name="file" value="res/checkstyle/org-import-control.xml"/>
+    </module>
+  </module>
+</module>
\ No newline at end of file

Propchange: tomcat/trunk/res/checkstyle/org-checkstyle.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: tomcat/trunk/res/checkstyle/org-import-control.xml
URL: http://svn.apache.org/viewvc/tomcat/trunk/res/checkstyle/org-import-control.xml?rev=1044710&view=auto
==============================================================================
--- tomcat/trunk/res/checkstyle/org-import-control.xml (added)
+++ tomcat/trunk/res/checkstyle/org-import-control.xml Sat Dec 11 20:38:42 2010
@@ -0,0 +1,102 @@
+<?xml version="1.0"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!DOCTYPE import-control PUBLIC
+    "-//Puppy Crawl//DTD Import Control 1.1//EN"
+    "http://www.puppycrawl.com/dtds/import_control_1_1.dtd">
+
+<import-control pkg="org.apache">
+  <!-- Anything in J2SE is OK but need to list javax by package as not
+       all javax packages are in J2SE -->
+  <allow pkg="java"/>
+  <allow class="javax.imageio.ImageIO"/>
+  <allow pkg="javax.management"/>
+  <allow pkg="javax.naming"/>
+  <allow pkg="javax.net"/>
+  <allow pkg="javax.rmi"/>
+  <allow pkg="javax.security"/>
+  <allow pkg="javax.sql"/>
+  <allow pkg="javax.xml"/>
+  <allow pkg="org.w3c.dom"/>
+  <allow pkg="org.xml.sax"/>
+  <subpackage name="catalina">
+    <allow pkg="javax.annotation"/>
+    <allow pkg="javax.ejb"/>
+    <allow pkg="javax.persistence"/>
+    <allow pkg="javax.servlet"/>
+    <allow pkg="org.apache.catalina"/>
+    <allow pkg="org.apache.coyote"/>
+    <allow pkg="org.apache.juli"/>
+    <allow pkg="org.apache.naming"/>
+    <allow pkg="org.apache.tomcat"/>
+    <allow pkg="org.apache.tools.ant"/>
+  </subpackage>
+  <subpackage name="coyote">
+    <allow pkg="org.apache.coyote"/>
+    <allow pkg="org.apache.juli"/>
+    <allow pkg="org.apache.tomcat.jni"/>
+    <allow pkg="org.apache.tomcat.util"/>
+  </subpackage>
+  <subpackage name="el">
+    <allow pkg="javax.el"/>
+    <allow pkg="org.apache.el"/>
+  </subpackage>
+  <subpackage name="jasper">
+    <allow pkg="javax.el"/>
+    <allow pkg="javax.servlet"/>
+    <allow pkg="org.apache.jasper"/>
+    <allow pkg="org.apache.juli"/>
+    <allow pkg="org.apache.tomcat" exact-match="true"/>
+    <allow pkg="org.apache.tomcat.util.scan"/>
+    <allow pkg="org.apache.tools.ant"/>
+    <allow pkg="org.eclipse.jdt"/>
+  </subpackage>
+  <subpackage name="juli">
+    <allow pkg="org.apache.juli"/>
+  </subpackage>
+  <subpackage name="naming">
+    <allow pkg="javax.mail"/>
+    <allow pkg="javax.wsdl"/>
+    <allow pkg="org.apache.naming"/>
+    <!-- To remove? -->
+    <allow class="org.apache.catalina.util.RequestUtil"/>
+    <allow class="org.apache.tomcat.util.http.FastHttpDateFormat"/>
+  </subpackage>
+  <subpackage name="tomcat">
+    <allow pkg="javax.servlet"/>
+    <subpackage name="buildutil">
+      <allow pkg="org.apache.tools.ant"/>
+    </subpackage>
+    <subpackage name="jni">
+      <!-- To remove? -->
+      <allow class="org.apache.tomcat.util.ExceptionUtils"/>
+    </subpackage>
+    <subpackage name="util">
+      <allow pkg="org.apache.juli"/>
+      <allow pkg="org.apache.tomcat.jni"/>
+      <allow pkg="org.apache.tomcat.util"/>
+      <disallow pkg="org.apache.util.scan"/>
+      <!-- To remove? -->
+      <allow class="org.apache.catalina.Globals"/>
+      <allow class="org.apache.coyote.RequestGroupInfo"/>
+      <!-- end to remove -->
+      <subpackage name="scan">
+        <allow pkg="org.apache.tomcat" exact-match="true"/>
+      </subpackage>
+    </subpackage>
+  </subpackage>
+</import-control>
\ No newline at end of file

Propchange: tomcat/trunk/res/checkstyle/org-import-control.xml
------------------------------------------------------------------------------
    svn:eol-style = native



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message