-
-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MSBuild process assumes generated file in project root, not at generation site #36
Comments
The command line generator does the same, also placing the file at the project root (except the naming is different - Streams.generated.cs) |
If I write the source like this: context[$"generated\\Streams.g.cs"].Write($$"""{{source}}"""); This will create the file in ANOTHER subdirectory (generator/generated/Streams.g.cs), and then the MSBuild task will look for the file in 'P:\fennECS\fennecs\generated\Streams.g.cs' (again 1 directory too high) |
Running this from the Root of the project (with the files cluttering the root), this works according to the documentation. However, the build task does not seem to care about dependencies, and runs in full every time the solution is built (instead of tracking which, if any, .csx files were changed). This adds a significant chunk of compilation time that strongly affects test-driven development workflows. |
<PropertyGroup>
<DisableFastUpToDateCheck>true</DisableFastUpToDateCheck>
</PropertyGroup>
<ItemGroup>
<StreamTemplate Include="generators\Streams.*.csx">
<OutputFile>generated\%(Filename).g.cs</OutputFile>
</StreamTemplate>
</ItemGroup>
<Target Name="GenerateStreamRunners"
BeforeTargets="CoreCompile"
Inputs="@(StreamTemplate)"
Outputs="@(StreamTemplate->'%(OutputFile)')">
<Exec Command="dotnet-codegencs template run %(StreamTemplate.Identity) -o generated"
WorkingDirectory="$(ProjectDir)"/>
</Target>
|
The Generator generates correct files for me, and places them right by the side of the .csx file.
However, the compile process fails and expects the file in the project root.
I'd rather have the file right beside the .csx file, or in another subdirectory.
The text was updated successfully, but these errors were encountered: