Beispiel #1
0
        public void CreateNewVersion(string version)
        {
            if (version[0] == 'v')
            {
                Console.WriteLine("Version should begin with a number, not with a 'v'");
                return;
            }

            ProductVersion = version;
            ReleaseLog     = new ReleaseLog {
                Created = DateTime.Now, Filename = Path.Combine(ReleaseLogsDir, ProductVersion + ".xml"), Version = ProductVersion
            };
            FillLog();
            ReleaseLog.Save();

            UpdateVersionFiles();

            SharpKit.Installer.Builder.Utils.CallMake(Path.Combine(GitRoot, "Compiler"));
            SharpKit.Installer.Builder.Utils.CallMake(Path.Combine(GitRoot, "SDK")); //Because the the js files contains the version in the header, the files need to be regenerated before commit

            WriteLine("******************************************************************************", ConsoleColor.Green);
            WriteLine("The new version is now changed in all files. Please commit and push it to git now BEFORE you create a github release/tag!", ConsoleColor.Green);
            WriteLine("******************************************************************************", ConsoleColor.Green);

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();

            //CommitGit();
        }
Beispiel #2
0
        private void WriteToReleaseNotesPage(ReleaseLog log, string releaseNotesFilename)
        {
            var tmpFilename = Path.ChangeExtension(log.Filename, ".ascx");

            LogToHtml(tmpFilename, log);
            InsertLinesAfterPlaceHolder(releaseNotesFilename, File.ReadAllLines(tmpFilename));
            File.Delete(tmpFilename);
        }
Beispiel #3
0
        public string GenerateGitHubReleaseLogDescription()
        {
            ReleaseLog = ReleaseLog.Load(Path.Combine(ReleaseLogsDir, ProductVersion + ".xml"));
            var sb = new StringBuilder();

            GenerateGitHubReleaseLogDescription(sb, ReleaseLog.SharpKit5, "Compiler", "SharpKit");
            GenerateGitHubReleaseLogDescription(sb, ReleaseLog.SharpKit_Sdk, "SDK", "SharpKit-SDK");
            return(sb.ToString());
        }
Beispiel #4
0
        private void LogToHtml(StreamWriter writer, ReleaseLog log)
        {
            writer.WriteLine("<div><%=CreateHeader({0})%>", VersionInfoToCode(log.Version, log.Created));
            var list = GetLogMessages(log);

            LogProjectToHtml(writer, log.SharpKit5, "SharpKit 5");
            LogProjectToHtml(writer, log.SharpKit_Sdk, "SharpKit SDK");
            writer.WriteLine("</div>");
        }
Beispiel #5
0
        private List <string> GetLogMessages(ReleaseLog log)
        {
            var list = new List <string>();

            //if (log.SharpKit != null)
            //    list.AddRange(GetLogMessages(log.SharpKit.SvnLogEntries));
            if (log.SharpKit_Sdk != null)
            {
                list.AddRange(GetLogMessages(log.SharpKit_Sdk.SvnLogEntries));
            }
            if (log.SharpKit5 != null)
            {
                list.AddRange(GetLogMessages(log.SharpKit5.SvnLogEntries));
            }
            return(list);
        }
