[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-06 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r500092191



##
File path: solr/packaging/build.gradle
##
@@ -62,12 +63,17 @@ dependencies {
 
   example project(path: ":solr:example", configuration: "packaging")
   server project(path: ":solr:server", configuration: "packaging")
+
+  // Copy files from documentation output
+  docs project(path: ':solr', configuration: 'docs')

Review comment:
   Ah, sorry - yes, you are correct. It should declare artifacts, the 
configuration to attach them to and the outputs. An example is in 
solr/example/build.gradle:
   
   ```
   artifacts {
 packaging packagingDir, {
   builtBy assemblePackaging
 }
   } 
   ```





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-06 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r500100437



##
File path: solr/packaging/build.gradle
##
@@ -62,12 +63,17 @@ dependencies {
 
   example project(path: ":solr:example", configuration: "packaging")
   server project(path: ":solr:server", configuration: "packaging")
+
+  // Copy files from documentation output
+  docs project(path: ':solr', configuration: 'docs')

Review comment:
   There are no stupid questions. This is the relevant documentation bit 
here, I believe.
   https://docs.gradle.org/current/userguide/cross_project_publications.html





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-06 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r500092191



##
File path: solr/packaging/build.gradle
##
@@ -62,12 +63,17 @@ dependencies {
 
   example project(path: ":solr:example", configuration: "packaging")
   server project(path: ":solr:server", configuration: "packaging")
+
+  // Copy files from documentation output
+  docs project(path: ':solr', configuration: 'docs')

Review comment:
   Ah, sorry - yes, you are correct. It should declare artifacts, the 
configuration to attach them to and the outputs. An example is in 
solr/example/build.gradle:
   
   artifacts {
 packaging packagingDir, {
   builtBy assemblePackaging
 }
   } 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-05 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r500041959



##
File path: solr/packaging/build.gradle
##
@@ -62,12 +63,17 @@ dependencies {
 
   example project(path: ":solr:example", configuration: "packaging")
   server project(path: ":solr:server", configuration: "packaging")
+
+  // Copy files from documentation output
+  docs project(path: ':solr', configuration: 'docs')

Review comment:
   I explained this above, I hope. I think artifact/configuration based 
approach to collecting packaging dependencies is superior to explicit 
properties and task-dependencies.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-05 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r500042473



##
File path: solr/packaging/build.gradle
##
@@ -115,15 +121,15 @@ distributions {
 into "server"
   })
 
+  from(configurations.docs, {
+into "docs"
+  })
   // docs/   - TODO: this is assembled via XSLT... leaving out for now.
+  // -- Is there more to do here?

Review comment:
   I think we can create a separate issue for collecting Solr docs? This 
patch is mostly about Lucene and it's pretty big already.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-05 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r500041550



##
File path: lucene/packaging/build.gradle
##
@@ -0,0 +1,171 @@
+/*
+ * 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.
+ */
+
+// This project puts together a "distribution", assembling dependencies from
+// various other projects.
+
+plugins {
+id 'distribution'
+}
+
+description = 'Lucene distribution packaging'
+
+// Declare all subprojects that should be included in binary distribution.
+// By default everything is included, unless explicitly excluded.
+def includeInBinaries = project(":lucene").subprojects.findAll {subproject ->
+return !(subproject.path in [
+// Exclude packaging, not relevant to binary distribution.
+":lucene:packaging",
+// Exclude parent container project of analysis modules (no artifacts).
+":lucene:analysis"
+])
+}
+
+// Create a configuration to each subproject and add dependency.
+def binaryArtifactsConf = { Project prj ->
+"dep-binary" + prj.path.replace(':', '-')
+}
+
+def allDepsConf = { Project prj ->
+"dep-full" + prj.path.replace(':', '-')
+}
+
+configurations {
+docs
+}
+
+for (Project includedProject : includeInBinaries) {
+def confBinaries = binaryArtifactsConf(includedProject)
+def confFull = allDepsConf(includedProject)
+configurations.create(confBinaries)
+configurations.create(confFull)
+dependencies { DependencyHandler handler ->
+// Just project binaries.
+handler.add(confBinaries, project(path: includedProject.path, 
configuration: "packaging"))
+// All project dependencies, including transitive dependencies from 
the runtime configuration.
+handler.add(confFull, project(path: includedProject.path, 
configuration: "runtimeElements"), {
+exclude group: "org.apache.lucene"
+
+// Exclude these from all projects.
+exclude group: "commons-logging"
+exclude group: "org.slf4j"
+})
+}
+}
+
+dependencies {
+docs project(path: ':lucene', configuration: 'docs')
+}
+
+distributions {
+// The "main" distribution is the binary distribution.
+// We should also add 'source' distribution at some point
+// (we can't do it now as the build itself is tangled with Solr).
+main {
+distributionBaseName = 'lucene'
+
+contents {
+// Manually correct posix permissions (matters when packaging on 
Windows).
+filesMatching(["**/*.sh", "**/*.bat"]) { copy ->
+copy.setMode(0755)
+}
+
+// Root distribution files; these are cherry-picked manually.
+from(project(':lucene').projectDir, {
+include "CHANGES.txt"
+include "JRE_VERSION_MIGRATION.md"
+include "LICENSE.txt"
+include "licenses/*"
+include "MIGRATE.md"
+include "NOTICE.txt"
+include "README.md"
+include "SYSTEM_REQUIREMENTS.md"
+})
+
+// A couple more missing README files
+from(project(':lucene:analysis').projectDir) {
+include "README.txt"
+into 'analysis'
+}
+
+// Copy files from documentation output to 'docs'
+from(configurations.docs, {

Review comment:
   This is part of the PR, Uwe - here.
   
https://github.com/apache/lucene-solr/pull/1905/files#diff-d55d7b9fe9d94d4e2e5554e3c1108943R60-R63
   
   I suggested using configuration-based copying instead of pointing at an 
explicit folder because it has several advantages. First, an artifact exported 
via configuration is configurable in the place where it logically belongs to. 
So you can put together a set of documentation artifacts in documentation 
configuration snippet and just depend on it when you're assembling something 
that uses those artifacts.
   
   The second benefit is that dependencies on tasks assembling those artifacts 
are automatically resolved - you don't need to know anything beyond the name of 
the project and configuration from which you're coping. The rest is done 

[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-02 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r498666120



##
File path: lucene/packaging/build.gradle
##
@@ -0,0 +1,160 @@
+/*
+ * 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.
+ */
+
+// This project puts together a "distribution", assembling dependencies from
+// various other projects.
+
+plugins {
+id 'distribution'
+}
+
+description = 'Lucene distribution packaging'
+
+// Declare all subprojects that should be included in binary distribution.
+// By default everything is included, unless explicitly excluded.
+def includeInBinaries = project(":lucene").subprojects.findAll {subproject ->
+return !(subproject.path in [
+":lucene:packaging",
+":lucene:analysis",
+":lucene:luke", // nocommit - Encountered duplicate path 
"luke/lib/log4j-core-2.13.2.jar"

Review comment:
   This wasn't obvious. Here's what happened.
   
   We create a configuration with dependency on "full project", it looked like 
this:
   ```
   handler.add(confFull, project(path: includedProject.path), {...
   ```
   
   This in fact is a dependency on the configuration aptly named 'default', 
which includes all of project binaries and transitive dependencies (archives in 
general).
   
   Luke declared a separate configuration for dependencies called 'standalone' 
which added a few non-project dependencies (the 'implementation' extended from 
it so they were visible on runtime classpath). The core of the problem was in 
that luke also exported an extra artifact that belonged to this 'standalone' 
configuration  - this was a set of JARs assembled under a folder. So when the 
packaging process was collecting files for inclusion, it encountered log4j 
twice: a copy in that 'standalone' folder and a copy from transitive project 
dependencies.
   
   I recall you asked why this 'fail' on double archive entries is needed. 
Well, it's useful to catch pearls like this one above...





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-10-02 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r498666282



##
File path: lucene/packaging/build.gradle
##
@@ -0,0 +1,160 @@
+/*
+ * 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.
+ */
+
+// This project puts together a "distribution", assembling dependencies from
+// various other projects.
+
+plugins {
+id 'distribution'
+}
+
+description = 'Lucene distribution packaging'
+
+// Declare all subprojects that should be included in binary distribution.
+// By default everything is included, unless explicitly excluded.
+def includeInBinaries = project(":lucene").subprojects.findAll {subproject ->
+return !(subproject.path in [
+":lucene:packaging",
+":lucene:analysis",
+":lucene:luke", // nocommit - Encountered duplicate path 
"luke/lib/log4j-core-2.13.2.jar"

Review comment:
   I've verified that it collects Luke properly and the launch script 
starts it fine (on Windows).





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-09-25 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r494116068



##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?
+// Or is this fine here?
+
+plugins {
+  id 'distribution'
+}
+
 description = 'Parent project for Apache Lucene Core'
 
 subprojects {
   group "org.apache.lucene"
-}
\ No newline at end of file
+}
+
+distributions {
+  main {
+  // This is empirically wrong, but it is mostly a copy from `ant 
package-zip`

Review comment:
   Ok, fair enough. But I wouldn't want to add things to gradle that are 
not right - these are hard to get rid of later on. I'm really busy this week 
but I will correct those assembly bits and commit them to this PR. Please give 
me some time to work on this, thank you.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-09-24 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r494116068



##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?
+// Or is this fine here?
+
+plugins {
+  id 'distribution'
+}
+
 description = 'Parent project for Apache Lucene Core'
 
 subprojects {
   group "org.apache.lucene"
-}
\ No newline at end of file
+}
+
+distributions {
+  main {
+  // This is empirically wrong, but it is mostly a copy from `ant 
package-zip`

Review comment:
   Ok, fair enough. But I wouldn't want to add things to gradle that are 
not right - these are hard to get rid of later on. I'm really busy this week 
but I will correct those assembly bits and commit them to this PR. Please give 
me some time to work on this, thank you.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-09-23 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r493853135



##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?
+// Or is this fine here?
+
+plugins {
+  id 'distribution'
+}
+
 description = 'Parent project for Apache Lucene Core'
 
 subprojects {
   group "org.apache.lucene"
-}
\ No newline at end of file
+}
+
+distributions {
+  main {
+  // This is empirically wrong, but it is mostly a copy from `ant 
package-zip`

Review comment:
   Haven't forgotten about it, just busy with work. Those release scripts 
will have to be adjusted to Solr and Lucene released independently in the 
future. Which requires independent builds, which requires repo split. Will have 
to get to it, eventually. Sigh.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-09-22 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r492507019



##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?

Review comment:
   Yes, please move it to :lucene:packaging. It makes things much cleaner 
in the long run.

##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?
+// Or is this fine here?
+
+plugins {
+  id 'distribution'
+}
+
 description = 'Parent project for Apache Lucene Core'
 
 subprojects {
   group "org.apache.lucene"
-}
\ No newline at end of file
+}
+
+distributions {
+  main {
+  // This is empirically wrong, but it is mostly a copy from `ant 
package-zip`

Review comment:
   This is wrong. It should rely on published artifacts from other 
subprojects (set up proper dependencies) and assemble them in the right way 
into the distribution layout.

##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?
+// Or is this fine here?
+
+plugins {
+  id 'distribution'
+}
+
 description = 'Parent project for Apache Lucene Core'
 
 subprojects {
   group "org.apache.lucene"
-}
\ No newline at end of file
+}
+
+distributions {
+  main {
+  // This is empirically wrong, but it is mostly a copy from `ant 
package-zip`

Review comment:
   Sure but you'll have to be patient - can't do it right away. 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-09-22 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r492962137



##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?
+// Or is this fine here?
+
+plugins {
+  id 'distribution'
+}
+
 description = 'Parent project for Apache Lucene Core'
 
 subprojects {
   group "org.apache.lucene"
-}
\ No newline at end of file
+}
+
+distributions {
+  main {
+  // This is empirically wrong, but it is mostly a copy from `ant 
package-zip`

Review comment:
   Sure but you'll have to be patient - can't do it right away. 





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org



[GitHub] [lucene-solr] dweiss commented on a change in pull request #1905: LUCENE-9488 Release with Gradle Part 2

2020-09-21 Thread GitBox


dweiss commented on a change in pull request #1905:
URL: https://github.com/apache/lucene-solr/pull/1905#discussion_r492507019



##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?

Review comment:
   Yes, please move it to :lucene:packaging. It makes things much cleaner 
in the long run.

##
File path: lucene/build.gradle
##
@@ -15,8 +15,56 @@
  * limitations under the License.
  */
 
+// Should we do this as :lucene:packaging similar to how Solr does it?
+// Or is this fine here?
+
+plugins {
+  id 'distribution'
+}
+
 description = 'Parent project for Apache Lucene Core'
 
 subprojects {
   group "org.apache.lucene"
-}
\ No newline at end of file
+}
+
+distributions {
+  main {
+  // This is empirically wrong, but it is mostly a copy from `ant 
package-zip`

Review comment:
   This is wrong. It should rely on published artifacts from other 
subprojects (set up proper dependencies) and assemble them in the right way 
into the distribution layout.





This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



-
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org