Skip to content

Commit

Permalink
LUCENE-4262: add ivy sync=true, so when resolve runs, only jars that …
Browse files Browse the repository at this point in the history
…should be there are there

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1366509 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
rmuir committed Jul 27, 2012
1 parent 6e91227 commit 6d2a288
Show file tree
Hide file tree
Showing 298 changed files with 29 additions and 50 deletions.
2 changes: 1 addition & 1 deletion lucene/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
<target name="validate" depends="check-licenses,rat-sources,check-forbidden-apis" description="Validate stuff." />

<target name="check-licenses" depends="compile-tools,resolve,load-custom-tasks" description="Validate license stuff.">
<license-check-macro dir="${basedir}" />
<license-check-macro dir="${basedir}" licensedir="${common.dir}/licenses" />
</target>

<target name="check-forbidden-apis" depends="compile-tools,compile-test,load-custom-tasks,-check-forbidden-jdk-apis,-check-forbidden-test-apis,-check-system-out" description="Check forbidden API calls in compiled class files"/>
Expand Down
3 changes: 2 additions & 1 deletion lucene/common-build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
<property name="ivy.resource" value="org/apache/ivy/ant/antlib.xml" />
<available resource="${ivy.resource}" property="ivy.available" />
<property name="ivy.default.configuration" value="*"/>
<property name="ivy.sync" value="true"/>

<property name="junit.jar" value="junit-4.10.jar"/>
<property name="junit-location.jar" value="${common.dir}/test-framework/lib/${junit.jar}"/>
Expand Down Expand Up @@ -294,7 +295,7 @@
<!-- todo, make this a property or something.
only special cases need bundles -->
<ivy:retrieve type="jar,bundle" log="download-only"
conf="${ivy.default.configuration}"/>
conf="${ivy.default.configuration}" sync="${ivy.sync}"/>
</target>

<property name="ivy_install_path" location="${user.home}/.ant/lib" />
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion lucene/tools/custom-tasks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

