コード例 #1
0
ファイル: Program.cs プロジェクト: thecocce/flashdevelop
 /// <summary>
 /// Build from command line
 /// </summary>
 /// <param name="projectFile"></param>
 /// <param name="options"></param>
 public static void Build(string projectFile, FDBuildOptions options)
 {
     Project project = ProjectLoader.Load(projectFile);
     project.TraceEnabled = !options.NoTrace;
     project.TargetBuild = options.TargetBuild;
     options.Language = project.Language.ToUpper();
     ProjectBuilder builder = ProjectBuilder.Create(project, options.IpcName, options.CompilerPath);
     builder.Build(options.ExtraClasspaths, options.NoTrace, options.NoPreBuild, options.NoPostBuild);
 }
コード例 #2
0
        /// <summary>
        /// Build from command line
        /// </summary>
        /// <param name="projectFile"></param>
        /// <param name="options"></param>
        public static void Build(string projectFile, FDBuildOptions options)
        {
            Project project = ProjectLoader.Load(projectFile);

            project.TraceEnabled = !options.NoTrace;
            options.Language     = project.Language.ToUpper();
            ProjectBuilder builder = ProjectBuilder.Create(project, options.IpcName, options.CompilerPath);

            builder.Build(options.ExtraClasspaths, options.NoTrace, options.NoPreBuild, options.NoPostBuild);
        }
