zacharymorn commented on a change in pull request #2068:
URL: https://github.com/apache/lucene-solr/pull/2068#discussion_r523468450



##########
File path: gradle/native/disable-native.gradle
##########
@@ -17,20 +17,65 @@
 
 // This is the master switch to disable all tasks that compile
 // native (cpp) code.
-def buildNative = propertyOrDefault("build.native", true).toBoolean()
+rootProject.ext {
+  buildNative = propertyOrDefault("build.native", true).toBoolean()
+}
+
+// Explicitly list all projects that should be configured for native 
extensions.
+// We could scan for projects with a the cpp-library plugin but this is faster.
+def nativeProjects = allprojects.findAll {it.path in [
+    ":lucene:misc:native"
+]}
+
+def javaProjectsWithNativeDeps = allprojects.findAll {it.path in [
+    ":lucene:misc"
+]}
+
+// Set up defaults for projects with native dependencies.
+configure(javaProjectsWithNativeDeps, {
+  configurations {

Review comment:
       Wow thanks Dawid so much for the detailed and thorough explanations and 
pointers! I did come across some of these documentations individually before, 
but it's just that the combination of configuration + variant + sync + cpp 
confuses me quite a bit. But it's pretty clear now. Thanks again for your 
patience and guidance here!
   
   I do have a final question though. It seems at this point we should also be 
able to easily support packaging the compiled native code into misc jar package 
(and change to use the optimized variant of the build), to remove the final 
manual step to copy around the native library artifact for production usage of 
`WindowsDirectory` or `NativeUnixDirectory`? Do you think this is a good 
direction to be taken ?




----------------------------------------------------------------
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

Reply via email to