Skip to content

Commit 2af4e2d

Browse files
committed
List out all the configuration files that contributed to a build's configuration in the jsillog file.
1 parent b1b40cb commit 2af4e2d

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

Compiler/Configuration.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public void MergeInto (SolutionBuildConfiguration result) {
2828
}
2929
}
3030

31+
public string[] ContributingPaths = new string[0];
3132
public string Path;
3233

3334
public readonly SolutionBuildConfiguration SolutionBuilder = new SolutionBuildConfiguration();
@@ -63,6 +64,8 @@ public void MergeInto (Configuration result) {
6364
result.CustomVariables[kvp.Key] = kvp.Value;
6465

6566
SolutionBuilder.MergeInto(result.SolutionBuilder);
67+
68+
result.ContributingPaths = result.ContributingPaths.Concat(ContributingPaths).ToArray();
6669
}
6770

6871
public Configuration Clone () {

Compiler/Program.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ static Configuration LoadConfiguration (string filename) {
4141
var variables = result.ApplyTo(new VariableSet());
4242

4343
result.Path = Path.GetDirectoryName(Path.GetFullPath(filename));
44+
result.ContributingPaths = new[] { Path.GetFullPath(filename) };
4445

4546
Console.Error.WriteLine("// Applied settings from '{0}'.", ShortenPath(filename));
4647

@@ -529,8 +530,13 @@ static void EmitLog (
529530
var logText = new StringBuilder();
530531
var asmName = Assembly.GetExecutingAssembly().GetName();
531532
logText.AppendLine(String.Format("// JSILc v{0}.{1}.{2}", asmName.Version.Major, asmName.Version.Minor, asmName.Version.Revision));
532-
logText.AppendLine(String.Format("// The following settings were used when translating '{0}':", inputFile));
533+
logText.AppendLine(String.Format("// The following configuration was used when translating '{0}':", inputFile));
533534
logText.AppendLine((new JavaScriptSerializer()).Serialize(configuration));
535+
logText.AppendLine("// The configuration was generated from the following configuration files:");
536+
537+
foreach (var cf in configuration.ContributingPaths)
538+
logText.AppendLine(cf);
539+
534540
logText.AppendLine("// The following outputs were produced:");
535541

536542
foreach (var fe in outputs.OrderedFiles)

0 commit comments

Comments
 (0)