Skip to content

Commit

Permalink
Do not open TypeScript console window on building any project.
Browse files Browse the repository at this point in the history
Only open the TypeScript console window when a project contains
TypeScript files that will be compiled on build.
  • Loading branch information
mrward committed Sep 22, 2015
1 parent a60f4b7 commit 562a73b
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions src/TypeScriptBinding/CompileTypeScriptFilesOnBuildAction.cs
Expand Up @@ -40,11 +40,13 @@ public class CompileTypeScriptFilesOnBuildAction : CompileTypeScriptAction
{
public void CompileFiles(IBuildTarget buildTarget)
{
List<TypeScriptProject> projects = GetTypeScriptProjects (buildTarget).ToList ();
if (!projects.Any ())
return;

using (IProgressMonitor progressMonitor = GetRunProcessMonitor()) {
foreach (TypeScriptProject project in buildTarget.GetTypeScriptProjects()) {
if (project.CompileOnBuild) {
CompileFiles(project);
}
foreach (TypeScriptProject project in projects) {
CompileFiles(project);
}
}
}
Expand Down Expand Up @@ -84,5 +86,12 @@ void ReportCompileStarting(TypeScriptProject project)
{
Report("Compiling TypeScript files for project: {0}", project.Name);
}

IEnumerable<TypeScriptProject> GetTypeScriptProjects (IBuildTarget buildTarget)
{
return buildTarget.GetTypeScriptProjects ()
.Where (project => project.CompileOnBuild)
.Where (project => project.HasTypeScriptFiles ());
}
}
}

0 comments on commit 562a73b

Please sign in to comment.