コード例 #3
0
        public static int Main(string[] args)
        {
            FDBuildOptions options = new FDBuildOptions(args);

            // save current directory - ProjectBuilder might change it
            string directory = Environment.CurrentDirectory;

            // try and automagically figure out flashdevelop's library path
            // it should be at ..\..\Library
            try
            {
                string toolsDir   = Path.GetDirectoryName(PathHelper.ApplicationDirectory);
                string fdDir      = Path.GetDirectoryName(toolsDir);
                string libraryDir = Path.Combine(fdDir, "Library");
                if (Directory.Exists(libraryDir))
                {
                    options.ExtraClasspath = libraryDir;
                }
            }
            catch {}

            try
            {
                if (options.ProjectFile.Length > 0)
                {
                    Build(Path.GetFullPath(options.ProjectFile),
                          options.ExtraClasspaths, options.NoTrace);
                }
                else
                {
                    // build everything in this directory
                    string[] files = Directory.GetFiles(directory, "*.fdp");

                    if (files.Length == 0)
                    {
                        options.DoHelp();
                        return(0);
                    }

                    foreach (string file in files)
                    {
                        Build(file, options.ExtraClasspaths, options.NoTrace);
                    }
                }

                return(0);
            }
            catch (BuildException exception)
            {
                Console.Error.WriteLine(exception.Message);
                return(1);
            }
            catch (Exception exception)
            {
                Console.Error.WriteLine("Exception: " + exception.Message);
                return(1);
            }
            finally
            {
                Environment.CurrentDirectory = directory;

                if (options.PauseAtEnd)
                {
                    Console.WriteLine();
                    Console.WriteLine("Press enter to continue...");
                    Console.ReadLine();
                }
            }
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: heon21st/flashdevelop
        public static int Main(string[] args)
        {
            try { Console.OutputEncoding = Encoding.Default; }
            catch { /* WineMod: not supported */ }

            FDBuildOptions options = new FDBuildOptions(args);
            BuildOptions = new FDBuildOptions(args);

            // save current directory - ProjectBuilder might change it
            if (Path.IsPathRooted(options.ProjectFile))
                Environment.CurrentDirectory = Path.GetDirectoryName(options.ProjectFile);
            string directory = Environment.CurrentDirectory;
            string toolsDir = Path.GetDirectoryName(ProjectPaths.ApplicationDirectory);

            // try and automagically figure out flashdevelop's library path
            // it should be at ..\..\Library
            if (options.LibraryDir == null)
                try
                {
                    string firstRunDir = Path.GetDirectoryName(toolsDir);
                    string libraryDir = Path.Combine(firstRunDir, "Library");
                    if (Directory.Exists(libraryDir))
                        options.LibraryDir = libraryDir;
                }
                catch { }

            string swfmillPath = options.SwfmillPath ?? Path.Combine(toolsDir, "swfmill");
            if (File.Exists(Path.Combine(swfmillPath, "swfmill.exe")))
                SwfmillLibraryBuilder.ExecutablePath = Path.Combine(swfmillPath, "swfmill.exe");
            else
                SwfmillLibraryBuilder.ExecutablePath = "swfmill.exe"; // hope you have it in your environment path!

            try
            {
                if (options.ProjectFile.Length > 0)
                    Build(Path.GetFullPath(options.ProjectFile), options);
                else
                {
                    // build everything in this directory
                    string[] files = Directory.GetFiles(directory, "*.fdp");

                    if (files.Length == 0)
                    {
                        options.DoHelp();
                        return 0;
                    }

                    foreach (string file in files)
                        Build(file, options);
                }

                return 0;
            }
            catch (BuildException exception)
            {
                Console.Error.WriteLine(exception.Message);
                return 1;
            }
            catch (Exception exception)
            {
                Console.Error.WriteLine("Exception: " + exception.Message);
                return 1;
            }
            finally
            {
                Environment.CurrentDirectory = directory;

                if (options.PauseAtEnd)
                {
                    Console.WriteLine();
                    Console.WriteLine("Press enter to continue...");
                    Console.ReadLine();
                }
            }
        }
コード例 #5
0
        public static int Main(string[] args)
        {
            try { Console.OutputEncoding = Encoding.Default; }
            catch { /* WineMod: not supported */ }

            FDBuildOptions options = new FDBuildOptions(args);

            BuildOptions = new FDBuildOptions(args);

            // save current directory - ProjectBuilder might change it
            if (Path.IsPathRooted(options.ProjectFile))
            {
                Environment.CurrentDirectory = Path.GetDirectoryName(options.ProjectFile);
            }
            string directory   = Environment.CurrentDirectory;
            string toolsDir    = Path.GetDirectoryName(ProjectPaths.ApplicationDirectory);
            string firstRunDir = Path.GetDirectoryName(toolsDir);

            // try and automagically figure out flashdevelop's library path
            // it should be at ..\..\Library
            if (options.LibraryDir == null)
            {
                try
                {
                    string libraryDir = Path.Combine(firstRunDir, "Library");
                    if (Directory.Exists(libraryDir))
                    {
                        options.LibraryDir = libraryDir;
                    }
                }
                catch { }
            }

            string swfmillPath = options.SwfmillPath ?? Path.Combine(toolsDir, "swfmill");

            if (File.Exists(Path.Combine(swfmillPath, "swfmill.exe")))
            {
                SwfmillLibraryBuilder.ExecutablePath = Path.Combine(swfmillPath, "swfmill.exe");
            }
            else
            {
                SwfmillLibraryBuilder.ExecutablePath = "swfmill.exe"; // hope you have it in your environment path!
            }
            // figure user settings PlatformData
            string platformsFile = Path.Combine("Settings", "Platforms");

            if (File.Exists(Path.Combine(firstRunDir, ".local")))
            {
                PluginCore.PlatformData.Load(Path.Combine(firstRunDir, platformsFile));
            }
            else
            {
                string userAppDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
                string fdDir      = Path.Combine(userAppDir, "FlashDevelop");
                PluginCore.PlatformData.Load(Path.Combine(fdDir, platformsFile));
            }

            try
            {
                if (options.ProjectFile.Length > 0)
                {
                    Build(Path.GetFullPath(options.ProjectFile), options);
                }
                else
                {
                    // build everything in this directory
                    string[] files = Directory.GetFiles(directory, "*.fdp");

                    if (files.Length == 0)
                    {
                        options.DoHelp();
                        return(0);
                    }

                    foreach (string file in files)
                    {
                        Build(file, options);
                    }
                }

                return(0);
            }
            catch (BuildException exception)
            {
                Console.Error.WriteLine(exception.Message);
                return(1);
            }
            catch (Exception exception)
            {
                Console.Error.WriteLine("Exception: " + exception.Message);
                return(1);
            }
            finally
            {
                Environment.CurrentDirectory = directory;

                if (options.PauseAtEnd)
                {
                    Console.WriteLine();
                    Console.WriteLine("Press enter to continue...");
                    Console.ReadLine();
                }
            }
        }
コード例 #6
0
        public static int Run(string[] args)
        {
            FDBuildOptions options = new FDBuildOptions(args);

            // save current directory - ProjectBuilder might change it
            string directory = Environment.CurrentDirectory;

            // try and automagically figure out flashdevelop's library path
            // it should be at ..\..\Library
            try
            {
                string toolsDir = Path.GetDirectoryName(ProjectPaths.ApplicationDirectory);
                string firstRunDir = Path.GetDirectoryName(toolsDir);
                string libraryDir = Path.Combine(firstRunDir, "Library");
                string as2LibraryDir = Path.Combine(libraryDir, "AS2");
                if (Directory.Exists(as2LibraryDir))
                    options.ExtraClasspath = as2LibraryDir;
            }
            catch { }

            try
            {
                if (options.ProjectFile.Length > 0)
                    Build(Path.GetFullPath(options.ProjectFile),
                        options.ExtraClasspaths, options.NoTrace);
                else
                {
                    // build everything in this directory
                    string[] files = Directory.GetFiles(directory, "*.fdp");

                    if (files.Length == 0)
                    {
                        options.DoHelp();
                        return 0;
                    }

                    foreach (string file in files)
                        Build(file, options.ExtraClasspaths, options.NoTrace);
                }

                return 0;
            }
            catch (BuildException exception)
            {
                Console.Error.WriteLine(exception.Message);
                return 1;
            }
            catch (Exception exception)
            {
                Console.Error.WriteLine("Exception: " + exception.Message);
                return 1;
            }
            finally
            {
                Environment.CurrentDirectory = directory;

                if (options.PauseAtEnd)
                {
                    Console.WriteLine();
                    Console.WriteLine("Press enter to continue...");
                    Console.ReadLine();
                }
            }
        }