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/06/02 07:43:56 UTC

[lucene-solr] branch jira/SOLR-13452_gradle_3 updated (8ea6509 -> b407ba4)

This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a change to branch jira/SOLR-13452_gradle_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git.


    from 8ea6509  SOLR-13452: Cannot use configureondemand and slf4j version is specified twice.
     new 54c0799  SOLR-13452: Remove repo def from buildSrc gradle file.
     new 91ac7f6  SOLR-13452: Get commons-io version in forbiddenApis from versions.props.
     new b407ba4  SOLR-13452: Add a target to reset working copy to a pristine state.

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 build.gradle                                       |  4 ++
 buildSrc/build.gradle                              |  6 +--
 .../gradle/LuceneSolrForbiddenApisPlugin.groovy    |  6 ++-
 .../{Download.groovy => PristineCheckout.groovy}   | 45 +++++++++++-----------
 4 files changed, 32 insertions(+), 29 deletions(-)
 copy buildSrc/src/main/groovy/org/apache/lucene/gradle/{Download.groovy => PristineCheckout.groovy} (59%)


[lucene-solr] 01/03: SOLR-13452: Remove repo def from buildSrc gradle file.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch jira/SOLR-13452_gradle_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 54c079909d7bdc16c8ca8b08a74ae351ccc8ea91
Author: markrmiller <ma...@apache.org>
AuthorDate: Sun Jun 2 02:13:17 2019 -0500

    SOLR-13452: Remove repo def from buildSrc gradle file.
---
 buildSrc/build.gradle | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle
index f1eb030..92e5a82 100644
--- a/buildSrc/build.gradle
+++ b/buildSrc/build.gradle
@@ -18,16 +18,12 @@
 apply plugin: 'groovy'
 apply plugin: 'java'
 apply plugin: 'java-gradle-plugin'
-apply plugin: 'idea'
 
 buildDir = new File("build")
 
 group = 'org.apache.lucene.gradle'
 
-repositories {
-  jcenter()
-  mavenCentral()
-}
+apply from: new File("common/configure-repositories.gradle")
 
 dependencies {
   implementation gradleApi()


[lucene-solr] 02/03: SOLR-13452: Get commons-io version in forbiddenApis from versions.props.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch jira/SOLR-13452_gradle_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit 91ac7f619942ae77480214c987ca769966c36ddf
Author: markrmiller <ma...@apache.org>
AuthorDate: Sun Jun 2 02:13:53 2019 -0500

    SOLR-13452: Get commons-io version in forbiddenApis from versions.props.
---
 .../org/apache/lucene/gradle/LuceneSolrForbiddenApisPlugin.groovy   | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/buildSrc/src/main/groovy/org/apache/lucene/gradle/LuceneSolrForbiddenApisPlugin.groovy b/buildSrc/src/main/groovy/org/apache/lucene/gradle/LuceneSolrForbiddenApisPlugin.groovy
index 927a8de..80e36f5 100644
--- a/buildSrc/src/main/groovy/org/apache/lucene/gradle/LuceneSolrForbiddenApisPlugin.groovy
+++ b/buildSrc/src/main/groovy/org/apache/lucene/gradle/LuceneSolrForbiddenApisPlugin.groovy
@@ -48,10 +48,12 @@ class LuceneSolrForbiddenApisPlugin implements Plugin<Project> {
         task.signaturesURLs += getClass().getResource('/forbidden/lucene.txt')
       } else if (project.group ==~ /.*?\.solr(?:\.\w+)?/) {
         task.signaturesURLs += getClass().getResource((project.name == 'solrj') ? '/forbidden/solrj.txt' : '/forbidden/solr.txt')
-        task.bundledSignatures += [ 'commons-io-unsafe-' + COMMONS_IO_VERSION ]
         
-        // we delay adding the servlet-api checks until we figured out that we have a servlet-api.jar on forbidden's classpath:
+
         task.doFirst{
+          task.bundledSignatures += [ 'commons-io-unsafe-' + project.getVersion("commons-io:commons-io") ]
+          
+          // we delay adding the servlet-api checks until we figured out that we have a servlet-api.jar on forbidden's classpath:
           if (task.classpath.filter { it.name ==~ /.*?\bservlet-api\b.*?\.jar/ }.empty == false) {
             task.signaturesURLs += getClass().getResource('/forbidden/servlet-api.txt')
           }


[lucene-solr] 03/03: SOLR-13452: Add a target to reset working copy to a pristine state.

Posted by ma...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

markrmiller pushed a commit to branch jira/SOLR-13452_gradle_3
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git

commit b407ba48ea731ea1d188a2eb5e068fa4bdab2b2e
Author: markrmiller <ma...@apache.org>
AuthorDate: Sun Jun 2 02:42:17 2019 -0500

    SOLR-13452: Add a target to reset working copy to a pristine state.
---
 build.gradle                                       |  4 ++
 .../apache/lucene/gradle/PristineCheckout.groovy   | 57 ++++++++++++++++++++++
 2 files changed, 61 insertions(+)

diff --git a/build.gradle b/build.gradle
index f603aa5..3d48f29 100644
--- a/build.gradle
+++ b/build.gradle
@@ -139,6 +139,10 @@ configure(rootProject) {
     description = "Show the slowest tests (averages)."
   }
   
+  task pristineCheckout(type: org.apache.lucene.gradle.PristineCheckout) {
+
+  }
+  
 }
 
 // -> lucene-solr IDE config - setup eclipse and idea
diff --git a/buildSrc/src/main/groovy/org/apache/lucene/gradle/PristineCheckout.groovy b/buildSrc/src/main/groovy/org/apache/lucene/gradle/PristineCheckout.groovy
new file mode 100644
index 0000000..0f88f39
--- /dev/null
+++ b/buildSrc/src/main/groovy/org/apache/lucene/gradle/PristineCheckout.groovy
@@ -0,0 +1,57 @@
+package org.apache.lucene.gradle
+/*
+ * 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.
+ */
+
+import org.eclipse.jgit.api.Git
+import org.eclipse.jgit.api.Status
+import org.eclipse.jgit.lib.Repository
+import org.eclipse.jgit.storage.file.FileRepositoryBuilder
+import org.eclipse.jgit.api.ResetCommand.ResetType
+import org.eclipse.jgit.errors.*
+import org.gradle.api.DefaultTask
+import org.gradle.api.GradleException
+import org.gradle.api.tasks.Input
+import org.gradle.api.tasks.TaskAction
+
+
+class PristineCheckout extends DefaultTask {
+
+
+  PristineCheckout() {
+    this.group = 'Build'
+    this.description = "Cleans the checkout for a pristine state (WARNING: the ultimate clean task - removes all files unknown by or ignored by git: git clean -d -x -f!)."
+  }
+
+  @TaskAction
+  void check() {
+    try {
+      logger.info('Reseting working copy...')
+      final Repository repository = new FileRepositoryBuilder()
+        .setWorkTree(project.getRootDir())
+        .setMustExist(true)
+        .build();
+        
+      new Git(repository).clean().setCleanDirectories(true).setIgnore(false).setForce(true).call();
+
+
+    } catch (RepositoryNotFoundException | NoWorkTreeException | NotSupportedException e) {
+      logger.error('WARNING: Development directory is not a valid GIT checkout!')
+    }
+  }
+}
+
+