Skip to content

Commit c5dd9fe

Browse files
committed
use c# async generator tool
1 parent ffb5523 commit c5dd9fe

File tree

6 files changed

+25
-39
lines changed

6 files changed

+25
-39
lines changed

.config/dotnet-tools.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"version": 1,
3+
"isRoot": true,
4+
"tools": {
5+
"csharpasyncgenerator.tool": {
6+
"version": "0.19.1",
7+
"commands": [
8+
"async-generator"
9+
]
10+
}
11+
}
12+
}

ShowBuildMenu.sh

+3-24
Original file line numberDiff line numberDiff line change
@@ -178,36 +178,15 @@ testRun(){
178178
}
179179

180180
generateAsync(){
181-
dotnet restore ./src/NHibernate.sln
182-
183-
getAsyncGeneratorPath
184181
cd src
185-
dotnet ../"$async_generator_path"
182+
dotnet tool restore
183+
dotnet restore ./NHibernate.sln
184+
dotnet async-generator
186185
cd ..
187186

188187
mainMenu
189188
}
190189

191-
getAsyncGeneratorPath(){
192-
if [ "$async_generator_path" ]
193-
then
194-
return
195-
fi
196-
197-
cd Tools
198-
199-
async_generator_version="$(cat packages.csproj | grep Include=\"CSharpAsyncGenerator.CommandLine | cut -d\" -f4)"
200-
async_generator_path="csharpasyncgenerator.commandline/$async_generator_version/tools"
201-
202-
if [ ! -d $async_generator_path ]
203-
then
204-
dotnet restore "./packages.csproj" --packages .
205-
fi
206-
207-
async_generator_path="Tools/$async_generator_path/netcoreapp2.1/AsyncGenerator.CommandLine.dll"
208-
cd ..
209-
}
210-
211190
mainMenu() {
212191
echo "========================= NHIBERNATE BUILD MENU =========================="
213192
echo "--- TESTING ---"

Tools/packages.csproj

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
</ItemGroup>
1212

1313
<ItemGroup>
14-
<PackageReference Include="CSharpAsyncGenerator.CommandLine" Version="0.19.1" />
1514
<PackageReference Include="vswhere" Version="2.1.4" />
1615
<PackageReference Include="NUnit.Console" Version="3.10.0" />
1716
<PackageReference Include="GitReleaseManager" Version="0.11.0" />

build-common/common.xml

+3
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@
4848
</target>
4949

5050
<target name="common.tools-restore" depends="common.init common.get-dotnet-version">
51+
<exec workingdir="${root.dir}" program="dotnet" verbose="true">
52+
<arg line="tool restore" />
53+
</exec>
5154
<exec workingdir="${root.dir}/Tools" program="dotnet" verbose="true">
5255
<arg line="restore ./packages.csproj --packages ." />
5356
</exec>

default.build

+2-14
Original file line numberDiff line numberDiff line change
@@ -64,21 +64,9 @@
6464
<property name="tool.path" value="${tools.dir}/${tool.id}/${tool.version}/" />
6565
</target>
6666

67-
<target name="find-async-generator-console">
68-
<property name="tool.id" value="CSharpAsyncGenerator.CommandLine" />
69-
<call target="get-tool-info" />
70-
<property name="async-generator-console" value="${tool.path}tools/netcoreapp2.1/AsyncGenerator.CommandLine.dll" />
71-
<if test="${version::get-major(version::parse(dotnet.version)) == 3}">
72-
<property name="async-generator-console" value="${tool.path}tools/netcoreapp3.1/AsyncGenerator.CommandLine.dll" />
73-
</if>
74-
<if test="${version::get-major(version::parse(dotnet.version)) >= 5}">
75-
<property name="async-generator-console" value="${tool.path}tools/net5.0/AsyncGenerator.CommandLine.dll" />
76-
</if>
77-
</target>
78-
79-
<target name="generate-async" depends="solution-restore find-async-generator-console">
67+
<target name="generate-async" depends="solution-restore">
8068
<exec workingdir="${root.dir}/src" program="dotnet" verbose="true">
81-
<arg line=".${async-generator-console}" />
69+
<arg line="async-generator" />
8270
</exec>
8371
</target>
8472

global.json

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sdk": {
3+
"version": "5.0.100"
4+
}
5+
}

0 commit comments

Comments
 (0)