Ejemplo n.º 1
0
        public DProject()
        {
            referenceCollection = new DefaultDReferencesCollection (this);

            // HACK: gnome-terminal no longer supports --disable-factory
            // option which crashes MD. So we unset GNOME_DESKTOP_SESSION_ID
            // for current process. That forces MD to use xterm.
            Environment.SetEnvironmentVariable ("GNOME_DESKTOP_SESSION_ID", null, EnvironmentVariableTarget.Process);
        }
Ejemplo n.º 2
0
        public DProject()
        {
            referenceCollection = new DefaultDReferencesCollection(this);

            // HACK: gnome-terminal no longer supports --disable-factory
            // option which crashes MD. So we unset GNOME_DESKTOP_SESSION_ID
            // for current process. That forces MD to use xterm.
            Environment.SetEnvironmentVariable("GNOME_DESKTOP_SESSION_ID", null, EnvironmentVariableTarget.Process);
        }
Ejemplo n.º 3
0
        public DProject(ProjectCreateInformation info, XmlElement projectOptions)
        {
            referenceCollection = new DefaultDReferencesCollection(this);

            if (info != null)
            {
                Name = info.ProjectName;

                BaseDirectory = info.ProjectBasePath;

                if (info.BinPath != null)
                {
                    defaultBinPathStub = info.BinPath;
                }
            }

            var compTarget = DCompileTarget.Executable;

            var outputPrefix = "";

            if (projectOptions != null)
            {
                // Set project's target type to the one which has been defined in the project template
                if (projectOptions.Attributes["Target"] != null)
                {
                    compTarget = (DCompileTarget)Enum.Parse(
                        typeof(DCompileTarget),
                        projectOptions.Attributes["Target"].InnerText);
                }

                // Set project's compiler
                if (projectOptions.Attributes["Compiler"] != null)
                {
                    UsedCompilerVendor = projectOptions.Attributes["Compiler"].InnerText;
                }

                // Non Windows-OS require a 'lib' prefix as library name -- like libphobos2.a
                if (compTarget == DCompileTarget.StaticLibrary || compTarget == DCompileTarget.SharedLibrary && !OS.IsWindows)
                {
                    outputPrefix = "lib";
                }
            }

            var libs = new List <string> ();

            if (projectOptions != null)
            {
                foreach (XmlNode lib in projectOptions.GetElementsByTagName("Lib"))
                {
                    if (!string.IsNullOrWhiteSpace(lib.InnerText))
                    {
                        libs.Add(lib.InnerText);
                    }
                }
            }

            // Create a debug configuration
            var cfg = CreateConfiguration("Debug") as DProjectConfiguration;

            DefaultConfiguration = cfg;

            cfg.DebugMode = true;

            cfg.ExtraLibraries.AddRange(libs);
            cfg.CompileTarget   = compTarget;
            cfg.ExternalConsole = true;
            cfg.Output          = outputPrefix + Name;
            if (projectOptions != null)
            {
                // Set extra compiler&linker args
                if (projectOptions.Attributes ["CompilerArgs"].InnerText != null)
                {
                    cfg.ExtraCompilerArguments += projectOptions.Attributes ["CompilerArgs"].InnerText;
                }
                if (projectOptions.Attributes ["LinkerArgs"].InnerText != null)
                {
                    cfg.ExtraLinkerArguments += projectOptions.Attributes ["LinkerArgs"].InnerText;
                }

                if (projectOptions.GetAttribute("ExternalConsole") == "True")
                {
                    cfg.ExternalConsole    = true;
                    cfg.PauseConsoleOutput = true;
                }

                if (projectOptions.Attributes ["PauseConsoleOutput"] != null)
                {
                    cfg.PauseConsoleOutput = bool.Parse(
                        projectOptions.Attributes ["PauseConsoleOutput"].InnerText);
                }
            }

            Configurations.Add(cfg);

            // Create a release configuration
            cfg = CreateConfiguration("Release") as DProjectConfiguration;

            cfg.DebugMode = false;

            Configurations.Add(cfg);

            // Create unittest configuration
            var unittestConfig = CreateConfiguration("Unittest") as DProjectConfiguration;

            unittestConfig.DebugMode     = true;
            unittestConfig.UnittestMode  = true;
            unittestConfig.CompileTarget = DCompileTarget.Executable;

            Configurations.Add(unittestConfig);
        }
