MCPcopy Create free account
hub / github.com/Whiley/WhileyCompiler / main

Method main

src/main/java/wyc/Compiler.java:162–184  ·  view source on GitHub ↗
(String[] _args)

Source from the content-addressed store, hash-verified

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());

Callers

nothing calls this directly

Calls 13

parseOptionsMethod · 0.95
fromStringMethod · 0.95
addSourceMethod · 0.95
fromNativeStringMethod · 0.95
runMethod · 0.95
setWhileyDirMethod · 0.80
getMethod · 0.65
replaceMethod · 0.65
setWhileyPathMethod · 0.45
setWyilDirMethod · 0.45
setLinkingMethod · 0.45
setStrictMethod · 0.45

Tested by

no test coverage detected