-
Notifications
You must be signed in to change notification settings - Fork 25.5k
Split precommit plugins into internal and external #65102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
072a7ec
f33da4c
7fbf0e2
4d9c004
7194265
ece5df5
27f69cf
15cd33b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,9 +56,6 @@ class PluginBuildPlugin implements Plugin<Project> { | |
PluginPropertiesExtension extension = project.extensions.create(PLUGIN_EXTENSION_NAME, PluginPropertiesExtension, project) | ||
configureDependencies(project) | ||
|
||
boolean isXPackModule = project.path.startsWith(':x-pack:plugin') || project.path.startsWith(':x-pack:quota-aware-fs') | ||
boolean isModule = project.path.startsWith(':modules:') || isXPackModule | ||
|
||
createBundleTasks(project, extension) | ||
|
||
project.afterEvaluate { | ||
|
@@ -104,40 +101,47 @@ class PluginBuildPlugin implements Plugin<Project> { | |
expand(properties) | ||
inputs.properties(properties) | ||
} | ||
if (isModule == false || isXPackModule) { | ||
addNoticeGeneration(project, extension1) | ||
BuildParams.withInternalBuild { | ||
boolean isXPackModule = project.path.startsWith(':x-pack:plugin') || project.path.startsWith(':x-pack:quota-aware-fs') | ||
boolean isModule = project.path.startsWith(':modules:') || isXPackModule | ||
if (isModule == false || isXPackModule) { | ||
addNoticeGeneration(project, extension1) | ||
} | ||
} | ||
} | ||
|
||
// We've ported this from multiple build scripts where we see this pattern into | ||
// an extension method as a first step of consolidation. | ||
// We might want to port this into a general pattern later on. | ||
project.ext.addQaCheckDependencies = { | ||
project.afterEvaluate { | ||
// let check depend on check tasks of qa sub-projects | ||
def checkTaskProvider = project.tasks.named("check") | ||
def qaSubproject = project.subprojects.find { it.path == project.path + ":qa" } | ||
if(qaSubproject) { | ||
qaSubproject.subprojects.each {p -> | ||
checkTaskProvider.configure {it.dependsOn(p.path + ":check") } | ||
BuildParams.withInternalBuild { | ||
// We've ported this from multiple build scripts where we see this pattern into | ||
// an extension method as a first step of consolidation. | ||
// We might want to port this into a general pattern later on. | ||
project.ext.addQaCheckDependencies = { | ||
|
||
project.afterEvaluate { | ||
// let check depend on check tasks of qa sub-projects | ||
def checkTaskProvider = project.tasks.named("check") | ||
def qaSubproject = project.subprojects.find { it.path == project.path + ":qa" } | ||
if(qaSubproject) { | ||
qaSubproject.subprojects.each {p -> | ||
checkTaskProvider.configure {it.dependsOn(p.path + ":check") } | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
project.tasks.named('testingConventions').configure { | ||
naming.clear() | ||
naming { | ||
Tests { | ||
baseClass 'org.apache.lucene.util.LuceneTestCase' | ||
} | ||
IT { | ||
baseClass 'org.elasticsearch.test.ESIntegTestCase' | ||
baseClass 'org.elasticsearch.test.rest.ESRestTestCase' | ||
baseClass 'org.elasticsearch.test.ESSingleNodeTestCase' | ||
project.tasks.named('testingConventions').configure { | ||
naming.clear() | ||
naming { | ||
Tests { | ||
baseClass 'org.apache.lucene.util.LuceneTestCase' | ||
} | ||
IT { | ||
baseClass 'org.elasticsearch.test.ESIntegTestCase' | ||
baseClass 'org.elasticsearch.test.rest.ESRestTestCase' | ||
baseClass 'org.elasticsearch.test.ESSingleNodeTestCase' | ||
} | ||
} | ||
} | ||
} | ||
|
||
project.configurations.getByName('default') | ||
.extendsFrom(project.configurations.getByName('runtimeClasspath')) | ||
// allow running ES with this plugin in the foreground of a build | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,12 +20,10 @@ | |
package org.elasticsearch.gradle.test | ||
|
||
|
||
import groovy.transform.CompileStatic | ||
import org.elasticsearch.gradle.BuildPlugin | ||
import org.elasticsearch.gradle.ElasticsearchJavaPlugin | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.api.plugins.JavaBasePlugin | ||
import org.gradle.api.tasks.TaskProvider | ||
import org.gradle.api.tasks.testing.Test | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would comment above but GitHub sucks. We should similarly wrap all the
isModule
stuff above in this check. For external projects it will always be a plugin, not a module, so we shouldn't accidentally treat it as such if an external author incidentally uses conflicting project naming conventions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