<macrodef name="license-check-macro">
<attribute name="dir" />
<attribute name="licensedir" />
<element name="additional-excludes" optional="true" />
<element name="additional-filters" optional="true" />
<sequential>
<!-- LICENSE and NOTICE verification macro. -->
<echo>License check under: @{dir}</echo>
<licenses>
<licenses licenseDirectory="@{licensedir}">
<fileset dir="@{dir}">
<include name="**/*.jar" />
<!-- Speed up scanning a bit. -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ public class LicenseCheckTask extends Task {
* All JAR files to check.
*/
private Resources jarResources = new Resources();

/**
* Directory containing licenses
*/
private File licenseDirectory;

/**
* License file mapper.
Expand Down Expand Up @@ -94,6 +99,10 @@ public void addConfiguredLicenseMapper(Mapper mapper) {
public void setVerbose(boolean verbose) {
verboseLevel = (verbose ? Project.MSG_INFO : Project.MSG_VERBOSE);
}

public void setLicenseDirectory(File file) {
licenseDirectory = file;
}

/**
* Execute the task.
Expand Down Expand Up @@ -153,7 +162,7 @@ private boolean checkJarFile(File jarFile) {
log("Scanning: " + jarFile.getPath(), verboseLevel);

// validate the jar matches against our expected hash
final File checksumFile = new File(jarFile.getParent(),
final File checksumFile = new File(licenseDirectory,
jarFile.getName() + "." + CHECKSUM_TYPE);
if (! (checksumFile.exists() && checksumFile.canRead()) ) {
log("MISSING " +CHECKSUM_TYPE+ " checksum file for: " + jarFile.getPath(), Project.MSG_ERR);
Expand Down Expand Up @@ -200,9 +209,9 @@ private boolean checkJarFile(File jarFile) {
Map<File, LicenseType> foundLicenses = new LinkedHashMap<File, LicenseType>();
List<File> expectedLocations = new ArrayList<File>();
outer:
for (String mappedPath : licenseMapper.mapFileName(jarFile.getPath())) {
for (String mappedPath : licenseMapper.mapFileName(jarFile.getName())) {
for (LicenseType licenseType : LicenseType.values()) {
File licensePath = new File(mappedPath + licenseType.licenseFileSuffix());
File licensePath = new File(licenseDirectory, mappedPath + licenseType.licenseFileSuffix());
if (licensePath.exists()) {
foundLicenses.put(licensePath, licenseType);
log(" FOUND " + licenseType.name() + " license at " + licensePath.getPath(),
Expand All @@ -218,10 +227,10 @@ private boolean checkJarFile(File jarFile) {
// Check for NOTICE files.
for (Map.Entry<File, LicenseType> e : foundLicenses.entrySet()) {
LicenseType license = e.getValue();
String licensePath = e.getKey().getAbsolutePath();
String licensePath = e.getKey().getName();
String baseName = licensePath.substring(
0, licensePath.length() - license.licenseFileSuffix().length());
File noticeFile = new File(baseName + license.noticeFileSuffix());
File noticeFile = new File(licenseDirectory, baseName + license.noticeFileSuffix());

if (noticeFile.exists()) {
log(" FOUND NOTICE file at " + noticeFile.getAbsolutePath(), verboseLevel);
Expand Down
10 changes: 5 additions & 5 deletions solr/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,18 @@
<target name="validate" depends="check-licenses,rat-sources,check-forbidden-apis" description="Validate stuff." />

<target name="check-licenses" depends="compile-tools,resolve,load-custom-tasks" description="Validate license stuff.">
<license-check-macro dir="${basedir}">
<license-check-macro dir="${basedir}" licensedir="${common-solr.dir}/licenses">
<additional-excludes>
<!-- Exclude start.jar only (it'd be weird to have a license file there?) -->
<exclude name="example/start.jar" />
<exclude name="example/exampledocs/post.jar" />
<exclude name="example/solr-webapp/**" />
</additional-excludes>
<additional-filters>
<replaceregex pattern="/jetty([^/]+)$" replace="/jetty" flags="gi" />
<replaceregex pattern="/apache-solr-commons-csv-([^/]+)$" replace="/apache-solr-commons-csv" flags="gi" />
<replaceregex pattern="/slf4j-([^/]+)$" replace="/slf4j" flags="gi" />
<replaceregex pattern="/(bcmail|bcprov)-([^/]+)$" replace="/\1" flags="gi" />
<replaceregex pattern="jetty([^/]+)$" replace="jetty" flags="gi" />
<replaceregex pattern="apache-solr-commons-csv-([^/]+)$" replace="apache-solr-commons-csv" flags="gi" />
<replaceregex pattern="slf4j-([^/]+)$" replace="slf4j" flags="gi" />
<replaceregex pattern="(bcmail|bcprov)-([^/]+)$" replace="\1" flags="gi" />
</additional-filters>
</license-check-macro>
</target>
Expand Down
1 change: 0 additions & 1 deletion solr/contrib/extraction/lib/icu4j-49.1.jar.sha1

This file was deleted.

33 changes: 0 additions & 33 deletions solr/contrib/extraction/lib/icu4j-LICENSE-BSD_LIKE.txt

This file was deleted.

3 changes: 0 additions & 3 deletions solr/contrib/extraction/lib/icu4j-NOTICE.txt

This file was deleted.

2 changes: 2 additions & 0 deletions solr/core/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
<!-- hackidty-hack-hack -->

<property name="ivy.retrieve.pattern" value="${common-solr.dir}/lib/[artifact]-[revision].[ext]"/>
<!-- we cannot sync because solr/core and solr/solrj share the same lib/... clean this up! -->
<property name="ivy.sync" value="false"/>

<!-- html file for testing -->
<property name="rat.excludes" value="**/htmlStripReaderTest.html"/>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions solr/solrj/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@

<property name="ivy.retrieve.pattern" value="${common-solr.dir}/lib/[artifact]-[revision].[ext]"/>

<!-- we cannot sync because solr/core and solr/solrj share the same lib/... clean this up! -->
<property name="ivy.sync" value="false"/>

<import file="../common-build.xml"/>

<!-- Specialized common-solr.test.classpath, to remove the Solr core test output -->
Expand Down

0 comments on commit 6d2a288

Please sign in to comment.