Пример #1
0
        public void CompileWithMxmlc(string workingdir, string arguments, bool configChanged)
        {
            if (fcsh != null)
            {
                string   output;
                string[] errors;
                string[] warnings;
                string   jar    = ascshPath != null ? ascshPath : fcshPath;
                string   jvmarg = VMARGS + " -Dapplication.home=\"" + sdkPath
                                  //+ "\" -Dflexlib=\"" + Path.Combine(sdkPath, "frameworks")
                                  + "\" -jar \"" + jar + "\"";
                fcsh.Compile(workingdir, configChanged, arguments, out output, out errors, out warnings, jvmarg, JvmConfigHelper.GetJavaEXE(jvmConfig, sdkPath));

                string[] lines = output.Split('\n');
                foreach (string line in lines)
                {
                    if (!line.StartsWith("Recompile:", StringComparison.Ordinal) && !line.StartsWith("Reason:", StringComparison.Ordinal))
                    {
                        Console.Write(line);
                    }
                }
                foreach (string warning in warnings)
                {
                    Console.Error.WriteLine(warning);
                }
                foreach (string error in errors)
                {
                    Console.Error.WriteLine(error);
                }

                if (errors.Length > 0)
                {
                    throw new BuildException("Build halted with errors (fcsh).");
                }
            }
            else
            {
                string jar     = asc2Mode ? asc2Path : mxmlcPath;
                string javaExe = JvmConfigHelper.GetJavaEXE(jvmConfig, sdkPath);
                Console.WriteLine("Running java as: " + javaExe);
                string jvmarg = VMARGS + " -jar \"" + jar + "\" +flexlib=\"" + Path.Combine(sdkPath, "frameworks") + "\" ";
                if (!ProcessRunner.Run(javaExe, jvmarg + arguments, false, asc2Mode))
                {
                    throw new BuildException("Build halted with errors (" + (asc2Mode ? "mxmlc-cli" : "mxmlc") + ").");
                }
            }
        }
        public void CompileWithMxmlc(string workingdir, string arguments, bool configChanged)
        {
            if (fcsh != null)
            {
                string   output;
                string[] errors;
                string[] warnings;
                string   jvmarg = VMARGS + " -Dapplication.home=\"" + sdkPath + "\" -jar \"" + fcshPath + "\"";
                fcsh.Compile(workingdir, configChanged, arguments, out output, out errors, out warnings, jvmarg);

                string[] lines = output.Split('\n');
                foreach (string line in lines)
                {
                    if (!line.StartsWith("Recompile:") && !line.StartsWith("Reason:"))
                    {
                        Console.Write(line);
                    }
                }
                foreach (string warning in warnings)
                {
                    Console.Error.WriteLine(warning);
                }
                foreach (string error in errors)
                {
                    Console.Error.WriteLine(error);
                }

                if (errors.Length > 0)
                {
                    throw new BuildException("Build halted with errors (fcsh).");
                }
            }
            else
            {
                string jvmarg = VMARGS + " -jar \"" + mxmlcPath + "\" +flexlib=\"" + Path.Combine(sdkPath, "frameworks") + "\" ";
                if (!ProcessRunner.Run("java.exe", jvmarg + arguments, false))
                {
                    throw new BuildException("Build halted with errors (mxmlc).");
                }
            }
        }