LUCENE-4614: Create dev-tools/eclipse/dot.classpath automatically

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1419893 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-12-10 23:59:19 +00:00
parent f79de4b70e
commit 4e584a86a6
3 changed files with 88 additions and 196 deletions

View File

@ -170,11 +170,28 @@
<target name="eclipse" depends="resolve" description="Setup Eclipse configuration">
<copy file="dev-tools/eclipse/dot.project" tofile=".project" overwrite="false"/>
<copy file="dev-tools/eclipse/dot.classpath" tofile=".classpath" overwrite="true"/>
<mkdir dir=".settings"/>
<copy todir=".settings/" overwrite="true">
<fileset dir="dev-tools/eclipse/dot.settings" includes="*.prefs" />
</copy>
<pathconvert property="eclipse.fileset.sourcefolders" pathsep="|" dirsep="/">
<dirset dir="${basedir}/lucene" includes="**/src/java, **/src/resources, **/src/test, **/src/test-files, **/src/examples" excludes="tools/**, build/**, backwards/**" />
<dirset dir="${basedir}/solr" includes="**/src/java, **/src/resources, **/src/test, **/src/test-files, **/src/examples" excludes="build/**" />
<map from="${basedir}/" to=""/>
</pathconvert>
<!-- TODO: find a better way to exclude duplicate JAR files & fix the servlet-api mess! -->
<pathconvert property="eclipse.fileset.libs" pathsep="|" dirsep="/">
<fileset dir="${basedir}/lucene" includes="**/lib/*.jar" excludes="**/*servlet-api*.jar, analysis/uima/**, tools/**, build/**"/>
<fileset dir="${basedir}/solr" includes="**/lib/*.jar" excludes="core/lib/*servlet-api*.jar, contrib/analysis-extras/**, test-framework/**, build/**, dist/**, package/**" />
<map from="${basedir}/" to=""/>
</pathconvert>
<xslt in="${ant.file}" out=".classpath" style="dev-tools/eclipse/dot.classpath.xsl" force="true">
<outputproperty name="indent" value="yes"/>
<param name="eclipse.fileset.libs" expression="${eclipse.fileset.libs}"/>
<param name="eclipse.fileset.sourcefolders" expression="${eclipse.fileset.sourcefolders}"/>
</xslt>
<echo>
SUCCESS: You must right-click your project and choose Refresh.
Your project must use a Java 6 JRE.

View File

