diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index 00aa86d0113..db55b74e1f5 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -27,7 +27,7 @@ import org.elasticsearch.gradle.VersionProperties import org.elasticsearch.gradle.info.BuildParams import org.elasticsearch.gradle.plugin.PluginBuildPlugin import org.elasticsearch.gradle.tar.SymbolicLinkPreservingTar - +import groovy.io.FileType import java.nio.file.Files import java.nio.file.Path @@ -245,6 +245,13 @@ subprojects { project.delete(archiveExtractionDir) archiveExtractionDir.mkdirs() } + // common sanity checks on extracted archive directly as part of checkExtraction + doLast { + // check no plain class files are packaged + archiveExtractionDir.eachFileRecurse (FileType.FILES) { file -> + assert file.name.endsWith(".class") == false + } + } } tasks.named('check').configure { dependsOn checkExtraction } if (project.name.contains('tar')) {