This is an automated email from the ASF dual-hosted git repository. lihan pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new bc8a3870c5 Use filtersets for IDE config libs and versioning bc8a3870c5 is described below commit bc8a3870c5c4b0f9b1fc0a220b9c391986d43783 Author: Bailey Brownie <bailey.browni...@gmail.com> AuthorDate: Mon Feb 6 21:39:39 2023 -0500 Use filtersets for IDE config libs and versioning --- build.xml | 35 +++++++++++++++++----- res/ide-support/eclipse/eclipse.classpath | 20 ++++++------- .../eclipse/org.eclipse.jdt.core.prefs.properties | 6 ++-- res/ide-support/idea/misc.xml | 2 +- res/ide-support/idea/tomcat.iml | 20 ++++++------- .../netbeans/nb-tomcat-build.properties | 2 +- res/ide-support/netbeans/nb-tomcat.xml | 2 +- res/ide-support/netbeans/project.xml | 16 +++++----- webapps/docs/building.xml | 13 -------- 9 files changed, 61 insertions(+), 55 deletions(-) diff --git a/build.xml b/build.xml index aba58136b3..fb67c70d7c 100644 --- a/build.xml +++ b/build.xml @@ -244,6 +244,20 @@ <path refid="tomcat.classpath" /> </path> + <!-- Classpath filter set --> + <filterset id="classpath.filters"> + <filter token="ANT_JAR" value="${ant.home}/lib/ant.jar"/> + <filter token="JDT_JAR" value="${jdt.jar}"/> + <filter token="EASYMOCK_JAR" value="${easymock.jar}"/> + <filter token="HAMCREST_JAR" value="${hamcrest.jar}"/> + <filter token="CGLIB_JAR" value="${cglib.jar}"/> + <filter token="OBJENESIS_JAR" value="${objenesis.jar}"/> + <filter token="BND_JAR" value="${bnd.jar}"/> + <filter token="MIGRATION_JAR" value="${migration-lib.jar}"/> + <filter token="UNBOUNDID_JAR" value="${unboundid.jar}"/> + <filter token="JUNIT_JAR" value="${junit.jar}"/> + </filterset> + <!-- Version info filter set --> <tstamp> <format property="year" pattern="yyyy" locale="en" timezone="UTC"/> @@ -3759,11 +3773,16 @@ asf.ldap.username=${release.asfusername} <!-- 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"/> + <copy file="${tomcat.home}/res/ide-support/eclipse/eclipse.classpath" tofile="${tomcat.home}/.classpath"> + <filterset refid="classpath.filters"/> + <filterset refid="version.filters"/> + </copy> <!-- Copy compiler settings file --> - <mkdir dir="${tomcat.home}/.settings" /> - <copy file="${tomcat.home}/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties" tofile="${tomcat.home}/.settings/org.eclipse.jdt.core.prefs"/> + <mkdir dir="${tomcat.home}/.settings"/> + <copy file="${tomcat.home}/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties" tofile="${tomcat.home}/.settings/org.eclipse.jdt.core.prefs"> + <filterset refid="version.filters"/> + </copy> <echo>Eclipse project files created. Read the Building page on the Apache Tomcat documentation site for details on how to configure your Eclipse workspace.</echo> @@ -3777,13 +3796,11 @@ Read the Building page on the Apache Tomcat documentation site for details on ho <copy todir="${tomcat.home}/.idea"> <fileset dir="${tomcat.home}/res/ide-support/idea"/> + <filterset refid="classpath.filters"/> + <filterset refid="version.filters"/> </copy> - <echo>IntelliJ IDEA project directory created. Please create PATH VARIABLES for - - ANT_HOME = ${ant.home} - TOMCAT_BUILD_LIBS = ${base.path} - </echo> + <echo>IntelliJ IDEA project directory created.</echo> </target> <!-- ============================ NetBeans =============================== --> @@ -3819,6 +3836,8 @@ Use the "ide-netbeans-replace" target if you wish to overwrite them.</echo> <mkdir dir="${tomcat-nb.home}/"/> <copy todir="${tomcat-nb.home}" overwrite="true"> <fileset dir="${tomcat-nb.dist}"/> + <filterset refid="version.filters" /> + <filterset refid="classpath.filters"/> </copy> <echo>NetBeans project files created. Read the Building page on the Apache Tomcat documentation site for details on how to customise your NetBeans project.</echo> diff --git a/res/ide-support/eclipse/eclipse.classpath b/res/ide-support/eclipse/eclipse.classpath index 5c1bcdd282..a98e9c610a 100644 --- a/res/ide-support/eclipse/eclipse.classpath +++ b/res/ide-support/eclipse/eclipse.classpath @@ -19,16 +19,16 @@ <classpathentry kind="src" path="java"/> <classpathentry excluding="deployment/|tld/|webapp*/|webresources/" kind="src" path="test"/> <classpathentry kind="src" path="webapps/examples/WEB-INF/classes"/> - <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-@BUILD_JAVA_VERSION@"/> <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/> - <classpathentry kind="var" path="ANT_HOME/lib/ant.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/ecj-4.26/ecj-4.26.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/easymock-4.3/easymock-4.3.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/hamcrest-2.2/hamcrest-2.2.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/cglib-3.3.0/cglib-nodep-3.3.0.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/objenesis-3.3/objenesis-3.3.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/bnd-6.4.0/biz.aQute.bnd-6.4.0.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/migration-1.0.6/jakartaee-migration-1.0.6-shaded.jar"/> - <classpathentry kind="var" path="TOMCAT_LIBS_BASE/unboundid-6.0.7/unboundid-ldapsdk-6.0.7.jar"/> + <classpathentry kind="lib" path="@ANT_JAR@"/> + <classpathentry kind="lib" path="@JDT_JAR@"/> + <classpathentry kind="lib" path="@EASYMOCK_JAR@"/> + <classpathentry kind="lib" path="@HAMCREST_JAR@"/> + <classpathentry kind="lib" path="@CGLIB_JAR@"/> + <classpathentry kind="lib" path="@OBJENESIS_JAR@"/> + <classpathentry kind="lib" path="@BND_JAR@"/> + <classpathentry kind="lib" path="@MIGRATION_JAR@"/> + <classpathentry kind="lib" path="@UNBOUNDID_JAR@"/> <classpathentry kind="output" path=".settings/output"/> </classpath> diff --git a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties index c7fcfab4bb..0e28ec4353 100644 --- a/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties +++ b/res/ide-support/eclipse/org.eclipse.jdt.core.prefs.properties @@ -15,6 +15,6 @@ # limitations under the License. # ----------------------------------------------------------------------------- eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=@BUILD_JAVA_VERSION@ +org.eclipse.jdt.core.compiler.compliance=@MIN_JAVA_VERSION@ +org.eclipse.jdt.core.compiler.source=@BUILD_JAVA_VERSION@ diff --git a/res/ide-support/idea/misc.xml b/res/ide-support/idea/misc.xml index 2f3538ae29..0f6a7a25c6 100644 --- a/res/ide-support/idea/misc.xml +++ b/res/ide-support/idea/misc.xml @@ -16,7 +16,7 @@ limitations under the License. --> <project version="4"> - <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK"> + <component name="ProjectRootManager" version="2" languageLevel="JDK_@BUILD_JAVA_VERSION@" default="false" project-jdk-name="@BUILD_JAVA_VERSION@" project-jdk-type="JavaSDK"> <output url="file://$PROJECT_DIR$/.idea/output" /> </component> </project> \ No newline at end of file diff --git a/res/ide-support/idea/tomcat.iml b/res/ide-support/idea/tomcat.iml index 07b6c5a32b..08e6c05f7a 100644 --- a/res/ide-support/idea/tomcat.iml +++ b/res/ide-support/idea/tomcat.iml @@ -30,7 +30,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$ANT_HOME$/lib/ant.jar!/" /> + <root url="jar://@ANT_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -41,7 +41,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/junit-4.13.2/junit-4.13.2.jar!/" /> + <root url="jar://@JUNIT_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -50,7 +50,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/ecj-4.26/ecj-4.26.jar!/" /> + <root url="jar://@JDT_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -59,7 +59,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/easymock-4.3/easymock-4.3.jar!/" /> + <root url="jar://@EASYMOCK_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -68,7 +68,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/hamcrest-2.2/hamcrest-2.2.jar!/" /> + <root url="jar://@HAMCREST_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -77,7 +77,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/cglib-3.3.0/cglib-nodep-3.3.0.jar!/" /> + <root url="jar://@CGLIB_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -86,7 +86,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/objenesis-3.3/objenesis-3.3.jar!/" /> + <root url="jar://@OBJENESIS_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -95,7 +95,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/bnd-6.4.0/biz.aQute.bnd-6.4.0.jar!/" /> + <root url="jar://@BND_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -104,7 +104,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/migration-1.0.6/jakartaee-migration-1.0.6-shaded.jar!/" /> + <root url="jar://@MIGRATION_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> @@ -113,7 +113,7 @@ <orderEntry type="module-library"> <library> <CLASSES> - <root url="jar://$TOMCAT_BUILD_LIBS$/unboundid-6.0.7/unboundid-ldapsdk-6.0.7.jar!/" /> + <root url="jar://@UNBOUNDID_JAR@!/" /> </CLASSES> <JAVADOC /> <SOURCES /> diff --git a/res/ide-support/netbeans/nb-tomcat-build.properties b/res/ide-support/netbeans/nb-tomcat-build.properties index e534367ca8..165bc2c1e4 100644 --- a/res/ide-support/netbeans/nb-tomcat-build.properties +++ b/res/ide-support/netbeans/nb-tomcat-build.properties @@ -37,7 +37,7 @@ nb-test.io-method=org.apache.coyote.http11.Http11NioProtocol # it is not possible to retrieve the classpaths from the build to # use in the NetBeans targets, so they must be explicitly declared -nb-test.classpath=${test.classes}:${tomcat.build}/webapps/examples/WEB-INF/classes:${base.path}/junit-4.13.2/junit-4.13.2.jar:${base.path}/easymock-4.3/easymock-4.3.jar:${base.path}/objenesis-3.3/objenesis-3.3.jar:${base.path}/cglib-3.3.0/cglib-nodep-3.3.0.jar:${base.path}/hamcrest-2.2/hamcrest-2.2.jar:${base.path}/ecj-4.26/ecj-4.26.jar:${tomcat.classes} +nb-test.classpath=${test.classes}:${tomcat.build}/webapps/examples/WEB-INF/classes:@JUNIT_JAR@:@EASYMOCK_JAR@:@OBJENESIS_JAR@:@CGLIB_JAR@:@HAMCREST_JAR@:@ECJ_JAR@:@UNBOUNDID_JAR@:${tomcat.classes} # Extra properties used by the Tomcat project additional NetBeans targets. diff --git a/res/ide-support/netbeans/nb-tomcat.xml b/res/ide-support/netbeans/nb-tomcat.xml index c9450581ce..85ae7fe670 100644 --- a/res/ide-support/netbeans/nb-tomcat.xml +++ b/res/ide-support/netbeans/nb-tomcat.xml @@ -19,7 +19,7 @@ Supplementary build targets for the Tomcat project under NetBeans. Use the project root as basedir to be consistent with standard build. --> -<project basedir=".." name="Tomcat_8.0"> +<project basedir=".." name="Tomcat_@VERSION_MAJOR_MINOR@"> <!-- load the standard and user Tomcat build properties now, diff --git a/res/ide-support/netbeans/project.xml b/res/ide-support/netbeans/project.xml index 3eb6aa8536..37a55e20ed 100644 --- a/res/ide-support/netbeans/project.xml +++ b/res/ide-support/netbeans/project.xml @@ -34,7 +34,7 @@ <configuration> <general-data xmlns="http://www.netbeans.org/ns/freeform-project/1"> <!-- Do not use Project Properties customizer when editing this file manually. --> - <name>Tomcat 8.0</name> + <name>Tomcat @VERSION_MAJOR_MINOR@</name> <properties> <!-- load the local Tomcat build.properties, especially base.path. --> <property-file>./build.properties</property-file> @@ -163,7 +163,7 @@ </view> <subprojects/> </general-data> - <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/3"> + <java-data xmlns="http://www.netbeans.org/ns/freeform-project-java/5"> <!-- Warning: the classpath elements used below CANNOT include any Properties because NetBeans will not expand them! Sadly, @@ -178,19 +178,19 @@ --> <compilation-unit> <package-root>java</package-root> - <classpath mode="compile">${base.path}/ecj-4.26/ecj-4.26.jar:${base.path}/bnd-6.4.0/biz.aQute.bnd-6.4.0.jar:${base.path}/migration-1.0.6/jakartaee-migration-1.0.6-shaded.jar:${ant.includes}/</classpath> - <source-level>1.7</source-level> + <classpath mode="compile">@JDT_JAR@:@BND_JAR@:@MIGRATION_JAR@:${ant.includes}/</classpath> + <source-level>@BUILD_JAVA_VERSION@</source-level> </compilation-unit> <compilation-unit> <package-root>webapps/docs/appdev/sample/src</package-root> - <classpath mode="compile">${base.path}/servletapi-2.3/servletapi-2.3.jar</classpath> - <source-level>1.7</source-level> + <classpath mode="compile">output/classes</classpath> + <source-level>@BUILD_JAVA_VERSION@</source-level> </compilation-unit> <compilation-unit> <package-root>test</package-root> <unit-tests/> - <classpath mode="compile">output/classes:output/testclasses:${base.path}/junit-4.13.2/junit-4.13.2.jar:${base.path}/easymock-4.3/easymock-4.3.jar:${base.path}/objenesis-3.3/objenesis-3.3.jar:${base.path}/cglib-3.3.0/cglib-nodep-3.3.0.jar:${base.path}/hamcrest/hamcrest-2.2.jar</classpath> - <source-level>1.7</source-level> + <classpath mode="compile">output/classes:output/testclasses:output/build/webapps/examples/WEB-INF/classes:@JUNIT_JAR@:@EASYMOCK_JAR@:@OBJENESIS_JAR@:@CGLIB_JAR@:@HAMCREST_JAR@:@UNBOUNDID_JAR@</classpath> + <source-level>@BUILD_JAVA_VERSION@</source-level> </compilation-unit> </java-data> </configuration> diff --git a/webapps/docs/building.xml b/webapps/docs/building.xml index ee78249027..86c729488e 100644 --- a/webapps/docs/building.xml +++ b/webapps/docs/building.xml @@ -218,19 +218,6 @@ the Eclipse project and classpath files in the root of the source tree. Start Eclipse and create a new Workspace. </p> -<p> -Open the <em>Preferences</em> dialog and then select <em>Java->Build Path->Classpath -Variables</em> to add two new <em>Classpath Variables</em>: -</p> - - -<table class="defaultTable"> - <tr><td>TOMCAT_LIBS_BASE</td><td>The same location as the <code>base.path</code> - setting in <code>build.properties</code>, where the binary dependencies have been downloaded</td></tr> - <tr><td>ANT_HOME</td><td>the base path of Ant <ant-version-required/> or later</td></tr> -</table> - - <p> Use <em>File->Import</em> and choose <em>Existing Projects into Workspace</em>. From there choose the root directory of the Tomcat source tree (<code>${tomcat.source}</code>) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org