madrob commented on a change in pull request #1199: LUCENE-9134: Port 
ant-regenerate tasks to Gradle build
URL: https://github.com/apache/lucene-solr/pull/1199#discussion_r370858176
 
 

 ##########
 File path: lucene/core/build.gradle
 ##########
 @@ -1,7 +1,117 @@
-
 apply plugin: 'java-library'
+apply plugin: "de.undercouch.download"
 
 dependencies {
   testImplementation project(':lucene:codecs')
   testImplementation project(':lucene:test-framework')
 }
+
+def momanCommitHash = "5c5c2a1e4dea"
+def momanUrl = 
"https://bitbucket.org/jpbarrette/moman/get/${momanCommitHash}.zip";
+def python_exe = "python"
+
+def jflexUrl = "https://jflex.de/release/jflex-1.7.0.zip";
+
+// Download and extract Moman
+task installJFlex(type: Download) {
+  src jflexUrl
+  dest file("${buildDir}/jflex.zip")
+  onlyIfModified true
+  doLast {
+    ant.unzip(src: file("${buildDir}/jflex.zip"), dest: 
file("${buildDir}/jflex"), overwrite: "true") {
+      ant.cutdirsmapper(dirs: "1")
+    }
+  }
+}
+
+task installMoman(type: Download) {
+  src momanUrl
+  dest file("${buildDir}/moman.zip")
+  onlyIfModified true
+
+  doLast {
+    ant.unzip(src: file("${buildDir}/moman.zip"), dest: 
file("${buildDir}/moman"), overwrite: "true") {
+      ant.cutdirsmapper(dirs: "1")
+    }
+  }
+}
+
+task createPackedIntSources {
+  doLast {
+    exec {
+      workingDir 'src/java/org/apache/lucene/util/packed'
+      executable "${python_exe}"
+      args = ['-B', 'gen_BulkOperation.py']
+    }
+    exec {
+      workingDir 'src/java/org/apache/lucene/util/packed'
+      executable "${python_exe}"
+      args = ['-B', 'gen_Packed64SingleBlock.py']
+    }
+    ant.fixcrlf(srcdir: 'src/java/org/apache/lucene/util/packed', includes: 
'Packed64SingleBlock.java', encoding: 'UTF-8')
+    ant.fixcrlf(srcdir: 'src/java/org/apache/lucene/util/packed', includes: 
'BulkOperation*.java', encoding: 'UTF-8')
+  }
+}
+
+task createLevAutomaton(dependsOn: installMoman) {
+  doLast {
+    exec {
 
 Review comment:
   ```
   [1, 2].each { edits -> 
     [True, False].each { transpose ->
       exec {
         workingDir...
         executable...
         args = ['-B', createLevAutomata.py, edits, transpose]
       }
     }
   }
   ```

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

Reply via email to