Exemplo n.º 1
0
        private void CreateProjenyRepoConfig(string fileServerURL, string unityExePath, string projectDir, string commonPackagesDir)
        {
            //Construct object graph
            Model.PathVars pathVars = new Model.PathVars();
            pathVars.UnityExePath = unityExePath.Replace('\\', '/');

            if (!commonPackagesDir.Equals(string.Empty))
            {
                pathVars.ProjenyPackagesDir = commonPackagesDir.Replace('\\', '/');
            }

            pathVars.UnityProjectsDir       = "[ConfigDir]/UnityProjects";
            pathVars.SharedUnityPackagesDir = "[ConfigDir]/UnityPackages";
            pathVars.LogPath = "[ConfigDir]/PrjLog.txt";

            List <Model.ReleaseSource> releaseSources = new List <Model.ReleaseSource>();

            if (ckUsePackageServer.Checked)
            {
                releaseSources.Add(new Model.FileServerReleaseSource(fileServerURL + "/ProjenyReleaseManifest.txt"));
            }

            if (!txtReleaseFolder.Text.Equals(string.Empty))
            {
                releaseSources.Add(new Model.PathReleaseSource(txtReleaseFolder.Text));
            }

            Model.RepoConfig config = new Model.RepoConfig(pathVars, releaseSources.ToArray());

            //Serialize
            Serializer serializer = new SerializerBuilder().Build();
            string     yaml       = serializer.Serialize(config);

            // Write the string to a file.
            using (System.IO.StreamWriter file = new System.IO.StreamWriter(projectDir + "/Projeny.yaml"))
            {
                file.WriteLine(yaml);
                file.Close();
            }

            MessageBox.Show("Projeny Repo Created", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
Exemplo n.º 2
0
 public RepoConfig(PathVars pathVars, ReleaseSource[] releaseSources)
 {
     this.PathVars       = pathVars;
     this.ReleaseSources = releaseSources;
 }