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:
Rory Hunter 2019-11-13 10:14:04 +00:00 committed by GitHub
parent fbaf8c428d
commit 3a3e5f6176
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
184 changed files with 4122 additions and 4120 deletions

View file

@ -1,5 +1,5 @@
import com.bettercloud.vault.VaultConfig;
import com.bettercloud.vault.Vault;
import com.bettercloud.vault.VaultConfig
import com.bettercloud.vault.Vault
initscript {
repositories {
@ -30,7 +30,7 @@ final String vaultToken = System.getenv('VAULT_TOKEN') ?: new Vault(
.withRetries(5, 1000)
.auth()
.loginByAppRole("approle", System.env.VAULT_ROLE_ID, System.env.VAULT_SECRET_ID)
.getAuthClientToken();
.getAuthClientToken()
final Vault vault = new Vault(
new VaultConfig()
@ -45,7 +45,7 @@ final Vault vault = new Vault(
if (USE_ARTIFACTORY) {
final Map<String, String> artifactoryCredentials = vault.logical()
.read("secret/elasticsearch-ci/artifactory.elstc.co")
.getData();
.getData()
logger.info("Using elastic artifactory repos")
Closure configCache = {
return {
@ -93,7 +93,7 @@ final boolean buildCachePush = Boolean.valueOf(System.getProperty('org.elasticse
if (buildCacheUrl) {
final Map<String, String> buildCacheCredentials = vault.logical()
.read("secret/elasticsearch-ci/gradle-build-cache")
.getData();
.getData()
gradle.settingsEvaluated { settings ->
settings.buildCache {
local {

View file

@ -2,12 +2,15 @@
root = true
[*.java]
[*]
charset = utf-8
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
[*.bat]
indent_size = 2
[*.gradle]
indent_size = 2

View file

@ -435,6 +435,7 @@ class Run extends DefaultTask {
project.project(':distribution').run.debug = enabled
}
}
task run(type: Run) {
dependsOn ':distribution:run'
description = 'Runs elasticsearch in the foreground'

View file

@ -256,7 +256,7 @@ class VersionPropertiesLoader {
elasticsearch
)
}
String qualifier = systemProperties.getProperty("build.version_qualifier", "");
String qualifier = systemProperties.getProperty("build.version_qualifier", "")
if (qualifier.isEmpty() == false) {
if (qualifier.matches("(alpha|beta|rc)\\d+") == false) {
throw new IllegalStateException("Invalid qualifier: " + qualifier)

View file

@ -1,4 +1,3 @@
String distroConfig = System.getProperty('tests.local_distro.config')
if (distroConfig != null) {
// setup the test distribution as an artifact of this project

View file

@ -1,4 +1,3 @@
project.gradle.projectsEvaluated {
// wire the jdk repo to wiremock
String fakeJdkRepo = Objects.requireNonNull(System.getProperty('tests.jdk_repo'))

View file

@ -80,7 +80,6 @@ testingConventions {
}
}
dependencyLicenses {
dependencies = project.configurations.runtime.fileCollection {
it.group.startsWith('org.elasticsearch') == false

View file

@ -27,6 +27,7 @@ import org.elasticsearch.gradle.tar.SymbolicLinkPreservingTar
import java.nio.file.Files
import java.nio.file.Path
// need this so Zip/Tar tasks get basic defaults...
apply plugin: 'base'

View file

@ -559,7 +559,6 @@ subprojects {
'def': oss ? 'oss' : 'default'
],
'es.distribution.type': [
'deb': 'deb',
'rpm': 'rpm',

View file

@ -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
* 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
String bwcBranch = unreleasedVersion.branch
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
assemble.dependsOn = []
}}
}
}
class IndentingOutputStream extends OutputStream {

View file

@ -92,6 +92,7 @@ void addProcessFilesTask(String type, boolean oss, boolean jdk) {
}
}
}
addProcessFilesTask('deb', true, true)
addProcessFilesTask('deb', true, false)
addProcessFilesTask('deb', false, true)

View file

@ -17,6 +17,7 @@
* under the License.
*/
import org.elasticsearch.gradle.testclusters.DefaultTestClustersTask;
esplugin {
description 'An easy, safe and fast scripting language for Elasticsearch'
classname 'org.elasticsearch.painless.PainlessPlugin'

View file

@ -47,5 +47,7 @@ testClusters.integTest {
// repositoryDir is used by a FS repository to create snapshots
setting 'path.repo', "${repositoryDir.absolutePath}", PropertyNormalization.IGNORE_VALUE
// 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
}

View file

@ -1,4 +1,3 @@
import org.elasticsearch.gradle.test.RestIntegTestTask
import org.elasticsearch.gradle.testclusters.TestClustersPlugin

View file

@ -1,4 +1,3 @@
subprojects {
// fixtures are mostly external and by default we don't want to check forbidden apis
forbiddenApisMain.enabled = false

View file

@ -5,7 +5,8 @@ apply plugin: 'elasticsearch.rest-test'
dependencies {
testCompile project(path: xpackModule('enrich'), 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 {
testDistribution = 'DEFAULT'

View file

@ -1,4 +1,3 @@
dependencies {
testCompile project(':x-pack:plugin:core')
}

View file

@ -1,4 +1,3 @@
/*
* This project contains transport-level requests and responses that are shared between x-pack plugin and qa tests
*/

View file

@ -1,4 +1,3 @@
/*
* The minimal dependencies REST-based SQL client that is used by CLI and JDBC
*/

View file

@ -1,4 +1,3 @@
/*
* This project contains XContent protocol classes shared between server and http client
*/