Skip to content

Commit

Permalink
Disable parallel building due to T4 for simplicity
Browse files Browse the repository at this point in the history
  • Loading branch information
atifaziz committed Dec 27, 2020
1 parent 4cf0359 commit 2abc6a9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
7 changes: 3 additions & 4 deletions MoreLinq/MoreLinq.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@
<LangVersion>9</LangVersion>
<Nullable>enable</Nullable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<!-- Parallel build is disabled to avoid file locking issues during T4 code generation.
See also: https://github.com/dotnet/msbuild/issues/2781 -->
<BuildInParallel>false</BuildInParallel>
<DebugType>portable</DebugType>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<AssemblyName>MoreLinq</AssemblyName>
Expand Down Expand Up @@ -263,10 +266,6 @@
</Target>

<Target Name="_TransformTextTemplate" Inputs="$(TextTemplate)" Outputs="$(TextTemplateOutput)">
<!-- Parallel build is unsupported here to avoid file locking issues.
See also: https://github.com/dotnet/msbuild/issues/2781 -->
<Error Condition="'$(BuildInParallel)' == 'true'"
Text="Parallel build is unsupported for T4 code generation. Re-build with the switch &#34;-p:BuildInParallel=false&#34;." />
<Exec Command="dotnet t4 -h > /dev/null" IgnoreExitCode="True" Condition="'$(WINDIR)' == ''">
<Output TaskParameter="ExitCode" PropertyName="_TestExitCode" />
</Exec>
Expand Down
1 change: 0 additions & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ if "%1"=="docs" shift & goto :docs
dotnet restore && dotnet tool restore ^
&& call :codegen MoreLinq\Extensions.g.cs -x "[/\\]ToDataTable\.cs$" -u System.Linq -u System.Collections MoreLinq ^
&& call :codegen MoreLinq\Extensions.ToDataTable.g.cs -i "[/\\]ToDataTable\.cs$" -u System.Data -u System.Linq.Expressions MoreLinq ^
&& dotnet build MoreLinq -t:TransformTextTemplates -p:BuildInParallel=false ^
&& for %%i in (debug release) do dotnet build -c %%i --no-restore %* || exit /b 1
goto :EOF

Expand Down
1 change: 0 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ codegen() {
}
codegen MoreLinq/Extensions.g.cs -x "[/\\\\]ToDataTable\.cs$" -u System.Linq -u System.Collections MoreLinq
codegen MoreLinq/Extensions.ToDataTable.g.cs -i "[/\\\\]ToDataTable\.cs$" -u System.Data -u System.Linq.Expressions MoreLinq
dotnet build MoreLinq -t:TransformTextTemplates -p:BuildInParallel=false
if [[ -z "$1" ]]; then
configs="Debug Release"
else
Expand Down

0 comments on commit 2abc6a9

Please sign in to comment.