Fix the llinter issue with absolute file names intermixed with url, failing to parse them as URLs (C:/path is treated as URL with schema C). Fix other properties to be absolute in common-build.xml.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1388449 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-09-21 12:12:09 +00:00
parent 1079014287
commit 468a6650e7
3 changed files with 32 additions and 34 deletions

View File

@ -136,6 +136,9 @@ def checkAll(dirName):
# Somehow even w/ java 7 generaged javadocs, # Somehow even w/ java 7 generaged javadocs,
# deprecated-list.html can fail to escape generics types # deprecated-list.html can fail to escape generics types
fullPath = os.path.join(root, f).replace(os.path.sep,'/') fullPath = os.path.join(root, f).replace(os.path.sep,'/')
fullPath = 'file:%s' % urlparse.quote(fullPath)
# parse and unparse the URL to "normalize" it
fullPath = urlparse.urlunparse(urlparse.urlparse(fullPath))
#print ' %s' % fullPath #print ' %s' % fullPath
allFiles[fullPath] = parse(fullPath, open('%s/%s' % (root, f), encoding='UTF-8').read()) allFiles[fullPath] = parse(fullPath, open('%s/%s' % (root, f), encoding='UTF-8').read())
@ -209,30 +212,26 @@ def checkAll(dirName):
# on annotations it seems? # on annotations it seems?
pass pass
elif link.startswith('file:'): elif link.startswith('file:'):
filepath = urlparse.unquote(urlparse.urlparse(link).path) if link not in allFiles:
if not (os.path.exists(filepath) or os.path.exists(filepath[1:])): filepath = urlparse.unquote(urlparse.urlparse(link).path)
if not printed: if not (os.path.exists(filepath) or os.path.exists(filepath[1:])):
printed = True if not printed:
print() printed = True
print(fullPath) print()
print(' BROKEN LINK: %s' % link) print(fullPath)
elif link not in allFiles: print(' BROKEN LINK: %s' % link)
# We only load HTML... so if the link is another resource (eg
# SweetSpotSimilarity refs
# lucene/build/docs/misc/org/apache/lucene/misc/doc-files/ss.gnuplot) then it's OK:
if not os.path.exists(link):
if not printed:
printed = True
print()
print(fullPath)
print(' BROKEN LINK: %s' % link)
elif anchor is not None and anchor not in allFiles[link][1]: elif anchor is not None and anchor not in allFiles[link][1]:
if not printed: if not printed:
printed = True printed = True
print() print()
print(fullPath) print(fullPath)
print(' BROKEN ANCHOR: %s' % origLink) print(' BROKEN ANCHOR: %s' % origLink)
else:
if not printed:
printed = True
print()
print(fullPath)
print(' BROKEN URL SCHEME: %s' % origLink)
failures = failures or printed failures = failures or printed
return failures return failures

View File

