dsmiley commented on code in PR #14764: URL: https://github.com/apache/lucene/pull/14764#discussion_r2143107306
########## build-tools/build-infra/src/main/groovy/lucene.datasets.external-datasets.gradle: ########## @@ -17,41 +15,40 @@ import java.nio.file.Files * limitations under the License. */ -buildscript { - repositories { - mavenCentral() - } +import java.nio.file.Files +import com.github.luben.zstd.ZstdInputStream +import de.undercouch.gradle.tasks.download.Download +import org.apache.lucene.gradle.datasets.ExtractReuters - dependencies { - classpath deps.zstd - } +// tasks that download various benchmark/test data sets from the internet. + +// TODO: not sure whether this should live in benchmarks, but for now let it be. + +if (project != project.rootProject) { + throw new GradleException("Applicable to rootProject only: " + project.path) } -def unzstd(java.nio.file.Path src, java.nio.file.Path dst) { - try (InputStream is = new com.github.luben.zstd.ZstdInputStream(new BufferedInputStream(Files.newInputStream(src))); - OutputStream os = new BufferedOutputStream(Files.newOutputStream(dst))) { - is.transferTo(os) +def static unzstd(java.nio.file.Path src, java.nio.file.Path dst) { + new ZstdInputStream(new BufferedInputStream(Files.newInputStream(src))).withCloseable { is -> + new BufferedOutputStream(Files.newOutputStream(dst)).withCloseable { os -> + is.transferTo(os) + } } } - -// TODO: not sure whether this should live in benchmarks, but for now let it be. configure(project(":lucene:benchmark")) { Review Comment: One negative consequence I found when maintaining a fork of Solr (using the same AOP style Gradle build) at a company is that locally removing a module means there are a number of build scripts that fail because they can't resolve the removed module. Ideally, the AOP technique would be graceful to a non-existent module. I understand if nobody-cares. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org