Moved all Eclipse specific files into res/ide-support/eclipse.
authortimw <timw@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 28 Sep 2010 09:36:08 +0000 (09:36 +0000)
committertimw <timw@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 28 Sep 2010 09:36:08 +0000 (09:36 +0000)
Removed spaces from launch target filenames.
Corrected launch targets to run in output/build instead of root directory (still not sure if they're a good idea)
Added an Ant ide-eclipse target to prepare the working copy to be built with Eclipse and create Eclipse project files.
Updated the Building docs to document new Eclipse setup method.
Added descriptions of how to configure Eclipse to respect Tomcat coding conventions to the Building guide.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1002073 13f79535-47bb-0310-9956-ffa450edef68

Start Tomcat.launch [deleted file]
Stop Tomcat.launch [deleted file]
build.xml
eclipse.classpath [deleted file]
eclipse.project [deleted file]
res/ide-support/eclipse/eclipse.classpath [new file with mode: 0644]
res/ide-support/eclipse/eclipse.project [new file with mode: 0644]
res/ide-support/eclipse/start-tomcat.launch [new file with mode: 0644]
res/ide-support/eclipse/stop-tomcat.launch [new file with mode: 0644]
webapps/docs/building.xml

diff --git a/Start Tomcat.launch b/Start Tomcat.launch
deleted file mode 100644 (file)
index 4f4f1eb..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="start"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}"/>
-</launchConfiguration>
diff --git a/Stop Tomcat.launch b/Stop Tomcat.launch
deleted file mode 100644 (file)
index 21c00f4..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="stop"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}"/>
-</launchConfiguration>
index 5e5d7a2..fdad990 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1513,6 +1513,7 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
         <exclude name=".settings/**"/>
         <exclude name=".classpath"/>
         <exclude name=".project"/>
+        <exclude name="*.launch"/>
         <exclude name="modules/**"/>
         <exclude name="output/**"/>
         <exclude name="build.properties"/>
@@ -2242,6 +2243,19 @@ Apache Tomcat ${version} native binaries for Win64 AMD64/EMT64 platform.
     <get src="${sourcefile}" dest="${destfile}" />
   </target>
 
+  <!-- ============================ IDE Support ============================ -->
+
+  <target name="ide-eclipse" depends="deploy, extras-webservices-prepare"
+          description="Prepares the source tree to be built in Eclipse">
+
+    <!-- Copy the sample project files into the root directory -->
+    <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.project" tofile="${tomcat.home}/.project"/>
+    <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"/>
+
+    <echo>Eclipse project files created.
+Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workplace.</echo>
+  </target>
+
   <!-- ======================= Macros, Taskdefs etc ======================== -->
 
   <macrodef name="jarIt" description="utility macro for standard JAR packaging">
diff --git a/eclipse.classpath b/eclipse.classpath
deleted file mode 100644 (file)
index dbc7836..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<classpath>
-    <classpathentry kind="src" path="java"/>
-    <classpathentry kind="src" path="test"/>
-    <classpathentry kind="src" path="webapps/examples/WEB-INF/classes"/>
-    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-    <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
-    <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
-    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/tomcat-dbcp.jar" sourcepath="/TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/src/java"/>
-    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/jaxrpc-1.1-rc4/geronimo-spec-jaxrpc-1.1-rc4.jar"/>
-    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/wsdl4j-1.6.1/wsdl4j-1.6.1.jar"/>
-    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/ecj-3.6/ecj-3.6.jar"/>
-    <classpathentry kind="output" path=".settings/output"/>
-</classpath>
diff --git a/eclipse.project b/eclipse.project
deleted file mode 100644 (file)
index 016f076..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- 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.
--->
-<projectDescription>
-    <name>tomcat-7.0.x</name>
-    <comment></comment>
-    <projects>
-    </projects>
-    <buildSpec>
-        <buildCommand>
-            <name>org.eclipse.jdt.core.javabuilder</name>
-            <arguments>
-            </arguments>
-        </buildCommand>
-    </buildSpec>
-    <natures>
-        <nature>org.eclipse.jdt.core.javanature</nature>
-    </natures>
-</projectDescription>
diff --git a/res/ide-support/eclipse/eclipse.classpath b/res/ide-support/eclipse/eclipse.classpath
new file mode 100644 (file)
index 0000000..dbc7836
--- /dev/null
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<classpath>
+    <classpathentry kind="src" path="java"/>
+    <classpathentry kind="src" path="test"/>
+    <classpathentry kind="src" path="webapps/examples/WEB-INF/classes"/>
+    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+    <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+    <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/>
+    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/tomcat-dbcp.jar" sourcepath="/TOMCAT_LIBS_BASE/tomcat7-deps/dbcp/src/java"/>
+    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/jaxrpc-1.1-rc4/geronimo-spec-jaxrpc-1.1-rc4.jar"/>
+    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/wsdl4j-1.6.1/wsdl4j-1.6.1.jar"/>
+    <classpathentry kind="var" path="TOMCAT_LIBS_BASE/ecj-3.6/ecj-3.6.jar"/>
+    <classpathentry kind="output" path=".settings/output"/>
+</classpath>
diff --git a/res/ide-support/eclipse/eclipse.project b/res/ide-support/eclipse/eclipse.project
new file mode 100644 (file)
index 0000000..016f076
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<projectDescription>
+    <name>tomcat-7.0.x</name>
+    <comment></comment>
+    <projects>
+    </projects>
+    <buildSpec>
+        <buildCommand>
+            <name>org.eclipse.jdt.core.javabuilder</name>
+            <arguments>
+            </arguments>
+        </buildCommand>
+    </buildSpec>
+    <natures>
+        <nature>org.eclipse.jdt.core.javanature</nature>
+    </natures>
+</projectDescription>
diff --git a/res/ide-support/eclipse/start-tomcat.launch b/res/ide-support/eclipse/start-tomcat.launch
new file mode 100644 (file)
index 0000000..54c5a20
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="start"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}/output/build"/>
+</launchConfiguration>
diff --git a/res/ide-support/eclipse/stop-tomcat.launch b/res/ide-support/eclipse/stop-tomcat.launch
new file mode 100644 (file)
index 0000000..cb1e60c
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.apache.catalina.startup.Bootstrap"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="stop"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="tomcat-7.0.x"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dcatalina.home=${project_loc:/tomcat-7.0.x/java/org/apache/catalina/startup/Bootstrap.java}/output/build"/>
+</launchConfiguration>
index 55b203a..0dbddec 100644 (file)
@@ -161,11 +161,6 @@ and the following steps have been used by some developers.
 </p>
 
 <p>
