You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2012/08/28 08:50:46 UTC
svn commit: r1377991 - in /lucene/dev/trunk: ./ lucene/
lucene/tools/src/java/ lucene/tools/src/java/org/apache/lucene/validation/
solr/ solr/example/solr-webapp/ solr/webapp/
Author: uschindler
Date: Tue Aug 28 06:50:46 2012
New Revision: 1377991
URL: http://svn.apache.org/viewvc?rev=1377991&view=rev
Log:
LUCENE-3923: Faster SVN WC checks
Added:
lucene/dev/trunk/extra-targets.xml
- copied, changed from r1377664, lucene/dev/trunk/build-clover.xml
Removed:
lucene/dev/trunk/build-clover.xml
lucene/dev/trunk/lucene/tools/src/java/org/apache/lucene/validation/SVNEolCheckTask.java
Modified:
lucene/dev/trunk/build.xml
lucene/dev/trunk/lucene/build.xml
lucene/dev/trunk/lucene/common-build.xml
lucene/dev/trunk/lucene/tools/src/java/lucene-solr.antlib.xml
lucene/dev/trunk/solr/build.xml
lucene/dev/trunk/solr/example/solr-webapp/.gitignore (props changed)
lucene/dev/trunk/solr/webapp/build.xml
Modified: lucene/dev/trunk/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/build.xml?rev=1377991&r1=1377990&r2=1377991&view=diff
==============================================================================
--- lucene/dev/trunk/build.xml (original)
+++ lucene/dev/trunk/build.xml Tue Aug 28 06:50:46 2012
@@ -75,12 +75,6 @@
<fail if="validate.patternsFound">The following files contain @author tags or nocommits:${line.separator}${validate.patternsFound}</fail>
</target>
- <target name="check-svn-properties">
- <subant target="-check-svn-properties" inheritall="false" failonerror="true">
- <fileset dir="lucene" includes="build.xml" />
- </subant>
- </target>
-
<target name="rat-sources" description="Runs rat across all sources and tests">
<sequential><subant target="rat-sources" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />
@@ -254,17 +248,21 @@
</sequential>
</target>
+ <target name="check-svn-working-copy">
+ <subant target="check-svn-working-copy" inheritall="false" failonerror="true">
+ <fileset dir="." includes="extra-targets.xml" />
+ </subant>
+ </target>
+
<!-- Calls only generate-clover-reports on Lucene, as Solr's is just a clone with other target; the database itsself is fixed -->
<target name="generate-clover-reports">
<subant target="generate-clover-reports" inheritall="false" failonerror="true">
- <fileset dir="." includes="build-clover.xml" />
+ <fileset dir="." includes="extra-targets.xml" />
</subant>
</target>
<!-- Jenkins tasks -->
- <!-- TODO: figure out how to run check-svn-properties for the various jenkins' that
- are configured in slow ways / have slow i/o systems -->
- <target name="jenkins-hourly" depends="clean,test,validate,-jenkins-javadocs-lint,-svn-status"/>
+ <target name="jenkins-hourly" depends="clean,test,validate,-jenkins-javadocs-lint,check-svn-working-copy"/>
<target name="jenkins-clover">
<antcall target="-jenkins-clover">
@@ -288,31 +286,4 @@
<target name="-jenkins-javadocs-lint" unless="-disable.javadocs-lint">
<antcall target="javadocs-lint"/>
</target>
-
- <!-- define here, as common-build is not included! -->
- <property name="svn.exe" value="svn" />
-
- <target name="-svn-status">
- <exec executable="${svn.exe}" dir="." failonerror="true">
- <arg value="status"/>
- <redirector outputproperty="svn.status.output">
- <outputfilterchain>
- <linecontainsregexp>
- <regexp pattern="^\?" />
- </linecontainsregexp>
- <tokenfilter>
- <replaceregex pattern="^........" replace="* " />
- <replacestring from="${file.separator}" to="/" />
- </tokenfilter>
- </outputfilterchain>
- </redirector>
- </exec>
- <fail message="Source checkout is dirty after running tests!!! Offending files:${line.separator}${svn.status.output}">
- <condition>
- <not>
- <equals arg1="${svn.status.output}" arg2=""/>
- </not>
- </condition>
- </fail>
- </target>
</project>
Copied: lucene/dev/trunk/extra-targets.xml (from r1377664, lucene/dev/trunk/build-clover.xml)
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/extra-targets.xml?p2=lucene/dev/trunk/extra-targets.xml&p1=lucene/dev/trunk/build-clover.xml&r1=1377664&r2=1377991&rev=1377991&view=diff
==============================================================================
--- lucene/dev/trunk/build-clover.xml (original)
+++ lucene/dev/trunk/extra-targets.xml Tue Aug 28 06:50:46 2012
@@ -17,7 +17,12 @@
limitations under the License.
-->
-<project name="clover" basedir=".">
+<project name="extra-targets" basedir=".">
+ <description>
+ This file is designed for importing into a main build file, and not intended
+ for standalone use.
+ </description>
+
<import file="lucene/common-build.xml"/>
<!--
@@ -46,4 +51,64 @@
<echo>You can find the merged Lucene/Solr Clover report in '${clover.report.dir}'.</echo>
</target>
+ <target xmlns:ivy="antlib:org.apache.ivy.ant" name="check-svn-working-copy" depends="ivy-availability-check,ivy-fail,ivy-configure">
+ <ivy:cachepath organisation="org.tmatesoft.svnkit" module="svnkit" revision="1.7.5-v1"
+ inline="true" conf="default" type="jar" transitive="true" pathid="svnkit.classpath"/>
+ <script language="javascript" classpathref="svnkit.classpath" taskname="svn"><![CDATA[
+ importClass(java.io.File);
+ importClass(java.util.TreeSet);
+ importPackage(org.tmatesoft.svn.core);
+ importPackage(org.tmatesoft.svn.core.wc);
+ var manager = SVNClientManager.newInstance();
+ var statusClient = manager.getStatusClient();
+ var wcClient = manager.getWCClient();
+
+ var basedir = new File(project.getProperty("basedir")).getAbsoluteFile();
+ var baseLen = basedir.toString().length();
+ var convertRelative = function(file) {
+ return file.getAbsolutePath().substring(baseLen + 1).replace(File.separatorChar, '/');
+ }
+
+ var missingProps = new TreeSet(), unversioned = new TreeSet();
+
+ self.log("Getting all versioned and unversioned files...");
+ statusClient.doStatus(basedir, SVNRevision.WORKING, SVNDepth.fromRecurse(true), false, true, false, false, new ISVNStatusHandler({
+ handleStatus: function(status) {
+ var nodeStatus = status.getNodeStatus();
+ if (nodeStatus == SVNStatusType.STATUS_UNVERSIONED) {
+ unversioned.add(convertRelative(status.getFile()));
+ } else if (status.getKind() == SVNNodeKind.FILE && nodeStatus != SVNStatusType.STATUS_DELETED) {
+ missingProps.add(convertRelative(status.getFile()));
+ }
+ }
+ }), null);
+
+ self.log("Filtering files with existing svn:eol-style...");
+ wcClient.doGetProperty(basedir, "svn:eol-style", SVNRevision.WORKING, SVNRevision.WORKING, true, new ISVNPropertyHandler({
+ handleProperty: function(file, prop) {
+ missingProps.remove(convertRelative(file));
+ }
+ }));
+
+ self.log("Filtering files with binary svn:mime-type...");
+ wcClient.doGetProperty(basedir, "svn:mime-type", SVNRevision.WORKING, SVNRevision.WORKING, true, new ISVNPropertyHandler({
+ handleProperty: function(file, prop) {
+ prop = SVNPropertyValue.getPropertyAsString(prop.getValue());
+ if (prop.startsWith("application/") || prop.startsWith("image/")) {
+ missingProps.remove(convertRelative(file));
+ }
+ }
+ }));
+
+ var convertSet2String = function(set) {
+ return set.isEmpty() ? null : ("* " + set.toArray().join(project.getProperty("line.separator") + "* "))
+ };
+ project.setProperty("svn.checkprops.failed", convertSet2String(missingProps));
+ project.setProperty("svn.unversioned.failed", convertSet2String(unversioned));
+ ]]></script>
+ <fail if="svn.checkprops.failed"
+ message="The following files are missing svn:eol-style (or binary svn:mime-type):${line.separator}${svn.checkprops.failed}"/>
+ <fail if="svn.unversioned.failed"
+ message="Source checkout is dirty after running tests!!! Offending files:${line.separator}${svn.unversioned.failed}"/>
+ </target>
</project>
Modified: lucene/dev/trunk/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/build.xml?rev=1377991&r1=1377990&r2=1377991&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/build.xml (original)
+++ lucene/dev/trunk/lucene/build.xml Tue Aug 28 06:50:46 2012
@@ -198,16 +198,6 @@
</forbidden-apis>
</target>
- <!-- note: we don't include this in validate because we want to check from releases -->
- <target name="-check-svn-properties" depends="compile-tools,resolve,load-custom-tasks">
- <svn-eol-style svnExecutable="${svn.exe}">
- <fileset dir="${basedir}/..">
- <exclude name="**/build/**"/>
- <exclude name="**/*.jar"/>
- </fileset>
- </svn-eol-style>
- </target>
-
<target name="resolve">
<sequential>
<ant dir="test-framework" target="resolve" inheritall="false">
Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1377991&r1=1377990&r2=1377991&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Tue Aug 28 06:50:46 2012
@@ -508,6 +508,9 @@
<attribute name="spec.version"/>
<attribute name="manifest.file" default="${manifest.file}"/>
<sequential>
+ <!-- If possible, include the svnversion -->
+ <exec dir="." executable="${svnversion.exe}" outputproperty="svnversion" failifexecutionfails="false"/>
+
<manifest file="@{manifest.file}">
<!--
http://java.sun.com/j2se/1.5.0/docs/guide/jar/jar.html#JAR%20Manifest
@@ -558,12 +561,6 @@
<attribute name="manifest.file" default="${manifest.file}"/>
<element name="nested" optional="true" implicit="true"/>
<sequential>
- <!-- If possible, include the svnversion -->
- <exec dir="." executable="${svnversion.exe}"
- outputproperty="svnversion" failifexecutionfails="false">
- <arg value="."/>
- </exec>
-
<build-manifest title="@{title}"
implementation.title="@{implementation.title}"
spec.version="@{spec.version}"
@@ -1547,10 +1544,10 @@ ${tests-output}/junit4-*.suites - pe
description="Populates properties svn.URL and svn.Revision using 'svn info'.">
<attribute name="directory"/>
<sequential>
- <exec dir="." executable="${svnversion.exe}" outputproperty="svn.ver"/>
+ <exec dir="@{directory}" executable="${svnversion.exe}" outputproperty="svn.ver"/>
<fail message="A subversion checkout is required for this target">
<condition>
- <equals arg1="${svn.ver}" arg2="exported"/>
+ <matches pattern="(exported|unversioned.*)" string="${svn.ver}" casesensitive="false"/>
</condition>
</fail>
<exec dir="@{directory}" executable="${svn.exe}" outputproperty="svn.info" failonerror="true">
Modified: lucene/dev/trunk/lucene/tools/src/java/lucene-solr.antlib.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/tools/src/java/lucene-solr.antlib.xml?rev=1377991&r1=1377990&r2=1377991&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/tools/src/java/lucene-solr.antlib.xml (original)
+++ lucene/dev/trunk/lucene/tools/src/java/lucene-solr.antlib.xml Tue Aug 28 06:50:46 2012
@@ -21,7 +21,4 @@
<taskdef
name="forbidden-apis"
classname="org.apache.lucene.validation.ForbiddenApisCheckTask" />
- <taskdef
- name="svn-eol-style"
- classname="org.apache.lucene.validation.SVNEolCheckTask" />
</antlib>
Modified: lucene/dev/trunk/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/build.xml?rev=1377991&r1=1377990&r2=1377991&view=diff
==============================================================================
--- lucene/dev/trunk/solr/build.xml (original)
+++ lucene/dev/trunk/solr/build.xml Tue Aug 28 06:50:46 2012
@@ -638,12 +638,6 @@
</exec>
</target>
- <target name="svn-up">
- <exec executable="${svn.exe}">
- <arg value="update"/>
- </exec>
- </target>
-
<property name="analysis-common.res.dir" value="../lucene/analysis/common/src/resources/org/apache/lucene/analysis"/>
<property name="analysis-kuromoji.res.dir" value="../lucene/analysis/kuromoji/src/resources/org/apache/lucene/analysis"/>
<property name="analysis.conf.dest" value="${example}/solr/conf/lang"/>
Modified: lucene/dev/trunk/solr/webapp/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/webapp/build.xml?rev=1377991&r1=1377990&r2=1377991&view=diff
==============================================================================
--- lucene/dev/trunk/solr/webapp/build.xml (original)
+++ lucene/dev/trunk/solr/webapp/build.xml Tue Aug 28 06:50:46 2012
@@ -40,10 +40,6 @@
<target name="dist"
description="Creates the Solr WAR Distribution file."
depends="test, init-dist, dist-core, dist-solrj, lucene-jars-to-solr">
- <exec dir="." executable="${svnversion.exe}"
- outputproperty="svnversion" failifexecutionfails="false">
- <arg line="."/>
- </exec>
<build-manifest title="Apache Solr Search Server"
implementation.title="org.apache.solr"
spec.version="${solr.spec.version}"/>