[GitHub] [lucene-solr] ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port ant-regenerate tasks to Gradle build

2020-02-11 Thread GitBox
ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port 
ant-regenerate tasks to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1248#discussion_r377627813
 
 

 ##
 File path: 
lucene/core/src/java/org/apache/lucene/util/automaton/createLevAutomata.py
 ##
 @@ -22,7 +22,7 @@
 import os
 import sys
 # sys.path.insert(0, 'moman/finenight/python')
-sys.path.insert(0, '../../../../../../../../build/core/moman/finenight/python')
+sys.path.insert(0, '../../../../../../../../../build/moman/finenight/python')
 
 Review comment:
   Dawid:
   
   Yeah, I wondered about that. But please don't make me run the whole 
regenerate task in ant ;).
   
   I'll change this to take an argument and get it working in Gradle, and leave 
a comment in the Ant build file about using Gradle.


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


With regards,
Apache Git Services

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



[GitHub] [lucene-solr] ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port ant-regenerate tasks to Gradle build

2020-02-11 Thread GitBox
ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port 
ant-regenerate tasks to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1248#discussion_r377627813
 
 

 ##
 File path: 
lucene/core/src/java/org/apache/lucene/util/automaton/createLevAutomata.py
 ##
 @@ -22,7 +22,7 @@
 import os
 import sys
 # sys.path.insert(0, 'moman/finenight/python')
-sys.path.insert(0, '../../../../../../../../build/core/moman/finenight/python')
+sys.path.insert(0, '../../../../../../../../../build/moman/finenight/python')
 
 Review comment:
   Dawid:
   
   Yeah, I wondered about that. But please don't make me run the whole 
regenerate task in ant ;).
   
   I'll change this to take an argument and get it working in Gradle, and leave 
a comment in the python code about having to change things a bit if running 
from Ant.


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


With regards,
Apache Git Services

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



[GitHub] [lucene-solr] ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port ant-regenerate tasks to Gradle build

2020-02-11 Thread GitBox
ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port 
ant-regenerate tasks to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1248#discussion_r377624894
 
 

 ##
 File path: gradle/generation/util.gradle
 ##
 @@ -0,0 +1,102 @@