Ejemplo n.º 4
0
 public DProject()
 {
     referenceCollection = new DefaultDReferencesCollection(this);
 }
Ejemplo n.º 5
0
        public DProject(ProjectCreateInformation info, XmlElement projectOptions)
        {
            referenceCollection = new DefaultDReferencesCollection (this);

            if (info != null) {
                Name = info.ProjectName;

                BaseDirectory = info.ProjectBasePath;

                if (info.BinPath != null)
                    defaultBinPathStub = info.BinPath;
            }

            var compTarget = DCompileTarget.Executable;

            var outputPrefix = "";

            if (projectOptions != null)
            {
                // Set project's target type to the one which has been defined in the project template
                if (projectOptions.Attributes["Target"] != null)
                    compTarget = (DCompileTarget)Enum.Parse(
                        typeof(DCompileTarget),
                        projectOptions.Attributes["Target"].InnerText);

                // Set project's compiler
                if (projectOptions.Attributes["Compiler"] != null)
                    UsedCompilerVendor = projectOptions.Attributes["Compiler"].InnerText;

                // Non Windows-OS require a 'lib' prefix as library name -- like libphobos2.a
                if (compTarget == DCompileTarget.StaticLibrary || compTarget == DCompileTarget.SharedLibrary && !OS.IsWindows)
                {
                    outputPrefix = "lib";
                }
            }

            var libs = new List<string> ();
            if (projectOptions != null) {
                foreach (XmlNode lib in projectOptions.GetElementsByTagName("Lib"))
                    if (!string.IsNullOrWhiteSpace (lib.InnerText))
                        libs.Add (lib.InnerText);
            }

            // Create a debug configuration
            var cfg = CreateConfiguration ("Debug") as DProjectConfiguration;
            DefaultConfiguration = cfg;

            cfg.DebugMode = true;

            cfg.ExtraLibraries.AddRange (libs);
            cfg.CompileTarget = compTarget;
            cfg.ExternalConsole = true;
            cfg.Output = outputPrefix + Name;
            if (projectOptions != null) {
                // Set extra compiler&linker args
                if (projectOptions.Attributes ["CompilerArgs"].InnerText != null) {
                    cfg.ExtraCompilerArguments += projectOptions.Attributes ["CompilerArgs"].InnerText;
                }
                if (projectOptions.Attributes ["LinkerArgs"].InnerText != null) {
                    cfg.ExtraLinkerArguments += projectOptions.Attributes ["LinkerArgs"].InnerText;
                }

                if (projectOptions.GetAttribute ("ExternalConsole") == "True") {
                    cfg.ExternalConsole = true;
                    cfg.PauseConsoleOutput = true;
                }

                if (projectOptions.Attributes ["PauseConsoleOutput"] != null) {
                    cfg.PauseConsoleOutput = bool.Parse (
                        projectOptions.Attributes ["PauseConsoleOutput"].InnerText);
                }
            }

            Configurations.Add (cfg);

            // Create a release configuration
            cfg = CreateConfiguration ("Release") as DProjectConfiguration;

            cfg.DebugMode = false;

            Configurations.Add (cfg);

            // Create unittest configuration
            var unittestConfig = CreateConfiguration ("Unittest") as DProjectConfiguration;

            unittestConfig.DebugMode = true;
            unittestConfig.UnittestMode = true;
            unittestConfig.CompileTarget = DCompileTarget.Executable;

            Configurations.Add (unittestConfig);
        }
Ejemplo n.º 6
0
 public DProject()
 {
     referenceCollection = new DefaultDReferencesCollection (this);
 }