Exemple #1
0
    public void Merge(MavenSettings copy)
    {
        if (copy == null)
        {
            return;
        }

        Phase.AddRange(copy.Phase);
        Goal.AddRange(copy.Goal);
        Profiles.AddRange(copy.Profiles);
        foreach (var property in copy.Properties)
        {
            Properties[property.Key] = property.Value;
        }
        if (copy.SettingsFile != null)
        {
            SettingsFile = copy.SettingsFile;
        }
        if (copy.BatchMode != null)
        {
            BatchMode = copy.BatchMode;
        }
        if (copy.NonRecursive != null)
        {
            NonRecursive = copy.NonRecursive;
        }
        if (copy.Offline != null)
        {
            Offline = copy.Offline;
        }
        if (copy.ForceUpdate != null)
        {
            ForceUpdate = copy.ForceUpdate;
        }

        if (copy.ToolPath != null)
        {
            ToolPath = copy.ToolPath;
        }
        if (copy.ToolTimeout != null)
        {
            ToolTimeout = copy.ToolTimeout;
        }
        if (copy.WorkingDirectory != null)
        {
            WorkingDirectory = copy.WorkingDirectory;
        }
        if (copy.ArgumentCustomization != null)
        {
            ArgumentCustomization = copy.ArgumentCustomization;
        }
        if (copy.EnvironmentVariables != null)
        {
            if (EnvironmentVariables == null)
            {
                EnvironmentVariables = new Dictionary <string, string>(copy.EnvironmentVariables);
            }
            else
            {
                foreach (var pair in copy.EnvironmentVariables)
                {
                    EnvironmentVariables[pair.Key] = pair.Value;
                }
            }
        }
    }