Fix incremental compile of *.4ml files.

This commit is contained in:
clovett 2016-09-08 16:52:51 -07:00
Родитель c1799cbfda
Коммит 73c52e1685
5 изменённых файлов: 36 добавлений и 5 удалений

Просмотреть файл

@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CommandLine", "CommandLine.
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Core", "..\Core\Core.csproj", "{1B5724EC-FFF1-48D7-A700-AD46F0150AFC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FormulaCodeGeneratorTask", "..\Extensions\FormulaCodeGeneratorTask\FormulaCodeGeneratorTask.csproj", "{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@ -31,6 +33,14 @@ Global
{1B5724EC-FFF1-48D7-A700-AD46F0150AFC}.Release|x64.Build.0 = Release|x64
{1B5724EC-FFF1-48D7-A700-AD46F0150AFC}.Release|x86.ActiveCfg = Release|x86
{1B5724EC-FFF1-48D7-A700-AD46F0150AFC}.Release|x86.Build.0 = Release|x86
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Debug|x64.ActiveCfg = Debug|x64
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Debug|x64.Build.0 = Debug|x64
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Debug|x86.ActiveCfg = Debug|x86
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Debug|x86.Build.0 = Debug|x86
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Release|x64.ActiveCfg = Release|x64
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Release|x64.Build.0 = Release|x64
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Release|x86.ActiveCfg = Release|x86
{3B52B4F5-52F5-4E19-88CD-6A4A78EA0BF1}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

Просмотреть файл

@ -7,11 +7,12 @@
<FormulaCodeGeneratorPath>$(MSBuildThisFileDirectory)\bin\$(FormulaCodeGeneratorBin)\FormulaCodeGeneratorTask.dll</FormulaCodeGeneratorPath>
</PropertyGroup>
<UsingTask TaskName="FormulaCodeGeneratorTask.FormulaCodeGeneratorTask" AssemblyFile="$(FormulaCodeGeneratorPath)"/>
<Target Name="BeforeBuild">
<Target Name="BeforeBuild" Outputs="@(FormulaGenFiles->'%(FullPath).g.cs')">
<ItemGroup>
<FormulaGenFiles Include="@(EmbeddedResource->'%(FullPath)')" Condition="'%(EmbeddedResource.Generator)' == 'FormulaCodeGenerator'" />
</ItemGroup>
<Error Condition="!Exists($(FormulaCodeGeneratorPath))" Text="### Please build $(FormulaCodeGeneratorPath)" />
<FormulaCodeGeneratorTask GeneratorInputs="@(FormulaGenFiles->'%(FullPath),%(CustomToolNamespace),%(IsThreadSafe),%(IsObjectGraph),%(IsNewOnly)')" DefaultNamespace="$(RootNamespace)" />
<FormulaCodeGeneratorTask GeneratorInputs="@(FormulaGenFiles->'%(FullPath),%(CustomToolNamespace),%(IsThreadSafe),%(IsObjectGraph),%(IsNewOnly)')"
DefaultNamespace="$(RootNamespace)" />
</Target>
</Project>

Просмотреть файл

@ -56,9 +56,11 @@
IsObjectGraph = isObjectGraph.Trim().ToUpperInvariant() != "FALSE";
IsNewOnly = isNewOnly.Trim().ToUpperInvariant() != "FALSE";
}
public bool Generate(FormulaCodeGeneratorTask genTask)
{
var outputFile = InputFile + ".g.cs";
var env = new Env();
try
{
@ -124,7 +126,6 @@
return true;
}
var outputFile = InputFile + ".g.cs";
try
{
var outInfo = new System.IO.FileInfo(outputFile);

Просмотреть файл

@ -24,6 +24,25 @@
set;
}
public string[] Outputs {
get
{
List<string> outputs = new List<string>();
var inputs = GeneratorInputs.Split(inputSplits, StringSplitOptions.None);
foreach (var input in inputs)
{
var parameters = input.Split(paramSplits, StringSplitOptions.None);
if (parameters.Length > 0)
{
string inputFile = parameters[0];
var outputFile = inputFile + ".g.cs";
outputs.Add(outputFile);
}
}
return outputs.ToArray();
}
}
public override bool Execute()
{
var inputs = GeneratorInputs.Split(inputSplits, StringSplitOptions.None);

Просмотреть файл

@ -14,7 +14,7 @@
parent: Subexpr + { NIL },
loc: { LEFT, RIGHT, NIL },
let: Subexpr + { NIL }).
Subexpr(e, p, l, t) :-
e is Expr, p = NIL, l = NIL, t = NIL;
p is Subexpr, e = p.expr.arg1, l = LEFT, t = p.let;