+/*
+ * 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.
+ */
+apply plugin: "de.undercouch.download"
+
+configure(rootProject) {
+  configurations {
+utilgen
+  }
+
+  dependencies {
 
 Review comment:
   Yeah, I'll nuke that.


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


With regards,
Apache Git Services

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



[GitHub] [lucene-solr] ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port ant-regenerate tasks to Gradle build

2020-02-10 Thread GitBox
ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port 
ant-regenerate tasks to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1248#discussion_r377376693
 
 

 ##
 File path: gradle/generation/util.gradle
 ##
 @@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+apply plugin: "de.undercouch.download"
+
+configure(rootProject) {
+  configurations {
+utilgen
+  }
+
+  dependencies {
+  }
+
+  task utilgen {
+description "Regenerate sources for ...lucene/util/automaton and 
...lucene/util/packed."
+group "generation"
+
+dependsOn ":lucene:core:utilGenPacked"
+dependsOn ":lucene:core:utilGenLev"
+  }
+}
+
+
+task installMoman(type: Download) {
+  def momanDir = new File(buildDir, "moman").getAbsolutePath()
+  def momanZip = new File(momanDir, "moman.zip").getAbsolutePath()
+
+  src "https://bitbucket.org/jpbarrette/moman/get/5c5c2a1e4dea.zip;
+  dest momanZip
+  onlyIfModified true
+
+  doLast {
+logger.lifecycle("Downloading moman to: ${buildDir}")
+ant.unzip(src: momanZip, dest: momanDir, overwrite: "true") {
+  ant.cutdirsmapper(dirs: "1")
+}
+  }
+}
+
+configure(project(":lucene:core")) {
+  task utilGenPacked(dependsOn: installMoman) {
+description "Regenerate util/PackedBulkOperationsPacked*.java and 
Packed64SingleBlock.java"
+group "generation"
+
+def workDir = "src/java/org/apache/lucene/util/packed"
+
+doLast {
+  ['gen_BulkOperation.py', 'gen_Packed64SingleBlock.py'].each { prog ->
+logger.lifecycle("Executing: ${prog} in ${workDir}")
+project.exec {
+  workingDir workDir
+  executable "python"
+  args = ['-B', "${prog}"]
+}
+  }
+  // Correct line endings for Windows.
+  ['Packed64SingleBlock.java', 'BulkOperation*.java'].each { files ->
 
 Review comment:
   True, I'll  change it.


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


With regards,
Apache Git Services

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



[GitHub] [lucene-solr] ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port ant-regenerate tasks to Gradle build

2020-02-10 Thread GitBox
ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port 
ant-regenerate tasks to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1248#discussion_r377374590
 
 

 ##
 File path: gradle/generation/util.gradle
 ##
 @@ -0,0 +1,107 @@
+/*
+ * 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.
+ */
+apply plugin: "de.undercouch.download"
+
+configure(rootProject) {
+  configurations {
+utilgen
+  }
+
+  dependencies {
+  }
+
+  task utilgen {
+description "Regenerate sources for ...lucene/util/automaton and 
...lucene/util/packed."
+group "generation"
+
+dependsOn ":lucene:core:utilGenPacked"
+dependsOn ":lucene:core:utilGenLev"
+  }
+}
+
+
+task installMoman(type: Download) {
+  def momanDir = new File(buildDir, "moman").getAbsolutePath()
+  def momanZip = new File(momanDir, "moman.zip").getAbsolutePath()
+
+  src "https://bitbucket.org/jpbarrette/moman/get/5c5c2a1e4dea.zip;
+  dest momanZip
+  onlyIfModified true
+
+  doLast {
+logger.lifecycle("Downloading moman to: ${buildDir}")
+ant.unzip(src: momanZip, dest: momanDir, overwrite: "true") {
+  ant.cutdirsmapper(dirs: "1")
+}
+  }
+}
+
+configure(project(":lucene:core")) {
+  task utilGenPacked(dependsOn: installMoman) {
+description "Regenerate util/PackedBulkOperationsPacked*.java and 
Packed64SingleBlock.java"
+group "generation"
+
+def workDir = "src/java/org/apache/lucene/util/packed"
+
+doLast {
+  ['gen_BulkOperation.py', 'gen_Packed64SingleBlock.py'].each { prog ->
+logger.lifecycle("Executing: ${prog} in ${workDir}")
+project.exec {
+  workingDir workDir
+  executable "python"
+  args = ['-B', "${prog}"]
+}
+  }
+  // Correct line endings for Windows.
+  ['Packed64SingleBlock.java', 'BulkOperation*.java'].each { files ->
+project.ant.fixcrlf(
+srcDir: workDir,
+includes: files,
+encoding: 'UTF-8',
+eol: 'lf'
+)
+  }
+}
+  }
+}
+
+configure(project(":lucene:core")) {
 
 Review comment:
   Good point, done.


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


With regards,
Apache Git Services

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



[GitHub] [lucene-solr] ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port ant-regenerate tasks to Gradle build

2020-02-10 Thread GitBox
ErickErickson commented on a change in pull request #1248: LUCENE-9134: Port 
ant-regenerate tasks to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1248#discussion_r377369604
 
 

 ##
 File path: 
lucene/core/src/java/org/apache/lucene/util/automaton/createLevAutomata.py
 ##
 @@ -22,7 +22,7 @@
 import os
 import sys
 # sys.path.insert(0, 'moman/finenight/python')
-sys.path.insert(0, '../../../../../../../../build/core/moman/finenight/python')
+sys.path.insert(0, '../../../../../../../../../build/moman/finenight/python')
 
 Review comment:
   Yeah. I'm pretty sure it does break the ant regenerate. Since the whole 
regenerate process is apparently run extremely rarely (like every couple of 
years or so from what I can tell), I think we'll be on gradle exclusively the 
next time this is run.


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


With regards,
Apache Git Services

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