Ejemplo n.º 1
0
        private async Task <string> GetImplementation(Manifest manifest, string revision)
        {
            if (manifest.Implementation.Type != "file")
            {
                return(null);
            }

            var implementationFilePath = ManifestExtensions.GetFileImplementionPath(manifest);

            return(await _git($"show {revision}:{implementationFilePath}"));
        }
Ejemplo n.º 2
0
        private void EnsureSolutionID()
        {
            string solutionId = Guid.NewGuid().ToString();

            if (!ManifestExtensions.DoManifestExits(this.ProjectFullPath))
            {
                ManifestExtensions.CreateManifestFile(this.ProjectFullPath, solutionId);
            }
            else
            {
                solutionId = ManifestExtensions.GetSolutionID(this.ProjectFullPath);
            }

            this.Replacements.Add(ItemPropertyValues.SolutionID, solutionId);
        }
Ejemplo n.º 3
0
        public virtual void ProjectFinishedGenerating(EnvDTE.Project project)
        {
            Log("ProjectFinishedGenerating");

            string projectPath = (string)project.Properties.Item("FullPath").Value;

            string pkt = StrongNameKey.CreateKeyPairFile(projectPath + project.Name + ".snk", 1024);

            project.ProjectItems.AddFromFile(projectPath + project.Name + ".snk");

            string solutionID = this.Replacements[ProjectPropertyValues.SolutionID];
            string filename   = ManifestExtensions.CreateManifestFile(projectPath, solutionID);

            // Add the new file to the project
            project.ProjectItems.AddFromFile(filename);


            Log("ProjectFinishedGenerating Finished");
        }
Ejemplo n.º 4
0
        public static Solution Load(string path)
        {
            Solution result = null;

            if (!File.Exists(path) && SharePointRegistry.IsSharePoint14)
            {
                ResourceReader resources = new ResourceReader(Config.Current.ProjectPath);
                resources.CreateFile(ResourceReader.MANIFEST_CONFIG);
            }

            // Ensure the correct SolutionID in the solution if it exist
            if (File.Exists(path))
            {
                result = FileSystem.Load <Solution>(path);

                // Use the id from the solutionID file if it exits
                string idfilename = Config.Current.SolutionPath + @"\solutionid.txt";
                Guid   solutionID = SolutionIdFile.GetID(idfilename, FileAccess.Read);
                if (!solutionID.Equals(Guid.Empty))
                {
                    Log.Information("The solution id from the solutionid.txt is used. The SolutionID from the Manifest.Config file is ignored!");

                    result.SolutionId = solutionID.ToString();
                }

                // Check the id of the solution and create a new one if its empty
                if (result.SolutionId == Guid.Empty.ToString())
                {
                    result.SolutionId = Guid.NewGuid().ToString();

                    ManifestExtensions.UpdateSolutionID(path, result.SolutionId);
                    Log.Information("The Manifest.Config file has been updated with the solution id : " + result.SolutionId);
                }
            }

            return(result);
        }