From 2d8a3d5f8ed9a81661271d92163ccf75707a91d8 Mon Sep 17 00:00:00 2001 From: Atif Aziz Date: Sat, 21 Jan 2023 13:14:21 +0100 Subject: [PATCH] Revert "Integrate templated code generation into project file (#776)" This reverts commit f669558facbbec9269a466c81594d5db8a19b4d1. --- MoreLinq/MoreLinq.csproj | 30 ------------------------------ MoreLinq/tt.cmd | 8 ++++++++ MoreLinq/tt.sh | 4 ++++ build.cmd | 1 + build.sh | 1 + 5 files changed, 14 insertions(+), 30 deletions(-) create mode 100644 MoreLinq/tt.cmd create mode 100755 MoreLinq/tt.sh diff --git a/MoreLinq/MoreLinq.csproj b/MoreLinq/MoreLinq.csproj index b07b9a2bd..b357ef6c4 100644 --- a/MoreLinq/MoreLinq.csproj +++ b/MoreLinq/MoreLinq.csproj @@ -157,7 +157,6 @@ - TextTemplatingFileGenerator Aggregate.g.cs @@ -248,33 +247,4 @@ - - - - %(None.LastGenOutput) - - - - - - - - - - - - - - - - - - - - - diff --git a/MoreLinq/tt.cmd b/MoreLinq/tt.cmd new file mode 100644 index 000000000..cbb7ac281 --- /dev/null +++ b/MoreLinq/tt.cmd @@ -0,0 +1,8 @@ +@echo off +pushd "%~dp0" +for /f "tokens=*" %%f in ('dir /s /b *.tt') do ( + echo>&2 dotnet t4 "%%f" + dotnet t4 "%%f" || goto :end +) +:end +popd diff --git a/MoreLinq/tt.sh b/MoreLinq/tt.sh new file mode 100755 index 000000000..49be91c70 --- /dev/null +++ b/MoreLinq/tt.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash +set -e +cd "$(dirname "$0")" +find . -name "*.tt" -print0 | xargs -0 -t -L 1 sh -c '(dotnet t4 "$0" || exit 255)' diff --git a/build.cmd b/build.cmd index 18923a015..ae3dbc0db 100644 --- a/build.cmd +++ b/build.cmd @@ -13,6 +13,7 @@ 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 ^ + && call MoreLinq\tt ^ && for %%i in (debug release) do dotnet build -c %%i --no-restore %* || exit /b 1 goto :EOF diff --git a/build.sh b/build.sh index 7d188c377..ac7f75b51 100755 --- a/build.sh +++ b/build.sh @@ -12,6 +12,7 @@ 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 +MoreLinq/tt.sh if [[ -z "$1" ]]; then configs="Debug Release" else