@ -1,195 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="lucene/core/src/java"/>
<classpathentry kind="src" path="lucene/core/src/resources"/>
<classpathentry kind="src" path="lucene/core/src/test"/>
<classpathentry kind="src" path="lucene/codecs/src/java"/>
<classpathentry kind="src" output="eclipse-build/codecs" path="lucene/codecs/src/resources"/>
<classpathentry kind="src" path="lucene/codecs/src/test"/>
<classpathentry kind="src" path="lucene/demo/src/java"/>
<classpathentry kind="src" path="lucene/demo/src/resources"/>
<classpathentry kind="src" path="lucene/demo/src/test"/>
<classpathentry kind="src" path="lucene/highlighter/src/java"/>
<classpathentry kind="src" path="lucene/highlighter/src/test"/>
<classpathentry kind="src" path="lucene/memory/src/java"/>
<classpathentry kind="src" path="lucene/memory/src/test"/>
<classpathentry kind="src" path="lucene/misc/src/java"/>
<classpathentry kind="src" path="lucene/misc/src/test"/>
<classpathentry kind="src" path="lucene/sandbox/src/java"/>
<classpathentry kind="src" path="lucene/sandbox/src/test"/>
<classpathentry kind="src" path="lucene/test-framework/src/java"/>
<classpathentry kind="src" output="eclipse-build/tests-framework" path="lucene/test-framework/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/common/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-common" path="lucene/analysis/common/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/common/src/test"/>
<classpathentry kind="src" path="lucene/analysis/icu/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-icu" path="lucene/analysis/icu/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/icu/src/test"/>
<classpathentry kind="src" path="lucene/analysis/kuromoji/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-kuromoji" path="lucene/analysis/kuromoji/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/kuromoji/src/test"/>
<classpathentry kind="src" path="lucene/analysis/phonetic/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-phonetic" path="lucene/analysis/phonetic/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/phonetic/src/test"/>
<classpathentry kind="src" path="lucene/analysis/smartcn/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-smartcn" path="lucene/analysis/smartcn/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/smartcn/src/test"/>
<classpathentry kind="src" path="lucene/analysis/stempel/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-stempel" path="lucene/analysis/stempel/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/stempel/src/test"/>
<classpathentry kind="src" path="lucene/analysis/morfologik/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-morfologik" path="lucene/analysis/morfologik/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/morfologik/src/test"/>
<classpathentry kind="src" path="lucene/analysis/uima/src/java"/>
<classpathentry kind="src" output="eclipse-build/analysis-uima" path="lucene/analysis/uima/src/resources"/>
<classpathentry kind="src" path="lucene/analysis/uima/src/test"/>
<classpathentry kind="src" path="lucene/benchmark/src/java"/>
<classpathentry kind="src" path="lucene/benchmark/src/test"/>
<classpathentry excluding="src" including="conf/**" kind="src" path="lucene/benchmark"/>
<classpathentry kind="src" path="lucene/classification/src/java"/>
<classpathentry kind="src" path="lucene/classification/src/test"/>
<classpathentry kind="src" path="lucene/facet/src/java"/>
<classpathentry kind="src" path="lucene/facet/src/examples"/>
<classpathentry kind="src" path="lucene/facet/src/test"/>
<classpathentry kind="src" path="lucene/grouping/src/java"/>
<classpathentry kind="src" path="lucene/grouping/src/test"/>
<classpathentry kind="src" path="lucene/join/src/java"/>
<classpathentry kind="src" path="lucene/join/src/test"/>
<classpathentry kind="src" path="lucene/queries/src/java"/>
<classpathentry kind="src" path="lucene/queries/src/test"/>
<classpathentry kind="src" path="lucene/queryparser/src/java"/>
<classpathentry kind="src" path="lucene/queryparser/src/resources"/>
<classpathentry kind="src" path="lucene/queryparser/src/test"/>
<classpathentry kind="src" path="lucene/suggest/src/java"/>
<classpathentry kind="src" path="lucene/suggest/src/test"/>
<classpathentry kind="src" path="lucene/spatial/src/java"/>
<classpathentry kind="src" path="lucene/spatial/src/test"/>
<classpathentry kind="src" path="lucene/spatial/src/test-files"/>
<classpathentry kind="lib" path="lucene/spatial/lib/spatial4j-0.3.jar"/>
<classpathentry kind="src" path="solr/core/src/java"/>
<classpathentry kind="src" path="solr/core/src/test"/>
<classpathentry kind="src" path="solr/core/src/test-files"/>
<classpathentry kind="src" path="solr/solrj/src/java"/>
<classpathentry kind="src" path="solr/solrj/src/test"/>
<classpathentry kind="src" path="solr/solrj/src/test-files"/>
<classpathentry kind="src" path="solr/test-framework/src/java"/>
<classpathentry kind="src" path="solr/contrib/analysis-extras/src/java"/>
<classpathentry kind="src" path="solr/contrib/analysis-extras/src/test"/>
<classpathentry kind="src" path="solr/contrib/analysis-extras/src/test-files"/>
<classpathentry kind="src" path="solr/contrib/clustering/src/java"/>
<classpathentry kind="src" path="solr/contrib/clustering/src/test"/>
<classpathentry kind="src" path="solr/contrib/clustering/src/test-files"/>
<classpathentry kind="src" path="solr/contrib/dataimporthandler/src/java"/>
<classpathentry kind="src" path="solr/contrib/dataimporthandler/src/test"/>
<classpathentry kind="src" path="solr/contrib/dataimporthandler/src/test-files"/>
<classpathentry kind="src" path="solr/contrib/dataimporthandler-extras/src/java"/>
<classpathentry kind="src" path="solr/contrib/dataimporthandler-extras/src/test"/>
<classpathentry kind="src" path="solr/contrib/dataimporthandler-extras/src/test-files"/>
<classpathentry kind="src" path="solr/contrib/extraction/src/java"/>
<classpathentry kind="src" path="solr/contrib/extraction/src/test"/>
<classpathentry kind="src" path="solr/contrib/extraction/src/test-files"/>
<classpathentry kind="src" path="solr/contrib/langid/src/java"/>
<classpathentry kind="src" path="solr/contrib/langid/src/resources"/>
<classpathentry kind="src" path="solr/contrib/langid/src/test"/>
<classpathentry kind="src" path="solr/contrib/langid/src/test-files"/>
<classpathentry kind="src" path="solr/contrib/uima/src/java"/>
<classpathentry kind="src" path="solr/contrib/uima/src/resources"/>
<classpathentry kind="src" path="solr/contrib/uima/src/test"/>
<classpathentry kind="src" path="solr/contrib/uima/src/test-files"/>
<classpathentry kind="src" path="solr/contrib/velocity/src/java"/>
<classpathentry kind="src" path="solr/contrib/velocity/src/test"/>
<classpathentry kind="src" path="solr/contrib/velocity/src/test-files"/>
<classpathentry kind="lib" path="lucene/test-framework/lib/ant-1.8.2.jar"/>
<classpathentry kind="lib" path="lucene/test-framework/lib/junit-4.10.jar"/>
<classpathentry kind="lib" path="lucene/sandbox/lib/jakarta-regexp-1.4.jar"/>
<classpathentry kind="lib" path="lucene/analysis/icu/lib/icu4j-49.1.jar"/>
<classpathentry kind="lib" path="lucene/analysis/phonetic/lib/commons-codec-1.7.jar"/>
<classpathentry kind="lib" path="lucene/analysis/morfologik/lib/morfologik-fsa-1.5.3.jar"/>
<classpathentry kind="lib" path="lucene/analysis/morfologik/lib/morfologik-polish-1.5.3.jar"/>
<classpathentry kind="lib" path="lucene/analysis/morfologik/lib/morfologik-stemming-1.5.3.jar"/>
<classpathentry kind="lib" path="lucene/benchmark/lib/commons-compress-1.4.1.jar"/>
<classpathentry kind="lib" path="lucene/benchmark/lib/xercesImpl-2.9.1.jar"/>
<classpathentry kind="lib" path="lucene/benchmark/lib/nekohtml-1.9.17.jar"/>
<classpathentry kind="lib" path="solr/core/lib/commons-fileupload-1.2.1.jar"/>
<classpathentry kind="lib" path="solr/core/lib/commons-cli-1.2.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/httpclient-4.1.3.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/httpcore-4.1.4.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/httpmime-4.1.3.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/commons-io-2.1.jar"/>
<classpathentry kind="lib" path="solr/core/lib/commons-lang-2.6.jar"/>
<classpathentry kind="lib" path="solr/core/lib/easymock-2.2.jar"/>
<classpathentry kind="lib" path="solr/core/lib/guava-13.0.1.jar"/>
<classpathentry kind="lib" path="solr/core/lib/metrics-core-2.1.2.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/jcl-over-slf4j-1.6.4.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/log4j-over-slf4j-1.6.4.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/slf4j-api-1.6.4.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/slf4j-jdk14-1.6.4.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/wstx-asl-3.2.7.jar"/>
<classpathentry kind="lib" path="solr/solrj/lib/zookeeper-3.4.5.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-continuation-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-deploy-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-http-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-io-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-jmx-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-security-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-server-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-servlet-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-util-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-webapp-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/jetty-xml-8.1.8.v20121106.jar"/>
<classpathentry kind="lib" path="solr/example/lib/servlet-api-3.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/carrot2-core-3.5.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/hppc-0.3.3.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/jackson-core-asl-1.7.4.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/jackson-mapper-asl-1.7.4.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/mahout-collections-0.3.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/mahout-math-0.3.jar"/>
<classpathentry kind="lib" path="solr/contrib/clustering/lib/simple-xml-2.4.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/dataimporthandler/lib/activation-1.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/dataimporthandler/lib/mail-1.4.1.jar"/>
<classpathentry kind="lib" path="solr/example/example-DIH/solr/db/lib/derby-10.9.1.0.jar"/>
<classpathentry kind="lib" path="solr/example/example-DIH/solr/db/lib/hsqldb-1.8.0.10.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/bcmail-jdk15-1.45.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/bcprov-jdk15-1.45.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/boilerpipe-1.1.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/dom4j-1.6.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/metadata-extractor-2.4.0-beta-1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/netcdf-4.2-min.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/rome-0.9.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/tagsoup-1.2.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/xmlbeans-2.3.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/langid/lib/langdetect-1.1-20120112.jar"/>
<classpathentry kind="lib" path="solr/contrib/langid/lib/jsonic-1.2.7.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/commons-digester-2.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/AlchemyAPIAnnotator-2.3.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/OpenCalaisAnnotator-2.3.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/Tagger-2.3.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/WhitespaceTokenizer-2.3.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/uima/lib/uimaj-core-2.3.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/velocity/lib/velocity-1.6.4.jar"/>
<classpathentry kind="lib" path="solr/contrib/velocity/lib/velocity-tools-2.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/velocity/lib/commons-beanutils-1.7.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/velocity/lib/commons-collections-3.2.1.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="lucene/test-framework/lib/randomizedtesting-runner-2.0.5.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/apache-mime4j-core-0.7.2.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/apache-mime4j-dom-0.7.2.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/fontbox-1.7.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/icu4j-49.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/isoparser-1.0-RC-1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/jdom-1.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/jempbox-1.7.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/juniversalchardet-1.0.3.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/pdfbox-1.7.0.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/poi-3.8.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/poi-ooxml-3.8.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/poi-ooxml-schemas-3.8.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/poi-scratchpad-3.8.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/tika-core-1.2.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/tika-parsers-1.2.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/vorbis-java-core-0.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/vorbis-java-tika-0.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/xercesImpl-2.9.1.jar"/>
<classpathentry kind="lib" path="solr/contrib/extraction/lib/xz-1.0.jar"/>
<classpathentry kind="output" path="eclipse-build/other"/>
</classpath>

