Merge branch 'master' into feature-suggest-refactoring

This commit is contained in:
Christoph Büscher 2016-02-05 10:40:50 +01:00
commit baf57f809a
9 changed files with 1738 additions and 1718 deletions

6
.gitignore vendored
View File

@ -4,12 +4,13 @@
*.iml *.iml
*.ipr *.ipr
*.iws *.iws
build-idea/
# eclipse files # eclipse files
.project .project
.classpath .classpath
eclipse-build
.settings .settings
build-eclipse/
# netbeans files # netbeans files
nb-configuration.xml nb-configuration.xml
@ -18,7 +19,6 @@ nbactions.xml
# gradle stuff # gradle stuff
.gradle/ .gradle/
build/ build/
generated-resources/
# maven stuff (to be removed when trunk becomes 4.x) # maven stuff (to be removed when trunk becomes 4.x)
*-execution-hints.log *-execution-hints.log
@ -38,5 +38,5 @@ html_docs
# random old stuff that we should look at the necessity of... # random old stuff that we should look at the necessity of...
/tmp/ /tmp/
backwards/ backwards/
eclipse-build

View File

@ -75,8 +75,9 @@ subprojects {
allprojects { allprojects {
// injecting groovy property variables into all projects // injecting groovy property variables into all projects
project.ext { project.ext {
// for eclipse hacks... // for ide hacks...
isEclipse = System.getProperty("eclipse.launcher") != null || gradle.startParameter.taskNames.contains('eclipse') || gradle.startParameter.taskNames.contains('cleanEclipse') isEclipse = System.getProperty("eclipse.launcher") != null || gradle.startParameter.taskNames.contains('eclipse') || gradle.startParameter.taskNames.contains('cleanEclipse')
isIdea = System.getProperty("idea.active") != null || gradle.startParameter.taskNames.contains('idea') || gradle.startParameter.taskNames.contains('cleanIdea')
} }
} }
@ -170,12 +171,14 @@ gradle.projectsEvaluated {
allprojects { allprojects {
apply plugin: 'idea' apply plugin: 'idea'
if (isIdea) {
project.buildDir = file('build-idea')
}
idea { idea {
module { module {
// same as for the IntelliJ Gradle tooling integration
inheritOutputDirs = false inheritOutputDirs = false
outputDir = file('build/classes/main') outputDir = file('build-idea/classes/main')
testOutputDir = file('build/classes/test') testOutputDir = file('build-idea/classes/test')
iml { iml {
// fix so that Gradle idea plugin properly generates support for resource folders // fix so that Gradle idea plugin properly generates support for resource folders
@ -222,14 +225,19 @@ allprojects {
apply plugin: 'eclipse' apply plugin: 'eclipse'
plugins.withType(JavaBasePlugin) { plugins.withType(JavaBasePlugin) {
eclipse.classpath.defaultOutputDir = new File(project.buildDir, 'eclipse') File eclipseBuild = project.file('build-eclipse')
eclipse.classpath.defaultOutputDir = eclipseBuild
if (isEclipse) {
// set this so generated dirs will be relative to eclipse build
project.buildDir = eclipseBuild
}
eclipse.classpath.file.whenMerged { classpath -> eclipse.classpath.file.whenMerged { classpath ->
// give each source folder a unique corresponding output folder // give each source folder a unique corresponding output folder
int i = 0; int i = 0;
classpath.entries.findAll { it instanceof SourceFolder }.each { folder -> classpath.entries.findAll { it instanceof SourceFolder }.each { folder ->
i++; i++;
// this is *NOT* a path or a file. // this is *NOT* a path or a file.
folder.output = "build/eclipse/" + i folder.output = "build-eclipse/" + i
} }
} }
} }

View File

@ -76,9 +76,17 @@ extraArchive {
tests = false tests = false
} }
idea {
module {
inheritOutputDirs = false
outputDir = file('build-idea/classes/main')
testOutputDir = file('build-idea/classes/test')
}
}
eclipse { eclipse {
classpath { classpath {
defaultOutputDir = new File(file('build'), 'eclipse') defaultOutputDir = file('build-eclipse')
} }
} }

View File

@ -29,7 +29,7 @@ import org.gradle.api.tasks.Copy
class PluginPropertiesTask extends Copy { class PluginPropertiesTask extends Copy {
PluginPropertiesExtension extension PluginPropertiesExtension extension
File generatedResourcesDir = new File(project.projectDir, 'generated-resources') File generatedResourcesDir = new File(project.buildDir, 'generated-resources')
PluginPropertiesTask() { PluginPropertiesTask() {
File templateFile = new File(project.buildDir, 'templates/plugin-descriptor.properties') File templateFile = new File(project.buildDir, 'templates/plugin-descriptor.properties')

View File

@ -91,11 +91,12 @@ class PrecommitTasks {
// on them. But we want `precommit` to depend on `checkstyle` which depends on them so // on them. But we want `precommit` to depend on `checkstyle` which depends on them so
// we have to swap them. // we have to swap them.
project.pluginManager.apply('checkstyle') project.pluginManager.apply('checkstyle')
URL checkstyleSuppressions = PrecommitTasks.getResource('/checkstyle_suppressions.xml')
project.checkstyle { project.checkstyle {
config = project.resources.text.fromFile( config = project.resources.text.fromFile(
PrecommitTasks.getResource('/checkstyle.xml'), 'UTF-8') PrecommitTasks.getResource('/checkstyle.xml'), 'UTF-8')
configProperties = [ configProperties = [
suppressions: PrecommitTasks.getResource('/checkstyle_suppressions.xml') suppressions: checkstyleSuppressions
] ]
} }
for (String taskName : ['checkstyleMain', 'checkstyleTest']) { for (String taskName : ['checkstyleMain', 'checkstyleTest']) {
@ -103,6 +104,7 @@ class PrecommitTasks {
if (task != null) { if (task != null) {
project.tasks['check'].dependsOn.remove(task) project.tasks['check'].dependsOn.remove(task)
checkstyleTask.dependsOn(task) checkstyleTask.dependsOn(task)
task.inputs.file(checkstyleSuppressions)
} }
} }
return checkstyleTask return checkstyleTask

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
package org.elastiscearch.index.store; package org.elasticsearch.index.store;
/* /*
* Licensed to Elasticsearch under one or more contributor * Licensed to Elasticsearch under one or more contributor

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
package org.elastiscearch.index.store; package org.elasticsearch.index.store;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;

View File

@ -17,7 +17,7 @@
* under the License. * under the License.
*/ */
package org.elastiscearch.index.store; package org.elasticsearch.index.store;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Path; import java.nio.file.Path;