-<b>NOTE:</b> You <b>must</b> complete all the above steps to fetch
-dependency libraries and build Tomcat before you can setup an Eclipse project and start
-using it.
-</p>
-<p>
 <b>NOTE:</b> This will not let you build everything under Eclipse;
 the build process requires use of Ant for the many stages that aren't
 simple Java compilations.
@@ -174,19 +169,19 @@ get warnings, reformat code, perform refactorings, run Tomcat
 under the IDE, and so on.
 </p>
 <p>
-Complete the download of all third party dependencies required to compile the Tomcat
-source in Eclipse:
+Sample Eclipse project files and launch targets are provided in the 
+<code>res/ide-support/eclipse</code> directory of the source tree.
+The instructions below will automatically copy these into the required locations.
+</p>
+<p>
+An Ant target is provided as a convenience to download all binary dependencies, and to create
+the Eclipse project and classpath files in the root of the source tree.
 <br/>
 <code><br/>
     cd ${tomcat.source}<br/>
-    ant extras<br/>
+    ant ide-eclipse<br/>
 </code>
 </p>
-<p>
-Sample Eclipse project and classpath files are provided in the root directory of the source tree.
-The sample files are named <code>eclipse.project</code> and <code>eclipse.classpath</code>, and must
-be copied to <code>.project</code> and <code>.classpath</code> respectively before proceeding.
-</p>
 
 <p>
 Start Eclipse and create a new Workspace.
@@ -212,21 +207,30 @@ and import the Tomcat project located there.
 </p>
 
 <p>
-You may see errors in your problems tab at this point about missing build path dependencies.
-If this happens you have forgotten to execute the <code>ant extras</code> build to download 
-these dependencies.
-</p>
-
-<p>
-<code>Start Tomcat</code> and <code>Stop Tomcat</code> launch configurations are provided in the
-root directory of the source tree and will be available in the <em>Run-&gt;Run Configurations</em>
-dialog. Use these to start and stop Tomcat from Eclipse. 
+<code>start-tomcat</code> and <code>stop-tomcat</code> launch configurations are provided in
+<code>res/ide-support/eclipse</code> and will be available in the <em>Run-&gt;Run Configurations</em>
+dialog. Use these to start and stop Tomcat from Eclipse.
 <br/>If you want to configure these yourself (or are using a different IDE) 
 then use <code>org.apache.catalina.startup.Bootstrap</code> as the main class,
-<code>start</code>/<code>stop</code> as program arguments, and specify <code>-Dcatalina.home=...</code> 
+<code>start</code>/<code>stop</code> etc. as program arguments, and specify <code>-Dcatalina.home=...</code> 
 (with the name of your build directory) as VM arguments.
 </p>
 
+<p>
+Tweaking a few formatting preferences will make it much easier to keep consistent with Tomcat 
+coding conventions (and have your contributions accepted):
+</p>
+<p>
+<table border="1">
+  <tr><td>Java -&gt; Code Style -> Formatter -&gt; Edit...</td>
+  <td>Tab policy: Spaces only<br/>Tab and Indentation size: 4</td></tr>
+  <tr><td>General -&gt; Editors -> Text Editors</td>
+  <td>Displayed tab width: 2<br/>Insert spaces for tabs<br/>Show whitespace characters (optional)</td></tr>
+  <tr><td>XML -&gt; XML Files -> Editor</td><td>Indent using spaces<br/>Indentation size: 2</td></tr>
+  <tr><td>Ant -&gt; Editor -> Formatter</td><td>Tab size: 2<br/>Use tab character instead of spaces: unchecked</td></tr>
+</table>
+</p>
+
 </section>
 
 <section name="Building with other IDEs">