using Sharpmake; namespace JustDance.Tools { [Generate] public class BaseSolution : CSharpSolution { /// /// Set to true to add the target project to the solution and project name. /// Mandatory if you try to generate the solutions for several projects. /// public bool UseMultiProject = Globals.UseMultiProject; public virtual string RootPath { get { return Globals.BranchRoot; } } public virtual string BuildPath { get { return Globals.BranchRoot + @"build\"; } } public virtual string ToolsPath { get { return Globals.BranchRoot + @"tools\"; } } public BaseSolution() { AddTargets(Utilities.GetDefaultTargets()); IsFileNameToLower = false; } [Configure] public virtual void ConfigureAll(Configuration conf, Target target) { conf.SolutionFileName = string.Format("{0}.{1}.{2}", Name, Globals.CurrentBranchName.ToLower(), target.DevEnv.GetDevEnvString()); if (UseMultiProject) conf.SolutionFileName += "." + Globals.CurrentProjectName; conf.SolutionPath = ToolsPath; } } abstract class SingleProjectSolution : BaseSolution { } /// /// Inherit from this class to generate a solution for a single project. /// abstract class SingleProjectSolution : SingleProjectSolution where TProject : BaseProject, new() { protected SingleProjectSolution() { Name = new TProject().Name; } public override void ConfigureAll(Configuration conf, Target target) { base.ConfigureAll(conf, target); conf.AddProject(target); conf.SolutionPath = string.Format(ToolsPath + @"{0}\[solution.Name]\", new TProject().ProjectType); } } }