コード例 #1
0
 public static string Serialize(ProjectBuildJob config)
 {
     return(JsonConvert.SerializeObject(
                config,
                Formatting.Indented
                ));
 }
コード例 #2
0
        public void RunJob(
            string rootDir,
            ProjectBuildTarget buildTarget,
            ProjectBuildJob job)
        {
            if (!s_BuildJobRunners.ContainsKey(job.BuildJobRunner))
            {
                Logger.LogMessage(LoggerSystems.ModuleSystem, "Can not Find Job Runner: {0}", job.BuildJobRunner);

                return;
            }

            ResolveBuildJobItems(rootDir, buildTarget, job);

            s_BuildJobRunners[job.BuildJobRunner].RunJob(rootDir, this, buildTarget, job);
        }
コード例 #3
0
        private void ResolveBuildJobItems(string rootDir, ProjectBuildTarget buildTarget, ProjectBuildJob job)
        {
            Dictionary <string, string> varMap = new Dictionary <string, string>
            {
                { "VISDIR", AppRootHelper.AppRoot },
                {
                    "PROJDIR", rootDir.EndsWith("\\") ||
                    rootDir.EndsWith("/")
                                                                          ? rootDir
                                                                          : rootDir + "/"
                },
                { "NAME", ProjectName },
                { "VERSION", ProjectVersion },
                { "TARGET", buildTarget.TargetName },
            };

            foreach (string varMapKey in varMap.Keys.ToArray())
            {
                job.JobName = job.JobName.Replace($"%{varMapKey}%", varMap[varMapKey]);

                foreach (string argumentsKey in job.Arguments.Keys.ToArray())
                {
                    job.Arguments[argumentsKey] =
                        job.Arguments[argumentsKey].Replace($"%{varMapKey}%", varMap[varMapKey]);
                }
            }
        }
コード例 #4
0
 public static void Save(string path, ProjectBuildJob config)
 {
     File.WriteAllText(path, Serialize(config));
 }