You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/02/11 15:18:08 UTC

[GitHub] [lucene-solr] ErickErickson opened a new pull request #1251: LUCENE-9134: Port ant-regenerate tasks to Gradle build (util and packed)

ErickErickson opened a new pull request #1251: LUCENE-9134: Port ant-regenerate tasks to Gradle build (util and packed)
URL: https://github.com/apache/lucene-solr/pull/1251
 
 
   This should be the final patch. It turned out to be a 5 minute task to put the hard-coded path in the Ant build so I did that too.
   
   I'll commit in a few and close this JIRA.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] ErickErickson commented on a change in pull request #1251: LUCENE-9134: Port ant-regenerate tasks to Gradle build (util and packed)

Posted by GitBox <gi...@apache.org>.
ErickErickson commented on a change in pull request #1251: LUCENE-9134: Port ant-regenerate tasks to Gradle build (util and packed)
URL: https://github.com/apache/lucene-solr/pull/1251#discussion_r377712392
 
 

 ##########
 File path: gradle/generation/util.gradle
 ##########
 @@ -0,0 +1,100 @@
+/*
+ * 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
+  }
+
+  task utilgen {
+    description "Regenerate sources for ...lucene/util/automaton and ...lucene/util/packed."
+    group "generation"
+
+    dependsOn ":lucene:core:utilGenPacked"
+    dependsOn ":lucene:core:utilGenLev"
+  }
+}
+
+def momanDir = new File(buildDir, "moman").getAbsolutePath()
+task installMoman(type: Download) {
+
+  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.
+      project.ant.fixcrlf(
+          srcDir: workDir,
+          includes: 'Packed64SingleBlock.java, BulkOperation*.java',
+          encoding: 'UTF-8',
+          eol: 'lf'
+      )
+    }
+  }
+
+  task utilGenLev(dependsOn: installMoman) {
+    description "Regenerate util/automaton Lev*ParametricDescription.java"
+    group "generation"
+
+    doLast {
+      def workDir = 'src/java/org/apache/lucene/util/automaton'
+
+      ['1', '2'].each { num ->
+        ['True', 'False'].each { transpose ->
+          project.exec {
+            workingDir workDir
+            executable "python"
+            args = ['-B', 'createLevAutomata.py', num, transpose, "${momanDir}/finenight/python"]
+          }
+        }
+      }
+      project.ant.fixcrlf(
+          srcDir: workDir,
+          includes: '*ParametricDescription.java',
+          encoding: 'UTF-8',
+          eol: 'lf'
+      )
+    }
+  }
+}
 
 Review comment:
   I'll put this lf in

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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


[GitHub] [lucene-solr] ErickErickson merged pull request #1251: LUCENE-9134: Port ant-regenerate tasks to Gradle build (util and packed)

Posted by GitBox <gi...@apache.org>.
ErickErickson merged pull request #1251: LUCENE-9134: Port ant-regenerate tasks to Gradle build (util and packed)
URL: https://github.com/apache/lucene-solr/pull/1251
 
 
   

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

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