@Provides @KompiledDir File definition(@DefinitionDir File defDir, KExceptionManager kem) { File directory = null; File[] dirs = defDir.listFiles(new FilenameFilter() { @Override public boolean accept(File current, String name) { return new File(current, name).isDirectory(); } }); for (int i = 0; i < dirs.length; i++) { if (dirs[i].getAbsolutePath().endsWith("-kompiled")) { if (directory != null) { throw KEMException.criticalError("Multiple compiled definitions found in the " + "current working directory: " + directory.getAbsolutePath() + " and " + dirs[i].getAbsolutePath()); } else { directory = dirs[i]; } } } if (directory == null) { throw KEMException.criticalError("Could not find a compiled definition. " + "Use --directory to specify one."); } if (!directory.isDirectory()) { throw KEMException.criticalError("Does not exist or not a directory: " + directory.getAbsolutePath()); } return directory; }
@Inject public FileUtil( @TempDir File tempDir, @DefinitionDir @Nullable Provider<File> definitionDir, @WorkingDir File workingDir, @KompiledDir @Nullable Provider<File> kompiledDir, GlobalOptions options, @Environment Map<String, String> env) { this.tempDir = tempDir; this.definitionDir = definitionDir; this.workingDir = workingDir; this.kompiledDir = kompiledDir; this.options = options; this.env = env; }
@Provides @KompiledDir File kompiledDir(@DefinitionDir File defDir, OuterParsingOptions options, @WorkingDir File workingDir, @TempDir File tempDir) { // bootstrap the part of FileUtil we need return new File(defDir, FilenameUtils.removeExtension(options.mainDefinitionFile(new FileUtil(null, null, workingDir, null, null, null)).getName()) + "-kompiled"); } }
@Inject KProveFrontEnd( GlobalOptions options, @JCommanderModule.Usage String usage, @JCommanderModule.ExperimentalUsage String experimentalUsage, JarInfo jarInfo, DefinitionScope scope, @KompiledDir Provider<File> kompiledDir, KExceptionManager kem, KProveOptions kproveOptions, FileUtil files, Provider<CompiledDefinition> compiledDef, Provider<Backend> backend, Provider<Function<org.kframework.definition.Module, Rewriter>> initializeRewriter, TTYInfo tty, Stopwatch sw) { super(kem, options, usage, experimentalUsage, jarInfo, files); this.scope = scope; this.kompiledDir = kompiledDir; this.kem = kem; this.kproveOptions = kproveOptions; this.files = files; this.compiledDef = compiledDef; this.backend = backend; this.initializeRewriter = initializeRewriter; this.tty = tty; this.sw = sw; }
@Inject KRunFrontEnd( GlobalOptions options, @Usage String usage, @ExperimentalUsage String experimentalUsage, JarInfo jarInfo, DefinitionScope scope, @KompiledDir Provider<File> kompiledDir, KExceptionManager kem, KRunOptions krunOptions, FileUtil files, Provider<CompiledDefinition> compiledDef, Provider<Function<org.kframework.definition.Module, Rewriter>> initializeRewriter, Provider<ExecutionMode> executionMode, TTYInfo tty) { super(kem, options, usage, experimentalUsage, jarInfo, files); this.scope = scope; this.kompiledDir = kompiledDir; this.kem = kem; this.krunOptions = krunOptions; this.files = files; this.compiledDef = compiledDef; this.initializeRewriter = initializeRewriter; this.executionMode = executionMode; this.tty = tty; }
@Inject KastFrontEnd( KastOptions options, @Usage String usage, @ExperimentalUsage String experimentalUsage, Stopwatch sw, KExceptionManager kem, JarInfo jarInfo, @Environment Map<String, String> env, FileUtil files, @KompiledDir Provider<File> kompiledDir, Provider<CompiledDefinition> compiledDef, DefinitionScope scope) { super(kem, options.global, usage, experimentalUsage, jarInfo, files); this.options = options; this.sw = sw; this.kem = kem; this.files = files; this.env = env; this.kompiledDir = kompiledDir; this.compiledDef = compiledDef; this.scope = scope; }