You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by dw...@apache.org on 2020/04/08 17:46:45 UTC

[lucene-solr] branch master updated: LUCENE-9310: workaround for IntelliJ gradle import

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

dweiss pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new dbb4be1  LUCENE-9310: workaround for IntelliJ gradle import
dbb4be1 is described below

commit dbb4be1ca93607c2555fe8b2b2cb3318be582edb
Author: Dawid Weiss <da...@carrotsearch.com>
AuthorDate: Wed Apr 8 19:46:35 2020 +0200

    LUCENE-9310: workaround for IntelliJ gradle import
---
 gradle/jar-manifest.gradle | 158 +++++++++++++++++++++++----------------------
 1 file changed, 81 insertions(+), 77 deletions(-)

diff --git a/gradle/jar-manifest.gradle b/gradle/jar-manifest.gradle
index bf8e681..69b4116 100644
--- a/gradle/jar-manifest.gradle
+++ b/gradle/jar-manifest.gradle
@@ -1,78 +1,82 @@
-/*
- * 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.
- */
-
-// Configures JAR manifest entries
-
-allprojects {
-    // Declare these inline for now. Don't know if it makes sense to declare them
-    // per-project.
-    def title;
-    def implementationTitle;
-    def legaleseDir;
-    if (project.path.startsWith(":lucene")) {
-        implementationTitle = "org.apache.lucene"
-        title = "Lucene Search Engine: ${project.name}"
-        legaleseDir = project(":lucene").projectDir
-    } else {
-        implementationTitle = "org.apache.solr"
-        title = "Apache Solr Search Server: ${project.name}"
-        legaleseDir = project(":solr").projectDir
-    }
-
-    // Apply the manifest to any JAR or WAR file created by any project,
-    // excluding those explicitly listed.
-    tasks.withType(Jar)
-            .matching { t -> !["sourcesJar", "javadocJar"].contains(t.name) }
-            .configureEach { task ->
-                // Compute git status once on the root project prior to assembling manifest.
-                dependsOn ":gitStatus"
-
-                // Because git status is a task we must defer computing this
-                // until status has been computed. We do this with a provider.
-                def implementationVersion = provider {
-                    "${project.version} ${rootProject.gitRev} - ${System.properties['user.name']} - ${buildDate} ${buildTime}"
-                }
-
-                manifest {
-                    attributes([
-                            "Extension-Name"        : implementationTitle,
-
-                            "Implementation-Vendor" : "The Apache Software Foundation",
-                            "Implementation-Title"  : implementationTitle,
-                            "Implementation-Version": implementationVersion,
-
-                            "Specification-Vendor"  : "The Apache Software Foundation",
-                            "Specification-Version" : project.baseVersion,
-                            "Specification-Title"   : title,
-
-                            "X-Compile-Source-JDK"  : "${project.sourceCompatibility}",
-                            "X-Compile-Target-JDK"  : "${project.targetCompatibility}",
-
-                            "X-Build-JDK"           : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
-                            "X-Build-OS"            : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
-                    ])
-                }
-
-                // Copy legalese into META-INF.
-                metaInf {
-                    from(legaleseDir, {
-                      include "LICENSE.txt"
-                      include "NOTICE.txt"
-                    })
-                }
-            }
+/*
+ * 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.
+ */
+
+// Configures JAR manifest entries
+
+allprojects {
+    // Declare these inline for now. Don't know if it makes sense to declare them
+    // per-project.
+    def title;
+    def implementationTitle;
+    def legaleseDir;
+    if (project.path.startsWith(":lucene")) {
+        implementationTitle = "org.apache.lucene"
+        title = "Lucene Search Engine: ${project.name}"
+        legaleseDir = project(":lucene").projectDir
+    } else {
+        implementationTitle = "org.apache.solr"
+        title = "Apache Solr Search Server: ${project.name}"
+        legaleseDir = project(":solr").projectDir
+    }
+
+    // Apply the manifest to any JAR or WAR file created by any project,
+    // excluding those explicitly listed.
+    tasks.withType(Jar)
+            .matching { t -> !["sourcesJar", "javadocJar"].contains(t.name) }
+            .configureEach { task ->
+                // Compute git status once on the root project prior to assembling manifest.
+                dependsOn ":gitStatus"
+
+                // Because git status is a task we must defer computing this
+                // until status has been computed. We do this with a provider.
+                def implementationVersion = provider {
+                    // LUCENE-9310: gitRev should always be there but IntelliJ does something
+                    // awkward on import and resolves provider properties even though task dependencies
+                    // have not been run yet?
+                    def gitRev = rootProject.hasProperty("gitRev") ? rootProject.gitRev : ""
+                    "${project.version} ${gitRev} - ${System.properties['user.name']} - ${buildDate} ${buildTime}"
+                }
+
+                manifest {
+                    attributes([
+                            "Extension-Name"        : implementationTitle,
+
+                            "Implementation-Vendor" : "The Apache Software Foundation",
+                            "Implementation-Title"  : implementationTitle,
+                            "Implementation-Version": implementationVersion,
+
+                            "Specification-Vendor"  : "The Apache Software Foundation",
+                            "Specification-Version" : project.baseVersion,
+                            "Specification-Title"   : title,
+
+                            "X-Compile-Source-JDK"  : "${project.sourceCompatibility}",
+                            "X-Compile-Target-JDK"  : "${project.targetCompatibility}",
+
+                            "X-Build-JDK"           : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
+                            "X-Build-OS"            : "${System.properties['os.name']} ${System.properties['os.arch']} ${System.properties['os.version']}"
+                    ])
+                }
+
+                // Copy legalese into META-INF.
+                metaInf {
+                    from(legaleseDir, {
+                      include "LICENSE.txt"
+                      include "NOTICE.txt"
+                    })
+                }
+            }
 }
\ No newline at end of file