mirror of
https://github.com/elastic/elasticsearch.git
synced 2025-06-28 17:34:17 -04:00
Apply 2-space indent to all gradle scripts (#48849)
Closes #48724. Update `.editorconfig` to make the Java settings the default for all files, and then apply a 2-space indent to all `*.gradle` files. Then reformat all the files.
This commit is contained in:
parent
fbaf8c428d
commit
3a3e5f6176
184 changed files with 4122 additions and 4120 deletions
|
@ -1,5 +1,5 @@
|
||||||
import com.bettercloud.vault.VaultConfig;
|
import com.bettercloud.vault.VaultConfig
|
||||||
import com.bettercloud.vault.Vault;
|
import com.bettercloud.vault.Vault
|
||||||
|
|
||||||
initscript {
|
initscript {
|
||||||
repositories {
|
repositories {
|
||||||
|
@ -30,7 +30,7 @@ final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault(
|
||||||
.withRetries(5, 1000)
|
.withRetries(5, 1000)
|
||||||
.auth()
|
.auth()
|
||||||
.loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID)
|
.loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID)
|
||||||
.getAuthClientToken();
|
.getAuthClientToken()
|
||||||
|
|
||||||
final Vault vault = new Vault(
|
final Vault vault = new Vault(
|
||||||
new VaultConfig()
|
new VaultConfig()
|
||||||
|
@ -45,7 +45,7 @@ final Vault vault = new Vault(
|
||||||
if (USE_ARTIFACTORY) {
|
if (USE_ARTIFACTORY) {
|
||||||
final Map<String, String> artifactoryCredentials = vault.logical()
|
final Map<String, String> artifactoryCredentials = vault.logical()
|
||||||
.read("secret/elasticsearch-ci/artifactory.elstc.co")
|
.read("secret/elasticsearch-ci/artifactory.elstc.co")
|
||||||
.getData();
|
.getData()
|
||||||
logger.info("Using elastic artifactory repos")
|
logger.info("Using elastic artifactory repos")
|
||||||
Closure configCache = {
|
Closure configCache = {
|
||||||
return {
|
return {
|
||||||
|
@ -93,7 +93,7 @@ final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticse
|
||||||
if (buildCacheUrl) {
|
if (buildCacheUrl) {
|
||||||
final Map<String, String> buildCacheCredentials = vault.logical()
|
final Map<String, String> buildCacheCredentials = vault.logical()
|
||||||
.read("secret/elasticsearch-ci/gradle-build-cache")
|
.read("secret/elasticsearch-ci/gradle-build-cache")
|
||||||
.getData();
|
.getData()
|
||||||
gradle.settingsEvaluated { settings ->
|
gradle.settingsEvaluated { settings ->
|
||||||
settings.buildCache {
|
settings.buildCache {
|
||||||
local {
|
local {
|
||||||
|
|
|
@ -2,12 +2,15 @@
|
||||||
|
|
||||||
root = true
|
root = true
|
||||||
|
|
||||||
[*.java]
|
[*]
|
||||||
charset = utf-8
|
charset = utf-8
|
||||||
indent_style = space
|
|
||||||
indent_size = 4
|
|
||||||
trim_trailing_whitespace = true
|
trim_trailing_whitespace = true
|
||||||
insert_final_newline = true
|
insert_final_newline = true
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
[*.bat]
|
[*.bat]
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
|
[*.gradle]
|
||||||
|
indent_size = 2
|
||||||
|
|
|
@ -435,6 +435,7 @@ class Run extends DefaultTask {
|
||||||
project.project(':distribution').run.debug = enabled
|
project.project(':distribution').run.debug = enabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task run(type: Run) {
|
task run(type: Run) {
|
||||||
dependsOn ':distribution:run'
|
dependsOn ':distribution:run'
|
||||||
description = 'Runs elasticsearch in the foreground'
|
description = 'Runs elasticsearch in the foreground'
|
||||||
|
|
|
@ -256,7 +256,7 @@ class VersionPropertiesLoader {
|
||||||
elasticsearch
|
elasticsearch
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
String qualifier = systemProperties.getProperty("build.version_qualifier", "");
|
String qualifier = systemProperties.getProperty("build.version_qualifier", "")
|
||||||
if (qualifier.isEmpty() == false) {
|
if (qualifier.isEmpty() == false) {
|
||||||
if (qualifier.matches("(alpha|beta|rc)\\d+") == false) {
|
if (qualifier.matches("(alpha|beta|rc)\\d+") == false) {
|
||||||
throw new IllegalStateException("Invalid qualifier: " + qualifier)
|
throw new IllegalStateException("Invalid qualifier: " + qualifier)
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
String distroConfig = System.getProperty('tests.local_distro.config')
|
String distroConfig = System.getProperty('tests.local_distro.config')
|
||||||
if (distroConfig != null) {
|
if (distroConfig != null) {
|
||||||
// setup the test distribution as an artifact of this project
|
// setup the test distribution as an artifact of this project
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
project.gradle.projectsEvaluated {
|
project.gradle.projectsEvaluated {
|
||||||
// wire the jdk repo to wiremock
|
// wire the jdk repo to wiremock
|
||||||
String fakeJdkRepo = Objects.requireNonNull(System.getProperty('tests.jdk_repo'))
|
String fakeJdkRepo = Objects.requireNonNull(System.getProperty('tests.jdk_repo'))
|
||||||
|
|
|
@ -80,7 +80,6 @@ testingConventions {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
dependencyLicenses {
|
dependencyLicenses {
|
||||||
dependencies = project.configurations.runtime.fileCollection {
|
dependencies = project.configurations.runtime.fileCollection {
|
||||||
it.group.startsWith('org.elasticsearch') == false
|
it.group.startsWith('org.elasticsearch') == false
|
||||||
|
|
|
@ -27,6 +27,7 @@ import org.elasticsearch.gradle.tar.SymbolicLinkPreservingTar
|
||||||
|
|
||||||
import java.nio.file.Files
|
import java.nio.file.Files
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
|
||||||
// need this so Zip/Tar tasks get basic defaults...
|
// need this so Zip/Tar tasks get basic defaults...
|
||||||
apply plugin: 'base'
|
apply plugin: 'base'
|
||||||
|
|
||||||
|
|
|
@ -559,7 +559,6 @@ subprojects {
|
||||||
'def': oss ? 'oss' : 'default'
|
'def': oss ? 'oss' : 'default'
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
||||||
'es.distribution.type': [
|
'es.distribution.type': [
|
||||||
'deb': 'deb',
|
'deb': 'deb',
|
||||||
'rpm': 'rpm',
|
'rpm': 'rpm',
|
||||||
|
|
|
@ -35,7 +35,8 @@ import static org.elasticsearch.gradle.BuildPlugin.getJavaHome
|
||||||
* unreleased versions are when Gradle projects are set up, so we use "build-unreleased-version-*" as placeholders
|
* unreleased versions are when Gradle projects are set up, so we use "build-unreleased-version-*" as placeholders
|
||||||
* and configure them to build various versions here.
|
* and configure them to build various versions here.
|
||||||
*/
|
*/
|
||||||
bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleasedVersion -> project("${unreleasedVersion.gradleProjectPath}") {
|
bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleasedVersion ->
|
||||||
|
project("${unreleasedVersion.gradleProjectPath}") {
|
||||||
Version bwcVersion = unreleasedVersion.version
|
Version bwcVersion = unreleasedVersion.version
|
||||||
String bwcBranch = unreleasedVersion.branch
|
String bwcBranch = unreleasedVersion.branch
|
||||||
apply plugin: 'distribution'
|
apply plugin: 'distribution'
|
||||||
|
@ -312,7 +313,8 @@ bwcVersions.forPreviousUnreleased { BwcVersions.UnreleasedVersionInfo unreleased
|
||||||
}
|
}
|
||||||
// make sure no dependencies were added to assemble; we want it to be a no-op
|
// make sure no dependencies were added to assemble; we want it to be a no-op
|
||||||
assemble.dependsOn = []
|
assemble.dependsOn = []
|
||||||
}}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class IndentingOutputStream extends OutputStream {
|
class IndentingOutputStream extends OutputStream {
|
||||||
|
|
||||||
|
|
|
@ -92,6 +92,7 @@ void addProcessFilesTask(String type, boolean oss, boolean jdk) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
addProcessFilesTask('deb', true, true)
|
addProcessFilesTask('deb', true, true)
|
||||||
addProcessFilesTask('deb', true, false)
|
addProcessFilesTask('deb', true, false)
|
||||||
addProcessFilesTask('deb', false, true)
|
addProcessFilesTask('deb', false, true)
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
* under the License.
|
* under the License.
|
||||||
*/
|
*/
|
||||||
import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask;
|
import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask;
|
||||||
|
|
||||||
esplugin {
|
esplugin {
|
||||||
description 'An easy, safe and fast scripting language for Elasticsearch'
|
description 'An easy, safe and fast scripting language for Elasticsearch'
|
||||||
classname 'org.elasticsearch.painless.PainlessPlugin'
|
classname 'org.elasticsearch.painless.PainlessPlugin'
|
||||||
|
|
|
@ -47,5 +47,7 @@ testClusters.integTest {
|
||||||
// repositoryDir is used by a FS repository to create snapshots
|
// repositoryDir is used by a FS repository to create snapshots
|
||||||
setting 'path.repo', "${repositoryDir.absolutePath}", PropertyNormalization.IGNORE_VALUE
|
setting 'path.repo', "${repositoryDir.absolutePath}", PropertyNormalization.IGNORE_VALUE
|
||||||
// repositoryDir is used by two URL repositories to restore snapshots
|
// repositoryDir is used by two URL repositories to restore snapshots
|
||||||
setting 'repositories.url.allowed_urls', { "http://snapshot.test*,http://${urlFixture.addressAndPort}" }, PropertyNormalization.IGNORE_VALUE
|
setting 'repositories.url.allowed_urls', {
|
||||||
|
"http://snapshot.test*,http://${urlFixture.addressAndPort}"
|
||||||
|
}, PropertyNormalization.IGNORE_VALUE
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
import org.elasticsearch.gradle.test.RestIntegTestTask
|
import org.elasticsearch.gradle.test.RestIntegTestTask
|
||||||
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
|
import org.elasticsearch.gradle.testclusters.TestClustersPlugin
|
||||||
|
|
||||||
|
|
1
test/fixtures/build.gradle
vendored
1
test/fixtures/build.gradle
vendored
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
// fixtures are mostly external and by default we don't want to check forbidden apis
|
// fixtures are mostly external and by default we don't want to check forbidden apis
|
||||||
forbiddenApisMain.enabled = false
|
forbiddenApisMain.enabled = false
|
||||||
|
|
|
@ -5,7 +5,8 @@ apply plugin: 'elasticsearch.rest-test'
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile project(path: xpackModule('enrich'), configuration: 'runtime')
|
testCompile project(path: xpackModule('enrich'), configuration: 'runtime')
|
||||||
testCompile project(path: xpackModule('core'), configuration: 'runtime')
|
testCompile project(path: xpackModule('core'), configuration: 'runtime')
|
||||||
testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime')}
|
testCompile project(path: xpackModule('enrich:qa:common'), configuration: 'runtime')
|
||||||
|
}
|
||||||
|
|
||||||
testClusters.integTest {
|
testClusters.integTest {
|
||||||
testDistribution = 'DEFAULT'
|
testDistribution = 'DEFAULT'
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
testCompile project(':x-pack:plugin:core')
|
testCompile project(':x-pack:plugin:core')
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This project contains transport-level requests and responses that are shared between x-pack plugin and qa tests
|
* This project contains transport-level requests and responses that are shared between x-pack plugin and qa tests
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The minimal dependencies REST-based SQL client that is used by CLI and JDBC
|
* The minimal dependencies REST-based SQL client that is used by CLI and JDBC
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This project contains XContent protocol classes shared between server and http client
|
* This project contains XContent protocol classes shared between server and http client
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue