(String[] _args)
| 160 | }; |
| 161 | // |
| 162 | public static void main(String[] _args) throws IOException { |
| 163 | List<String> args = new ArrayList<>(Arrays.asList(_args)); |
| 164 | Map<String, Object> options = OptArg.parseOptions(args, OPTIONS); |
| 165 | // Extract config options |
| 166 | boolean strict = options.containsKey("strict"); |
| 167 | boolean linking = options.containsKey("linking"); |
| 168 | File whileydir = (File) options.get("whileydir"); |
| 169 | File wyildir = (File) options.get("wyildir"); |
| 170 | Trie target = Trie.fromString((String) options.get("output")); |
| 171 | ArrayList<File> whileypath = (ArrayList<File>) options.get("whileypath"); |
| 172 | // Construct Main object |
| 173 | Compiler main = new Compiler().setTarget(target).setStrict(strict).setLinking(linking).setWhileyDir(whileydir) |
| 174 | .setWyilDir(wyildir).setWhileyPath(whileypath); |
| 175 | // |
| 176 | for(String arg : args) { |
| 177 | arg = arg.replace(".whiley", ""); |
| 178 | main.addSource(Trie.fromNativeString(arg)); |
| 179 | } |
| 180 | // Compile Whiley source file(s). |
| 181 | boolean result = main.run(); |
| 182 | // Produce exit code |
| 183 | System.exit(result ? 0 : 1); |
| 184 | } |
| 185 | |
| 186 | public static void extractDependencies(File dep, List<WyilFile> dependencies) throws IOException { |
| 187 | String suffix = getSuffix(dep.getName()); |
nothing calls this directly
no test coverage detected