LUCENE-7995: 'ant stage-maven-artifacts' should work from the top-level project directory, and should provide a better error message when its 'maven.dist.dir' param points to a non-existent directory

This commit is contained in:
Steve Rowe 2017-10-16 16:00:14 -04:00
parent fb97ff1400
commit dabb9ed325
2 changed files with 8 additions and 3 deletions

View File

@ -46,7 +46,6 @@ my $output_build_xml_file = $ARGV[1];
my $common_build_xml = $ARGV[2]; my $common_build_xml = $ARGV[2];
my $m2_credentials_prompt = $ARGV[3]; my $m2_credentials_prompt = $ARGV[3];
my $m2_repository_id = $ARGV[4]; my $m2_repository_id = $ARGV[4];
my $m2_repository_url = $ARGV[5];
if ($^O eq 'cygwin') { # Make sure Cygwin Perl can find the output path if ($^O eq 'cygwin') { # Make sure Cygwin Perl can find the output path
$output_build_xml_file = `cygpath -u "$output_build_xml_file"`; $output_build_xml_file = `cygpath -u "$output_build_xml_file"`;
$output_build_xml_file =~ s/\s+$//; # Trim trailing whitespace $output_build_xml_file =~ s/\s+$//; # Trim trailing whitespace

View File

@ -1889,7 +1889,14 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
<target name="stage-maven-artifacts"> <target name="stage-maven-artifacts">
<sequential> <sequential>
<property name="output.build.xml" location="${build.dir}/stage_maven_build.xml"/> <property name="output.build.xml" location="${build.dir}/stage_maven_build.xml"/>
<property name="dev-tools.scripts.dir" value="../dev-tools/scripts"/> <property name="dev-tools.scripts.dir" value="${common.dir}/../dev-tools/scripts"/>
<fail message="maven.dist.dir '${maven.dist.dir}' does not exist!">
<condition>
<not>
<available file="${maven.dist.dir}" type="dir"/>
</not>
</condition>
</fail>
<exec dir="." executable="${perl.exe}" failonerror="false" outputproperty="stage.maven.script.output" <exec dir="." executable="${perl.exe}" failonerror="false" outputproperty="stage.maven.script.output"
resultproperty="stage.maven.script.success"> resultproperty="stage.maven.script.success">
<arg value="-CSD"/> <arg value="-CSD"/>
@ -1899,7 +1906,6 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
<arg value="${common.dir}/common-build.xml"/> <!-- Imported from the ant file to be written --> <arg value="${common.dir}/common-build.xml"/> <!-- Imported from the ant file to be written -->
<arg value="${m2.credentials.prompt}"/> <arg value="${m2.credentials.prompt}"/>
<arg value="${m2.repository.id}"/> <arg value="${m2.repository.id}"/>
<arg value="${m2.repository.url}"/>
</exec> </exec>
<echo message="${stage.maven.script.output}"/> <echo message="${stage.maven.script.output}"/>
<fail message="maven stage script failed!"> <fail message="maven stage script failed!">