This class implements a bootstrap which is capable to build an environment which is capable of building SquirrelJME target binaries. You should only compile and run this class manually if your system is not able to use the pre-existing build scripts. If this is the case then you must set the follow
| 64 | * @since 2016/10/26 |
| 65 | */ |
| 66 | public class NewBootstrap |
| 67 | implements Runnable |
| 68 | { |
| 69 | /** Deletes files. */ |
| 70 | public static final Consumer<Path, Object, IOException> DELETE = |
| 71 | new Consumer<Path, Object, IOException>() |
| 72 | { |
| 73 | /** |
| 74 | * {@inheritDoc} |
| 75 | * @since 2016/10/27 |
| 76 | */ |
| 77 | @Override |
| 78 | public void accept(Path __v, Object __s) |
| 79 | throws IOException |
| 80 | { |
| 81 | Files.delete(__v); |
| 82 | } |
| 83 | }; |
| 84 | |
| 85 | /** Returns the latest date. */ |
| 86 | public static final Consumer<Path, Long[], IOException> DATE = |
| 87 | new Consumer<Path, Long[], IOException>() |
| 88 | { |
| 89 | /** |
| 90 | * {@inheritDoc} |
| 91 | * @since 2016/10/27 |
| 92 | */ |
| 93 | @Override |
| 94 | public void accept(Path __v, Long[] __s) |
| 95 | throws IOException |
| 96 | { |
| 97 | // Dates on directories might not truly be valid |
| 98 | if (Files.isDirectory(__v)) |
| 99 | return; |
| 100 | |
| 101 | // Get date |
| 102 | FileTime ft = Files.getLastModifiedTime(__v); |
| 103 | long millis = ft.toMillis(); |
| 104 | |
| 105 | // If it is newer, use that |
| 106 | if (millis > __s[0]) |
| 107 | __s[0] = millis; |
| 108 | } |
| 109 | }; |
| 110 | |
| 111 | /** Cache of the compiler so it does not need to be read multiple times. */ |
| 112 | private static volatile JavaCompiler _javac; |
| 113 | |
| 114 | /** The binary path. */ |
| 115 | protected final Path binarypath; |
| 116 | |
| 117 | /** The source path. */ |
| 118 | protected final Path sourcepath; |
| 119 | |
| 120 | /** The input launch arguments. */ |
| 121 | protected final String[] launchargs; |
| 122 | |
| 123 | /** Projects available for usage. */ |
nothing calls this directly
no outgoing calls
no test coverage detected