Exemplo n.º 1
0
        public CompilationJob(ICompilerOutput output, CompilerOutput outputLanguage, IReadOnlyList <FileInfo> inputFiles,
                              string projectName = null, bool generateSourceMaps = false)
        {
            if (!inputFiles.Any())
            {
                throw new ArgumentException("Must supply at least one input file", nameof(inputFiles));
            }

            Output             = output;
            InputFiles         = inputFiles;
            ProjectName        = projectName ?? Path.GetFileNameWithoutExtension(inputFiles[0].FullName);
            LocationResolver   = new DefaultLocationResolver();
            Handler            = new DefaultTranslationErrorHandler(LocationResolver);
            Backend            = TargetLanguage.GetCodeGenerator(outputLanguage);
            GenerateSourceMaps = generateSourceMaps;
        }
Exemplo n.º 2
0
        public CompilationJob(ICompilerOutput output, DirectoryInfo outputDir, CompilerOutput outputLanguage, IReadOnlyList <FileInfo> inputFiles,
                              string projectName, DirectoryInfo projectRoot = null, bool generateSourceMaps = false, IReadOnlyList <string> projectDependencies = null,
                              DirectoryInfo aspectjOutputDir = null)
        {
            if (!inputFiles.Any())
            {
                throw new ArgumentException("Must supply at least one input file", nameof(inputFiles));
            }

            Output                 = output;
            OutputDirectory        = outputDir;
            AspectjOutputDirectory = aspectjOutputDir;
            InputFiles             = inputFiles;
            ProjectName            = projectName ?? Path.GetFileNameWithoutExtension(inputFiles[0].FullName);
            ProjectRootPath        = projectRoot;
            LocationResolver       = new DefaultLocationResolver();
            Handler                = new DefaultTranslationErrorHandler(LocationResolver);
            OutputLanguage         = outputLanguage;
            Backend                = TargetLanguage.GetCodeGenerator(outputLanguage);
            GenerateSourceMaps     = generateSourceMaps;
            ProjectDependencies    = projectDependencies ?? new List <string>();
        }