View File

@ -0,0 +1,70 @@
<?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.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings"
extension-element-prefixes="str"
>
<xsl:param name="eclipse.fileset.sourcefolders"/>
<xsl:param name="eclipse.fileset.libs"/>
<!--
NOTE: This template matches the root element of any given input XML document!
The XSL input file is ignored completely.
-->
<xsl:template match="/">
<classpath>
<xsl:for-each select="str:split($eclipse.fileset.sourcefolders,'|')">
<!-- hack to sort the list, starts-with() returns "true" which sorts before "false" if descending: -->
<xsl:sort select="string(starts-with(text(), 'lucene/core/'))" order="descending" lang="en"/>
<xsl:sort select="string(starts-with(text(), 'lucene/test-framework/'))" order="descending" lang="en"/>
<xsl:sort select="string(starts-with(text(), 'lucene/'))" order="descending" lang="en"/>
<xsl:sort select="string(starts-with(text(), 'solr/core/'))" order="descending" lang="en"/>
<xsl:sort select="string(starts-with(text(), 'solr/solrj/'))" order="descending" lang="en"/>
<xsl:sort select="string(starts-with(text(), 'solr/test-framework/'))" order="descending" lang="en"/>
<xsl:sort select="string(starts-with(text(), 'solr/'))" order="descending" lang="en"/>
<!-- all others in one group above are sorted by path name: -->
<xsl:sort select="text()" order="ascending" lang="en"/>
<classpathentry kind="src" path="{.}">
<!-- make Lucene's resource folders unique (for SPI), but leave the main SPI in default target folder: -->
<xsl:if test="starts-with(.,'lucene/') and not(starts-with(.,'lucene/core')) and contains(.,'/src/resources')">
<xsl:attribute name="output">
<xsl:text>eclipse-build/</xsl:text><xsl:value-of select="position()"/>
</xsl:attribute>
</xsl:if>
</classpathentry>
<!-- special case for benchmark, we add extra entry after the tests: -->
<xsl:if test="text()='lucene/benchmark/src/test'">
<classpathentry excluding="src" including="conf/**" kind="src" path="lucene/benchmark"/>
</xsl:if>
</xsl:for-each>
<!-- the main resources folder is here (see above), so it's listed after the test-framework resources, making preflex-override work: -->
<classpathentry kind="output" path="eclipse-build/main"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<xsl:for-each select="str:split($eclipse.fileset.libs,'|')">
<!-- sort the jars by path name: -->
<xsl:sort select="text()" order="ascending" lang="en"/>
<classpathentry kind="lib" path="{.}"/>
</xsl:for-each>
</classpath>
</xsl:template>
</xsl:stylesheet>