SOLR-3733: Fix the Solr->Lucene Javadocs URL task to be easier and consistent if directory not yet exists

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/solr3733@1388206 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-09-20 20:39:26 +00:00
parent 486110d172
commit 1dfcd73616
1 changed files with 13 additions and 20 deletions

View File

@ -25,9 +25,6 @@
<property name="Name" value="Solr" /> <property name="Name" value="Solr" />
<property name="version" value="5.0-SNAPSHOT"/> <property name="version" value="5.0-SNAPSHOT"/>
<condition property="version.contains.SNAPSHOT">
<contains casesensitive="true" string="${version}" substring="-SNAPSHOT"/>
</condition>
<property name="fullname" value="apache-${ant.project.name}"/> <property name="fullname" value="apache-${ant.project.name}"/>
<property name="fullnamever" value="${fullname}-${version}"/> <property name="fullnamever" value="${fullname}-${version}"/>
<property name="final.name" value="${fullnamever}"/> <property name="final.name" value="${fullnamever}"/>
@ -278,23 +275,19 @@
</sequential> </sequential>
</macrodef> </macrodef>
<target name="define-lucene-javadoc-url" <target name="define-lucene-javadoc-url">
depends="define-lucene-javadoc-url-SNAPSHOT,define-lucene-javadoc-url-release"/> <script language="javascript"><![CDATA[
var url, version = project.getProperty('version');
<target name="define-lucene-javadoc-url-SNAPSHOT" if="version.contains.SNAPSHOT"> if (version.contains('-SNAPSHOT')) {
<makeurl file="${common.dir}/build/docs/" validate="false" property="lucene.javadoc.url"/> importClass(java.io.File);
</target> url = new File(project.getProperty('common.dir'), 'build' + File.separator + 'docs').toURI().toASCIIString();
if (!(/\/$/.test(url))) url += '/';
<target name="define-lucene-javadoc-url-release" unless="version.contains.SNAPSHOT"> } else {
<loadproperties> version = version.replace('.', '_');
<propertyresource name="version"/> url = 'http://lucene.apache.org/java/' + version + '/';
<filterchain> }
<replaceregex pattern="[.]" replace="_" flags="g"/> project.setProperty('lucene.javadoc.url', url);
<prefixlines prefix="underscore.version="/> ]]></script>
</filterchain>
</loadproperties>
<property name="lucene.javadoc.url"
value="http://lucene.apache.org/java/${underscore.version}/"/>
</target> </target>
<target name="jar-src" depends="init"> <target name="jar-src" depends="init">