You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ma...@apache.org on 2019/05/15 14:19:34 UTC
[lucene-solr] branch jira/SOLR-13452_gradle updated: SOLR-13452:
Pull eclipse config into it's own file and exclude benchmark/work and
benchmark/temp as the file sizes and counts in those folders can make
eclipse unhappy.
This is an automated email from the ASF dual-hosted git repository.
markrmiller pushed a commit to branch jira/SOLR-13452_gradle
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/jira/SOLR-13452_gradle by this push:
new 4225da1 SOLR-13452: Pull eclipse config into it's own file and exclude benchmark/work and benchmark/temp as the file sizes and counts in those folders can make eclipse unhappy.
4225da1 is described below
commit 4225da138ac3fd2d51f88b947f9387cb6c5deee2
Author: markrmiller <ma...@apache.org>
AuthorDate: Wed May 15 09:19:12 2019 -0500
SOLR-13452: Pull eclipse config into it's own file and exclude benchmark/work and benchmark/temp as the file sizes and counts in those folders can make eclipse unhappy.
---
build.gradle | 63 +++++---------------------------------
buildSrc/eclipse.gradle | 81 +++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 89 insertions(+), 55 deletions(-)
diff --git a/build.gradle b/build.gradle
index f98438b..f073b66 100644
--- a/build.gradle
+++ b/build.gradle
@@ -9,6 +9,7 @@ plugins {
id 'eclipse'
}
+def buildSrcDir = project.rootProject.projectDir;
allprojects {
@@ -35,7 +36,6 @@ allprojects {
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
-
}
task('regenerate') {
@@ -181,60 +181,6 @@ configure(subprojects) { pj ->
}
}
- apply plugin: 'eclipse'
- plugins.withType(JavaPlugin) {
- eclipse {
-
- classpath {
- defaultOutputDir = file('build-eclipse')
-
- downloadSources=true
- downloadJavadoc = true
-
- plusConfigurations += [
- configurations.implementationTran,
- configurations.testImplementationTran
- ]
-
- file.whenMerged { classpath ->
- if (project.name == 'buildSrc') {
- project.tasks.pluginUnderTestMetadata
- }
-
- classpath.entries.each { entry ->
-
- if ( entry.kind == 'src' && entry.hasProperty('output') ) {
- // use default Output for all source-folders
- entry.output = null
- }
- }
-
- // add JRE_CONTAINER
- classpath.entries.removeAll { entry -> entry.kind == 'con' && entry.toString().startsWith('org.eclipse.jdt.launching.JRE_CONTAINER') }
- def jreContainer = new org.gradle.plugins.ide.eclipse.model.Container('org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11')
- jreContainer.getEntryAttributes().put("module", "false");
-
- classpath.entries.add(jreContainer)
-
- classpath.entries.each { entry ->
- if ( entry.kind == 'lib') {
- entry.exported = true
- }
- }
-
- // Jetty mod files make eclipse sad
- new File("${projectDir}/.settings/org.eclipse.wst.validation.prefs").text = """
-eclipse.preferences.version=1
-override=true
-suspend=true
-vf.version=3
-"""
- }
-
- }
- }
- }
-
tasks.withType(Test) {
filter {
// so we can run with --tests wildcards
@@ -273,6 +219,13 @@ task checkSourcePatterns(type: org.apache.lucene.gradle.CheckSourcePatterns) {
baseDir = rootProject.projectDir
}
+// setup eclipse
+allprojects {
+ plugins.withType(JavaPlugin) {
+ project.apply from: new File(buildSrcDir, "buildSrc/eclipse.gradle")
+ }
+}
+
// turn off idea cycle checking - how to do for eclipse?
idea.project.ipr {
// Edit the output *.ipr file before it's written out
diff --git a/buildSrc/eclipse.gradle b/buildSrc/eclipse.gradle
new file mode 100644
index 0000000..3d049b8
--- /dev/null
+++ b/buildSrc/eclipse.gradle
@@ -0,0 +1,81 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+eclipse {
+ project {
+ if (project.name == 'benchmark') {
+ resourceFilter {
+ appliesTo = 'FOLDERS'
+ type = 'EXCLUDE_ALL'
+ matcher {
+ id = 'org.eclipse.ui.ide.multiFilter'
+ arguments = '1.0-projectRelativePath-matches-true-true-work|temp'
+ }
+ }
+ }
+ }
+
+ classpath {
+
+ defaultOutputDir = file('build-eclipse')
+
+ downloadSources=true
+ downloadJavadoc = true
+
+ if (configurations.hasProperty('implementationTran')) {
+ plusConfigurations += [
+ configurations.implementationTran,
+ configurations.testImplementationTran
+ ]
+ }
+
+ file.whenMerged { classpath ->
+ if (project.name == 'buildSrc') {
+ project.tasks.pluginUnderTestMetadata
+ }
+
+ classpath.entries.each { entry ->
+
+ if ( entry.kind == 'src' && entry.hasProperty('output') ) {
+ // use default Output for all source-folders
+ entry.output = null
+ }
+ }
+
+ // add JRE_CONTAINER
+ classpath.entries.removeAll { entry -> entry.kind == 'con' && entry.path.startsWith('org.eclipse.jdt.launching.JRE_CONTAINER') }
+ def jreContainer = new org.gradle.plugins.ide.eclipse.model.Container('org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11')
+ jreContainer.getEntryAttributes().put("module", "false")
+
+ classpath.entries.add(jreContainer)
+
+ classpath.entries.each { entry ->
+ if ( entry.kind == 'lib') {
+ entry.exported = true
+ }
+ }
+
+ // Jetty mod files make eclipse sad
+ new File("${projectDir}/.settings/org.eclipse.wst.validation.prefs").text = """
+eclipse.preferences.version=1
+override=true
+suspend=true
+vf.version=3
+"""
+ }
+ }
+}