Ejemplo n.º 1
0
        public NuGetDeployForm()
        {
            InitializeComponent();

            BindTextBoxEvents();

            _project    = Host.Instance.Dte2.GetActiveProejct();
            _dir        = _project.GetDirectory();
            _releaseDir = Path.Combine(_dir, "bin", "Release");
            //_outputDir = Path.Combine(_dir, "bin", "NuGet");
            //if (!Directory.Exists(_outputDir))
            //    Directory.CreateDirectory(_outputDir);
            _nuspecFile = Path.Combine(_dir, NuGetDomain.NuSpecFileName);
            if (!File.Exists(_nuspecFile))
            {
                MessageBox.Show($"nuspec file {_nuspecFile} not found.");
                Close();
                return;
            }

            _assemblyInfo = _project.GetProjectAssemblyInfo();
            _xmlDoc       = new XmlDocument();
            _xmlDoc.Load(_nuspecFile);
            var xml = _xmlDoc.InnerXml;

            _package       = XmlSerializerHelper.LoadObjectFromXmlString <Package>(xml);
            _nuGetConfig   = ConfigHelper.ReadNuGetConfig();
            _projectConfig = _project.ReadNuPackConfig();
            SetBoxes();
            MergePackagesConfig();
            BindDependencies();
        }
Ejemplo n.º 2
0
        public static void Save(this ProjectNuPackConfig config)
        {
            var file = Path.Combine(AppDataDir, "\\" + config.Project.UniqueName + ProjectNuPackConfig.Ext);
            var xml  = XmlSerializerHelper.GetXmlStringFromObject(config);
            var doc  = new XmlDocument();

            doc.LoadXml(xml);
            var dir = Path.GetDirectoryName(file);

            if (!Directory.Exists(dir))
            {
                Directory.CreateDirectory(dir);
            }
            doc.Save(file);
        }
Ejemplo n.º 3
0
        public DeployWizard()
        {
            InitializeComponent();


            ActiveControl = txtAssemblyVersion;

            BindTextBoxEvents();

            _project    = Host.Instance.Dte2.GetActiveProejct();
            _dir        = _project.GetDirectory();
            _releaseDir = Path.Combine(_dir, "bin", "Release");
            _nuspecFile = Path.Combine(_dir, NuGetDomain.NuSpecFileName);


            _nuGetConfig   = ConfigHelper.ReadNuGetConfig();
            _projectConfig = _project.ReadNuPackConfig();

            stepWizardControl.SelectedPageChanged += StepWizardControl_SelectedPageChanged;
            stepWizardControl.Finished            += StepWizardControl_Finished;
            wizardPage1.Commit += WizardPageCommit;
            wizardPage2.Commit += WizardPageCommit;
        }