Skip to content

Commit

Permalink
Merge pull request #24 from VirtoCommerce/PT-58
Browse files Browse the repository at this point in the history
PT-58: Add DefaultProject parameter
  • Loading branch information
mvktsk authored Sep 29, 2021
2 parents 6a6f6ca + 610ce9e commit 2bdd682
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ public static int Main(string[] args)
[Parameter("Directory containing modules.json")]
public static string ModulesJsonDirectoryName { get; set; } = "vc-modules";

[Parameter("Defauld (start) project name")]
public static string DefaultProject { get; set; } = ".Web";

// TODO: Convert to a method because GitRepository.FromLocalDirectory() is a heavy method and it should not be used as a property
protected GitRepository GitRepository => GitRepository.FromLocalDirectory(RootDirectory / ".git");

Expand All @@ -221,9 +224,10 @@ public static int Main(string[] args)
protected static AbsolutePath SamplesDirectory => RootDirectory / "samples";

protected AbsolutePath ModulesLocalDirectory => ArtifactsDirectory / ModulesJsonDirectoryName;
protected static Project WebProject => Solution?.AllProjects.FirstOrDefault(x => x.Name.EndsWith(".Web") || x.Name.EndsWith("VirtoCommerce.Storefront") || x.Name.EndsWith("_build"));
protected static Project WebProject => Solution?.AllProjects.FirstOrDefault(x => x.Name.EndsWith(DefaultProject) || x.Name.EndsWith("VirtoCommerce.Storefront") || x.Name.EndsWith("_build"));
protected static AbsolutePath ModuleManifestFile => WebProject?.Directory / "module.manifest";
protected AbsolutePath ModuleIgnoreFile => RootDirectory / "module.ignore";
protected static AbsolutePath WebDirectory => WebProject?.Directory;

protected static Microsoft.Build.Evaluation.Project MSBuildProject => WebProject?.GetMSBuildProject();
protected string VersionPrefix => IsTheme ? GetThemeVersion(PackageJsonPath) : MSBuildProject.GetProperty("VersionPrefix")?.EvaluatedValue;
Expand Down

0 comments on commit 2bdd682

Please sign in to comment.