Ejemplo n.º 1
0
        public static async Task <CompilerResult> CallServiceAsync(string path, bool reattempt = false)
        {
            await Up();

            if (_server != null)
            {
                return(await _server.CallService(path, reattempt));
            }
            else
            {
                return(CompilerResult.GenerateResult(path, "", "", false, "Unable to start node", "", null, false));
            }
        }
Ejemplo n.º 2
0
        public async static Task <CompilerResult> GenerateResult(string sourceFileName, string targetFileName, string mapFileName, bool isSuccess, string result, string resultMap, IEnumerable <CompilerError> errors, bool hasResult = false, string rtlSourceFileName = "", string rtlTargetFileName = "", string rtlMapFileName = "", string rtlResult = "", string rtlResultMap = "")
        {
            CompilerResult instance;

            mapFileName = mapFileName ?? targetFileName + ".map";

            if (result == null && File.Exists(targetFileName))
            {
                result = await FileHelpers.ReadAllTextRetry(targetFileName);
            }

            if (targetFileName != null && Path.GetExtension(targetFileName).Equals(".css", StringComparison.OrdinalIgnoreCase))
            {
                instance = CssCompilerResult.GenerateResult(sourceFileName, targetFileName, mapFileName, isSuccess, result, resultMap, errors, rtlSourceFileName, rtlTargetFileName, rtlMapFileName, rtlResult, rtlResultMap, hasResult);
            }
            else
            {
                instance = CompilerResult.GenerateResult(sourceFileName, targetFileName, mapFileName, isSuccess, result, resultMap, errors, hasResult);
            }

            return(instance);
        }