Move licenses for core jar to core directory (#21383)

All plugins currently have their own licenses dir for the
dependencyLicenses task, but core disables this and has the check inside
distribution. This may have been better for maven, but for
gradle it makes more sense to just use the dependencyLicenses task that
automatically exists inside :core, and remove the hacked up version that
is inside distribution.
This commit is contained in:
Ryan Ernst 2016-11-07 15:29:35 -08:00 committed by GitHub
parent 7a2c984bcc
commit 562a30d3c6
70 changed files with 6 additions and 21 deletions

View File

@ -257,8 +257,10 @@ thirdPartyAudit.excludes = [
'org.noggit.JSONParser',
]
// dependency license are currently checked in distribution
dependencyLicenses.enabled = false
dependencyLicenses {
mapping from: /lucene-.*/, to: 'lucene'
mapping from: /jackson-.*/, to: 'jackson'
}
if (isEclipse == false || project.path == ":core-tests") {
task integTest(type: RandomizedTestingTask,

View File

@ -39,10 +39,6 @@ buildscript {
}
}
// this is common configuration for distributions, but we also add it here for the license check to use
ext.dependencyFiles = project(':core').configurations.runtime.copyRecursive()
/*****************************************************************************
* Modules *
*****************************************************************************/
@ -146,7 +142,7 @@ subprojects {
libFiles = copySpec {
into 'lib'
from project(':core').jar
from project(':distribution').dependencyFiles
from project(':core').configurations.runtime
}
modulesFiles = copySpec {
@ -438,19 +434,6 @@ configure(subprojects.findAll { ['deb', 'rpm'].contains(it.name) }) {
}
}
// TODO: dependency checks should really be when building the jar itself, which would remove the need
// for this hackery and instead we can do this inside the BuildPlugin
task dependencyLicenses(type: DependencyLicensesTask) {
dependsOn = [dependencyFiles]
dependencies = dependencyFiles
mapping from: /lucene-.*/, to: 'lucene'
mapping from: /jackson-.*/, to: 'jackson'
}
task check(group: 'Verification', description: 'Runs all checks.', dependsOn: dependencyLicenses) {} // dummy task!
task updateShas(type: UpdateShasTask) {
parentTask = dependencyLicenses
}
task run(type: RunTask) {
distribution = 'zip'
}

View File

@ -18,7 +18,7 @@
*/
task buildRpm(type: Rpm) {
dependsOn dependencyFiles, preparePackagingFiles
dependsOn preparePackagingFiles
baseName 'elasticsearch' // this is what pom generation uses for artifactId
// Follow elasticsearch's rpm file naming convention
archiveName "${packageName}-${project.version}.rpm"