@ -27,10 +27,10 @@
</description> </description>
<dirname file="${ant.file.common}" property="common.dir"/> <dirname file="${ant.file.common}" property="common.dir"/>
<property name="dev-tools.dir" value="${common.dir}/../dev-tools"/> <property name="dev-tools.dir" location="${common.dir}/../dev-tools"/>
<property name="prettify.dir" value="${common.dir}/tools/prettify"/> <property name="prettify.dir" location="${common.dir}/tools/prettify"/>
<property name="maven.build.dir" value="${build.dir}/maven"/> <property name="maven.build.dir" location="${build.dir}/maven"/>
<property name="license.dir" value="${common.dir}/licenses"/> <property name="license.dir" location="${common.dir}/licenses"/>
<!-- Give user a chance to override without editing this file <!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it --> (and without typing -D each time it compiles it -->
@ -65,7 +65,7 @@
<property name="ivy.sync" value="true"/> <property name="ivy.sync" value="true"/>
<property name="junit.jar" value="junit-4.10.jar"/> <property name="junit.jar" value="junit-4.10.jar"/>
<property name="junit-location.jar" value="${common.dir}/test-framework/lib/${junit.jar}"/> <property name="junit-location.jar" location="${common.dir}/test-framework/lib/${junit.jar}"/>
<path id="junit-path"> <path id="junit-path">
<fileset dir="${common.dir}/test-framework/lib"> <fileset dir="${common.dir}/test-framework/lib">
@ -90,7 +90,7 @@
<property name="tests.timezone" value="random" /> <property name="tests.timezone" value="random" />
<property name="tests.directory" value="random" /> <property name="tests.directory" value="random" />
<property name="tests.linedocsfile" value="europarl.lines.txt.gz" /> <property name="tests.linedocsfile" value="europarl.lines.txt.gz" />
<property name="tests.loggingfile" value="${common.dir}/tools/junit4/logging.properties"/> <property name="tests.loggingfile" location="${common.dir}/tools/junit4/logging.properties"/>
<property name="tests.nightly" value="false" /> <property name="tests.nightly" value="false" />
<property name="tests.weekly" value="false" /> <property name="tests.weekly" value="false" />
<property name="tests.slow" value="true" /> <property name="tests.slow" value="true" />
@ -109,7 +109,7 @@
</condition> </condition>
<property name="tests.clover.args" value=""/> <property name="tests.clover.args" value=""/>
<property name="tests.tempDir" value="${build.dir}/test"/> <property name="tests.tempDir" location="${build.dir}/test"/>
<property name="tests.cachefile" location="${common.dir}/tools/junit4/cached-timehints.txt" /> <property name="tests.cachefile" location="${common.dir}/tools/junit4/cached-timehints.txt" />
<property name="tests.cachefilehistory" value="20" /> <property name="tests.cachefilehistory" value="20" />
@ -144,11 +144,11 @@
<property name="bootclasspath" value=""/> <property name="bootclasspath" value=""/>
<property name="javadoc.link" value="http://download.oracle.com/javase/6/docs/api/"/> <property name="javadoc.link" value="http://download.oracle.com/javase/6/docs/api/"/>
<property name="javadoc.link.junit" value="http://junit.sourceforge.net/javadoc/"/> <property name="javadoc.link.junit" value="http://junit.sourceforge.net/javadoc/"/>
<property name="javadoc.packagelist.dir" value="${common.dir}/tools/javadoc"/> <property name="javadoc.packagelist.dir" location="${common.dir}/tools/javadoc"/>
<available file="${javadoc.packagelist.dir}/java6/package-list" property="javadoc.java6.packagelist.exists"/> <available file="${javadoc.packagelist.dir}/java6/package-list" property="javadoc.java6.packagelist.exists"/>
<property name="javadoc.access" value="protected"/> <property name="javadoc.access" value="protected"/>
<property name="javadoc.charset" value="utf-8"/> <property name="javadoc.charset" value="utf-8"/>
<property name="javadoc.dir" value="${common.dir}/build/docs"/> <property name="javadoc.dir" location="${common.dir}/build/docs"/>
<property name="javadoc.maxmemory" value="512m" /> <property name="javadoc.maxmemory" value="512m" />
<property name="javadoc.noindex" value="true"/> <property name="javadoc.noindex" value="true"/>
<!-- Javadoc classpath --> <!-- Javadoc classpath -->
@ -161,8 +161,8 @@
</fileset> </fileset>
</path> </path>
<property name="changes.src.dir" value="${common.dir}/site/changes"/> <property name="changes.src.dir" location="${common.dir}/site/changes"/>
<property name="changes.target.dir" value="${common.dir}/build/docs/changes"/> <property name="changes.target.dir" location="${common.dir}/build/docs/changes"/>
<property name="project.name" value="site"/> <!-- todo: is this used by anakia or something else? --> <property name="project.name" value="site"/> <!-- todo: is this used by anakia or something else? -->
<property name="build.encoding" value="utf-8"/> <property name="build.encoding" value="utf-8"/>
@ -1805,11 +1805,10 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites
<macrodef name="check-broken-links"> <macrodef name="check-broken-links">
<attribute name="dir"/> <attribute name="dir"/>
<!-- TODO: somehow, the behavior of this script has CWD-funkiness but only on windows -->
<sequential> <sequential>
<exec dir="@{dir}" executable="${python32.exe}" failonerror="true"> <exec dir="." executable="${python32.exe}" failonerror="true">
<arg value="${dev-tools.dir}/scripts/checkJavadocLinks.py"/> <arg value="${dev-tools.dir}/scripts/checkJavadocLinks.py"/>
<arg value="."/> <arg value="@{dir}"/>
</exec> </exec>
</sequential> </sequential>
</macrodef> </macrodef>

View File

@ -46,8 +46,8 @@
<property name="tests.loggingfile" location="${common-solr.dir}/testlogging.properties"/> <property name="tests.loggingfile" location="${common-solr.dir}/testlogging.properties"/>
<property name="tests.cleanthreads.sysprop" value="perClass"/> <property name="tests.cleanthreads.sysprop" value="perClass"/>
<property name="changes.target.dir" value="${dest}/docs/changes"/> <property name="changes.target.dir" location="${dest}/docs/changes"/>
<property name="license.dir" value="${common-solr.dir}/licenses"/> <property name="license.dir" location="${common-solr.dir}/licenses"/>
<import file="${common-solr.dir}/../lucene/module-build.xml"/> <import file="${common-solr.dir}/../lucene/module-build.xml"/>