예제 #1
0
        public async static Task <CssCompilerResult> GenerateResult(string sourceFileName, string targetFileName, string mapFileName, bool isSuccess, string result, IEnumerable <CompilerError> errors)
        {
            CssCompilerResult compilerResult = new CssCompilerResult(sourceFileName, targetFileName, isSuccess, result, errors);

            if (mapFileName == null)
            {
                return(null);
            }

            var extension = Path.GetExtension(sourceFileName).TrimStart('.');

            compilerResult.SourceMap = CssSourceMap.Create(await FileHelpers.ReadAllTextRetry(targetFileName),
                                                           await FileHelpers.ReadAllTextRetry(mapFileName),
                                                           Path.GetDirectoryName(targetFileName),
                                                           Mef.GetContentType(extension));

            return(compilerResult);
        }
예제 #2
0
        public static CssCompilerResult GenerateResult(string sourceFileName, string targetFileName, string mapFileName, bool isSuccess, string result, string resultMap, IEnumerable <CompilerError> errors, string rtlSourceFileName, string rtlTargetFileName, string rtlMapFileName, string rtlResult, string rtlResultMap, bool hasSkipped = false)
        {
            CssCompilerResult compilerResult = new CssCompilerResult(sourceFileName, targetFileName, mapFileName, isSuccess, result, resultMap, errors, hasSkipped, rtlSourceFileName, rtlTargetFileName, rtlMapFileName, rtlResult, rtlResultMap);

            if (mapFileName == null)
            {
                return(compilerResult);
            }

            string extension = Path.GetExtension(sourceFileName).TrimStart('.');

            compilerResult.SourceMap = CssSourceMap.Create(result, resultMap, Path.GetDirectoryName(targetFileName), Mef.GetContentType(extension));

            return(compilerResult);
        }