Exemple #1
0
        public bool Store()
        {
            if (configuration == null)
            {
                return(false);
            }

            // Store used compiler vendor
            project.UseDefaultCompilerVendor = cbUseDefaultCompiler.Active;
            project.PreferOneStepBuild       = cbPreferOneStepCompilation.Active;

            Gtk.TreeIter iter;
            if (cmbCompiler.GetActiveIter(out iter))
            {
                project.UsedCompilerVendor = cmbCompiler.Model.GetValue(iter, 0) as string;
            }

            // Store args
            configuration.ExtraCompilerArguments = extraCompilerTextView.Buffer.Text;
            configuration.ExtraLinkerArguments   = extraLinkerTextView.Buffer.Text;

            configuration.OutputDirectory = text_BinDirectory.Text;
            configuration.Output          = text_TargetFile.Text;
            configuration.ObjectDirectory = text_ObjectsDirectory.Text;
            configuration.DDocDirectory   = text_DDocDir.Text;

            if (combo_ProjectType.GetActiveIter(out iter))
            {
                configuration.CompileTarget = (DCompileTarget)model_compileTarget.GetValue(iter, 1);
            }

            configuration.CustomDebugIdentifiers   = text_debugConstants.Text.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            configuration.CustomVersionIdentifiers = text_versionConstants.Text.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            configuration.UpdateGlobalVersionIdentifiers(project);

            // Store libs
            configuration.ExtraLibraries.Clear();
            configuration.ExtraLibraries.AddRange(text_Libraries.Buffer.Text.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries));

            return(true);
        }
Exemple #2
0
        public bool Store()
        {
            if (configuration == null)
            {
                return(false);
            }

            // Store used compiler vendor
            project.UseDefaultCompilerVendor = cbUseDefaultCompiler.Active;
            configuration.UnittestMode       = cbIsUnittestConfig.Active;
            project.PreferOneStepBuild       = cbPreferOneStepCompilation.Active;

            Gtk.TreeIter iter;
            if (cmbCompiler.GetActiveIter(out iter))
            {
                project.UsedCompilerVendor = cmbCompiler.Model.GetValue(iter, 0) as string;
            }

            // Store args
            int oldHash = configuration.GetHashCode();

            configuration.ExtraCompilerArguments = extraCompilerTextView.Buffer.Text;
            configuration.ExtraLinkerArguments   = extraLinkerTextView.Buffer.Text;

            configuration.LinkinThirdPartyLibraries = check_LinkThirdPartyLibs.Active;

            configuration.OutputDirectory = project.GetAbsoluteChildPath(text_BinDirectory.Text);
            configuration.Output          = text_TargetFile.Text;
            configuration.ObjectDirectory = text_ObjectsDirectory.Text;
            configuration.DDocDirectory   = text_DDocDir.Text;

            if (combo_ProjectType.GetActiveIter(out iter))
            {
                configuration.CompileTarget = (DCompileTarget)model_compileTarget.GetValue(iter, 1);
            }

            configuration.DebugLevel               = spin_debugLevel.ValueAsInt;
            configuration.CustomDebugIdentifiers   = text_debugConstants.Text.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            configuration.CustomVersionIdentifiers = text_versionConstants.Text.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            configuration.UpdateGlobalVersionIdentifiers(project);

            // Store libs
            configuration.ExtraLibraries.Clear();
            foreach (var p in text_Libraries.Buffer.Text.Split('\n'))
            {
                var p_ = p.Trim();
                if (!String.IsNullOrWhiteSpace(p_))
                {
                    configuration.ExtraLibraries.Add(p_);
                }
            }

            combo_Platform.GetActiveIter(out iter);
            var oldPlatform = configuration.Platform;

            configuration.Platform = model_Platforms.GetValue(iter, 0) as string;
            // Update solution configuration <-> Project configuration mapping
            if (oldPlatform != configuration.Platform)
            {
                var slnConfig = project.ParentSolution.GetConfiguration(Ide.IdeApp.Workspace.ActiveConfiguration);
                var en        = slnConfig.GetEntryForItem(project);
                if (en != null)
                {
                    slnConfig.RemoveItem(project);
                    var newEn = slnConfig.AddItem(project);
                    newEn.ItemConfiguration = configuration.Id;
                    newEn.Build             = en.Build;
                    newEn.Deploy            = en.Deploy;
                }
            }

            if (oldHash != configuration.GetHashCode() &&
                Ide.IdeApp.Workspace.ActiveConfigurationId == configuration.Id)
            {
                project.NeedsFullRebuild = true;
            }

            return(true);
        }
Exemple #3
0
        public bool Store()
        {
            if (configuration == null)
            {
                return(false);
            }

            // Store used compiler vendor
            project.UseDefaultCompilerVendor = cbUseDefaultCompiler.Active;
            project.PreferOneStepBuild       = cbPreferOneStepCompilation.Active;

            Gtk.TreeIter iter;
            if (cmbCompiler.GetActiveIter(out iter))
            {
                project.UsedCompilerVendor = cmbCompiler.Model.GetValue(iter, 0) as string;
            }

            // Store args
            configuration.ExtraCompilerArguments = extraCompilerTextView.Buffer.Text;
            configuration.ExtraLinkerArguments   = extraLinkerTextView.Buffer.Text;

            configuration.OutputDirectory = text_BinDirectory.Text;
            configuration.Output          = text_TargetFile.Text;
            configuration.ObjectDirectory = text_ObjectsDirectory.Text;
            configuration.DDocDirectory   = text_DDocDir.Text;

            if (combo_ProjectType.GetActiveIter(out iter))
            {
                configuration.CompileTarget = (DCompileTarget)model_compileTarget.GetValue(iter, 1);
            }

            configuration.CustomDebugIdentifiers   = text_debugConstants.Text.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            configuration.CustomVersionIdentifiers = text_versionConstants.Text.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries);
            configuration.UpdateGlobalVersionIdentifiers(project);

            // Store libs
            configuration.ExtraLibraries.Clear();
            configuration.ExtraLibraries.AddRange(text_Libraries.Buffer.Text.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries));

            // Store includes
            #region Store new include paths
            var paths = text_Includes.Buffer.Text.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);

            // Remove trailing / and \
            for (int i = 0; i < paths.Length; i++)
            {
                paths[i] = paths[i].TrimEnd('\\', '/');
            }

            if (project.LocalIncludeCache.UpdateRequired(paths))
            {
                project.LocalIncludeCache.ParsedDirectories.Clear();
                project.LocalIncludeCache.ParsedDirectories.AddRange(paths);

                try {
                    // Update parse cache immediately
                    DCompilerConfiguration.UpdateParseCacheAsync(project.LocalIncludeCache);
                } catch (Exception ex) {
                    LoggingService.LogError("Include path analysis error", ex);
                }
            }
            #endregion

            // Store project deps
            project.ProjectDependencies.Clear();
            foreach (var i in vbox_ProjectDeps)
            {
                var cb = i as CheckButton;

                if (cb == null || !cb.Active)
                {
                    continue;
                }

                var prj = cb.Data["prj"] as Project;
                if (prj != null)
                {
                    project.ProjectDependencies.Add(prj.ItemId);
                }
            }

            return(true);
        }