Beispiel #6
0
 void UpdateSharpKitVersionInfoSourceFiles(ReleaseLog log)
 {
     UpdateSharpKitVersionInfoSourceFiles(log.Version, log.Created);
 }
 private void WriteToReleaseNotesPage(ReleaseLog log, string releaseNotesFilename)
 {
     var tmpFilename = Path.ChangeExtension(log.Filename, ".ascx");
     LogToHtml(tmpFilename, log);
     InsertLinesAfterPlaceHolder(releaseNotesFilename, File.ReadAllLines(tmpFilename));
     File.Delete(tmpFilename);
 }
 //private void CreateVersionInfos(List<string> logFiles)
 //{
 //    foreach (var file in logFiles)
 //    {
 //        var log = SharpKit.Release.ReleaseLog.Load(file);
 //        UpdateSharpKitVersionInfoSourceFiles(log);
 //    }
 //}
 //string UpdateVersionInfo(ReleaseLog log, string contents)
 //{
 //    var version = log.Version;
 //    contents = contents.Replace("CreateHeader(\"" + version + "\")", "CreateHeader(" + VersionInfoToCode(version, log.Created) + ")");
 //    UpdateSharpKitVersionInfoSourceFiles(log.Version, log.Created);
 //    return contents;
 //}
 void UpdateSharpKitVersionInfoSourceFiles(ReleaseLog log)
 {
     UpdateSharpKitVersionInfoSourceFiles(log.Version, log.Created);
 }
        void Run()
        {
            if (TestOnly)
                Console.WriteLine("TEST MODE!!!");

            SkSlnFilename = @"C:\Projects\GitHub\SharpKit\Compiler\Compiler.sln";
            SdkSlnFilename = @"C:\Projects\GitHub\SharpKit\Defs\Defs.sln";

            WebConfigFilename = SkTrunkDir + @"Website\SharpKit.WebSite\Web.config";
            OldWebConfigFilename = OldWebsite + @"Web.config";
            ReleaseLogsDir = SkTrunkDir + @"Compiler\Packager\ReleaseLogs\";
            InstallerProjectDir = SkTrunkDir + @"Compiler\Installer\";
            SetupDir = SkTrunkDir + @"setup\";
            try
            {
                var buildSdk = AskBoolean("Build SDK?");
                if (!SkipLog)
                {
                    if (!AskBoolean("Did you remember to get latest on SharpKit SDK?"))
                        return;
                    var logFiles = Directory.GetFiles(ReleaseLogsDir, "*.xml").OrderBy(t => t).ToList();
                    var lastReleaseLogFilename = logFiles.LastOrDefault();
                    LastReleaseLog = ReleaseLog.Load(lastReleaseLogFilename);
                    SetupVersion = AskString(String.Format("Last version is: {0}, from:{1:dd-MM-yyyy}, enter new version:", LastReleaseLog.Version, LastReleaseLog.Created));
                    if (SetupVersion.IsNullOrEmpty())
                        throw new Exception();
                    if (SetupVersion == LastReleaseLog.Version)
                    {
                        if (!AskBoolean("You have selected to create the same version, are you sure?"))
                            return;
                    }
                }
                else
                {
                    SetupVersion = AskString("enter new version:");
                }
                ReleaseLog = new ReleaseLog { Created = DateTime.Now, Filename = Path.Combine(ReleaseLogsDir, SetupVersion + ".xml"), Version = SetupVersion };
                if (!SkipLog)
                {
                    FillLog();
                }

                if (!TestOnly)
                {
                    //UpdateSharpKitVersionInfoSourceFiles(ReleaseLog);
                    //UpdateAssemblyFileVersions(SetupVersion);
                }

                if (!TestOnly)
                {
                    BuildSolution(SkSlnFilename, "Release");
                    if (buildSdk)
                        BuildSdk();
                }
                CreateInstaller();

                if (!TestOnly)
                {
                    ReleaseLog.Save();
                    var oldFile = OldWebsite + "ReleaseNotes.aspx";
                    if (File.Exists(oldFile))
                        WriteToReleaseNotesPage(ReleaseLog, oldFile);
                    WriteToReleaseNotesPage(ReleaseLog, SkTrunkDir + @"Website\SharpKit.Website\ReleaseNotes.aspx");
                    UpdateWebConfig(SetupVersion, SetupCloudFrontUrl, WebConfigFilename);
                    UpdateWebConfig(SetupVersion, SetupCloudFrontUrl, OldWebConfigFilename);
                }
                CopyInstallerToReleaseFolder();
                if (!TestOnly)
                    Upload();

            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            Console.WriteLine("Finished....");
            Console.ReadLine();
        }
 private void LogToHtml(StreamWriter writer, ReleaseLog log)
 {
     writer.WriteLine("<div><%=CreateHeader({0})%>", VersionInfoToCode(log.Version, log.Created));
     var list = GetLogMessages(log);
     LogProjectToHtml(writer, log.SharpKit5, "SharpKit 5");
     LogProjectToHtml(writer, log.SharpKit_Sdk, "SharpKit SDK");
     writer.WriteLine("</div>");
 }
 private void LogToHtml(string filename, ReleaseLog log)
 {
     using (var writer = new StreamWriter(filename, false))
         LogToHtml(writer, log);
 }
 private List<string> GetLogMessages(ReleaseLog log)
 {
     var list = new List<string>();
     //if (log.SharpKit != null)
     //    list.AddRange(GetLogMessages(log.SharpKit.SvnLogEntries));
     if (log.SharpKit_Sdk != null)
         list.AddRange(GetLogMessages(log.SharpKit_Sdk.SvnLogEntries));
     if (log.SharpKit5 != null)
         list.AddRange(GetLogMessages(log.SharpKit5.SvnLogEntries));
     return list;
 }
Beispiel #13
0
        void Run()
        {
            if (TestOnly)
            {
                Console.WriteLine("TEST MODE!!!");
            }

            SkSlnFilename  = @"C:\Projects\GitHub\SharpKit\Compiler\Compiler.sln";
            SdkSlnFilename = @"C:\Projects\GitHub\SharpKit\Defs\Defs.sln";

            WebConfigFilename    = SkTrunkDir + @"Website\SharpKit.WebSite\Web.config";
            OldWebConfigFilename = OldWebsite + @"Web.config";
            ReleaseLogsDir       = SkTrunkDir + @"Compiler\Packager\ReleaseLogs\";
            InstallerProjectDir  = SkTrunkDir + @"Compiler\Installer\";
            SetupDir             = SkTrunkDir + @"setup\";
            try
            {
                var buildSdk = AskBoolean("Build SDK?");
                if (!SkipLog)
                {
                    if (!AskBoolean("Did you remember to get latest on SharpKit SDK?"))
                    {
                        return;
                    }
                    var logFiles = Directory.GetFiles(ReleaseLogsDir, "*.xml").OrderBy(t => t).ToList();
                    var lastReleaseLogFilename = logFiles.LastOrDefault();
                    LastReleaseLog = ReleaseLog.Load(lastReleaseLogFilename);
                    SetupVersion   = AskString(String.Format("Last version is: {0}, from:{1:dd-MM-yyyy}, enter new version:", LastReleaseLog.Version, LastReleaseLog.Created));
                    if (SetupVersion.IsNullOrEmpty())
                    {
                        throw new Exception();
                    }
                    if (SetupVersion == LastReleaseLog.Version)
                    {
                        if (!AskBoolean("You have selected to create the same version, are you sure?"))
                        {
                            return;
                        }
                    }
                }
                else
                {
                    SetupVersion = AskString("enter new version:");
                }
                ReleaseLog = new ReleaseLog {
                    Created = DateTime.Now, Filename = Path.Combine(ReleaseLogsDir, SetupVersion + ".xml"), Version = SetupVersion
                };
                if (!SkipLog)
                {
                    FillLog();
                }

                if (!TestOnly)
                {
                    //UpdateSharpKitVersionInfoSourceFiles(ReleaseLog);
                    //UpdateAssemblyFileVersions(SetupVersion);
                }

                if (!TestOnly)
                {
                    BuildSolution(SkSlnFilename, "Release");
                    if (buildSdk)
                    {
                        BuildSdk();
                    }
                }
                CreateInstaller();

                if (!TestOnly)
                {
                    ReleaseLog.Save();
                    var oldFile = OldWebsite + "ReleaseNotes.aspx";
                    if (File.Exists(oldFile))
                    {
                        WriteToReleaseNotesPage(ReleaseLog, oldFile);
                    }
                    WriteToReleaseNotesPage(ReleaseLog, SkTrunkDir + @"Website\SharpKit.Website\ReleaseNotes.aspx");
                    UpdateWebConfig(SetupVersion, SetupCloudFrontUrl, WebConfigFilename);
                    UpdateWebConfig(SetupVersion, SetupCloudFrontUrl, OldWebConfigFilename);
                }
                CopyInstallerToReleaseFolder();
                if (!TestOnly)
                {
                    Upload();
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e);
            }
            Console.WriteLine("Finished....");
            Console.ReadLine();
        }
Beispiel #14
0
 private void LogToHtml(string filename, ReleaseLog log)
 {
     using (var writer = new StreamWriter(filename, false))
         LogToHtml(writer, log);
 }
Beispiel #15
0
 public string GenerateGitHubReleaseLogDescription()
 {
     ReleaseLog = ReleaseLog.Load(Path.Combine(ReleaseLogsDir, ProductVersion + ".xml"));
     var sb = new StringBuilder();
     GenerateGitHubReleaseLogDescription(sb, ReleaseLog.SharpKit5, "Compiler", "SharpKit");
     GenerateGitHubReleaseLogDescription(sb, ReleaseLog.SharpKit_Sdk, "SDK", "SharpKit-SDK");
     return sb.ToString();
 }
Beispiel #16
0
        public void CreateNewVersion(string version)
        {
            if (version[0] == 'v')
            {
                Console.WriteLine("Version should begin with a number, not with a 'v'");
                return;
            }

            ProductVersion = version;
            ReleaseLog = new ReleaseLog { Created = DateTime.Now, Filename = Path.Combine(ReleaseLogsDir, ProductVersion + ".xml"), Version = ProductVersion };
            FillLog();
            ReleaseLog.Save();

            UpdateVersionFiles();

            SharpKit.Installer.Builder.Utils.CallMake(Path.Combine(GitRoot, "Compiler"));
            SharpKit.Installer.Builder.Utils.CallMake(Path.Combine(GitRoot, "SDK")); //Because the the js files contains the version in the header, the files need to be regenerated before commit

            WriteLine("******************************************************************************", ConsoleColor.Green);
            WriteLine("The new version is now changed in all files. Please commit and push it to git now BEFORE you create a github release/tag!", ConsoleColor.Green);
            WriteLine("******************************************************************************", ConsoleColor.Green);

            Console.WriteLine("Press enter key to continue...");
            Console.ReadLine();

            //CommitGit();
        }