コード例 #1
0
        public static void UpdateCsProjFile(this ICakeContext context, Solution sln, FilePath filePath)
        {
            var projFile = new CsProjFile(filePath);

            if (!projFile.IsNetCore)
            {
                return;
            }
            var project = filePath.FindProjectForPath(sln);

            if (project != null)
            {
                projFile.SetProperty("AssemblyVersion", project.version ?? sln.version);
                projFile.SetProperty("FileVersion", project.version ?? sln.version);
                if (project.owner == null)
                {
                    projFile.SetProperty("Product", sln.name);
                    projFile.SetProperty("Description", sln.description);
                    projFile.SetProperty("Company", sln.dnn.owner.organization);
                    projFile.SetProperty("Copyright", $"Copyright {System.DateTime.Now.Year} by {sln.dnn.owner.organization}");
                }
                projFile.Write();
            }
            else
            {
                projFile.SetProperty("AssemblyVersion", sln.version);
                projFile.SetProperty("FileVersion", sln.version);
                projFile.SetProperty("Product", sln.name);
                projFile.SetProperty("Description", sln.description);
                projFile.SetProperty("Company", sln.dnn.owner.organization);
                projFile.SetProperty("Copyright", $"Copyright {System.DateTime.Now.Year} by {sln.dnn.owner.organization}");
                projFile.Write();
            }
        }
コード例 #2
0
        public static void UpdateCsProjFile(Solution sln, string filePath)
        {
            var projFile = new CsProjFile(filePath);

            if (!projFile.IsNetCore)
            {
                return;
            }
            projFile.SetProperty("AssemblyVersion", sln.version);
            projFile.SetProperty("FileVersion", sln.version);
            projFile.SetProperty("Product", sln.name);
            projFile.SetProperty("Description", sln.description);
            projFile.SetProperty("Company", sln.dnn.owner.organization);
            projFile.SetProperty("Copyright", string.Format("Copyright {0} by {1}", System.DateTime.Now.Year, sln.dnn.owner.organization));
            projFile.Write();
        }