mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2024-11-30 07:28:26 +01:00
DroidFish, CuckooChessEngine: Don't fork when building book files.
This makes the build work even if "java" is not in the path.
This commit is contained in:
parent
1b35f9590e
commit
6996bead09
|
@ -2,8 +2,9 @@
|
|||
<project default="build_binbook" name="Build assets/eco.dat">
|
||||
<target name="build_binbook">
|
||||
<java classpath="bin"
|
||||
classname="chess.Book"
|
||||
fork="yes">
|
||||
classname="chess.Book">
|
||||
<arg value="${basedir}/src/book.txt"/>
|
||||
<arg value="${basedir}/src/book.bin"/>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
package chess;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -188,8 +189,10 @@ public class Book {
|
|||
|
||||
/** Creates the book.bin file. */
|
||||
public static void main(String[] args) throws IOException {
|
||||
List<Byte> binBook = createBinBook();
|
||||
FileOutputStream out = new FileOutputStream("src/book.bin");
|
||||
String inFile = args[0];
|
||||
String outFile = args[1];
|
||||
List<Byte> binBook = createBinBook(inFile);
|
||||
FileOutputStream out = new FileOutputStream(outFile);
|
||||
int bookLen = binBook.size();
|
||||
byte[] binBookA = new byte[bookLen];
|
||||
for (int i = 0; i < bookLen; i++)
|
||||
|
@ -197,11 +200,11 @@ public class Book {
|
|||
out.write(binBookA);
|
||||
out.close();
|
||||
}
|
||||
|
||||
public static List<Byte> createBinBook() {
|
||||
|
||||
public static List<Byte> createBinBook(String inFileName) {
|
||||
List<Byte> binBook = new ArrayList<Byte>(0);
|
||||
try {
|
||||
InputStream inStream = new Object().getClass().getResourceAsStream("/book.txt");
|
||||
InputStream inStream = new FileInputStream(inFileName);
|
||||
InputStreamReader inFile = new InputStreamReader(inStream);
|
||||
BufferedReader inBuf = new BufferedReader(inFile);
|
||||
LineNumberReader lnr = new LineNumberReader(inBuf);
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
<project default="build_eco" name="Build assets/eco.dat">
|
||||
<target name="build_eco">
|
||||
<java classpath="bin/classes"
|
||||
classname="org.petero.droidfish.buildtools.EcoBuilder"
|
||||
fork="yes">
|
||||
<arg value="src/org/petero/droidfish/buildtools/eco.pgn"/>
|
||||
<arg value="assets/eco.dat"/>
|
||||
classname="org.petero.droidfish.buildtools.EcoBuilder">
|
||||
<arg value="${basedir}/src/org/petero/droidfish/buildtools/eco.pgn"/>
|
||||
<arg value="${basedir}/assets/eco.dat"/>
|
||||
</java>
|
||||
</target>
|
||||
</project>
|
||||
|
|
Loading…
Reference in New Issue
Block a user