Skip to content

Commit 7c55004

Browse files
committed
Upgrade AsyncGenerator to 0.19.0
1 parent eb137cc commit 7c55004

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

build-common/common.xml

+18-1
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,27 @@
4747
<property name="tools.dir" value="${root.dir}/Tools"/>
4848
</target>
4949

50-
<target name="common.tools-restore" depends="common.init">
50+
<target name="common.tools-restore" depends="common.init common.get-dotnet-version">
5151
<exec workingdir="${root.dir}/Tools" program="dotnet" verbose="true">
5252
<arg line="restore ./packages.csproj --packages ." />
5353
</exec>
5454
</target>
5555

56+
<target name="common.get-dotnet-version">
57+
<property name="dotnet.version.file" value="${root.dir}/Tools/dotnet.version" />
58+
<exec workingdir="${root.dir}/Tools" program="dotnet" output="${dotnet.version.file}">
59+
<arg line="--version" />
60+
</exec>
61+
<loadfile file="${dotnet.version.file}" property="dotnet.version.content" />
62+
<delete file="${dotnet.version.file}" />
63+
<echo message="dotnet version: ${string::trim(dotnet.version.content)}" />
64+
<if test="${string::index-of(dotnet.version.content, '-') == -1}">
65+
<property name="dotnet.version" value="${version::parse(string::trim(dotnet.version.content))}" />
66+
</if>
67+
<!-- For preview versions we have to substring until - character. Example: 5.0.100-preview.2.20176.6 -->
68+
<if test="${string::index-of(dotnet.version.content, '-') != -1}">
69+
<property name="dotnet.version" value="${version::parse(string::trim(string::substring(dotnet.version.content, 0, string::index-of(dotnet.version.content, '-'))))}" />
70+
</if>
71+
</target>
72+
5673
</project>

default.build

+7-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@
6767
<target name="find-async-generator-console">
6868
<property name="tool.id" value="CSharpAsyncGenerator.CommandLine" />
6969
<call target="get-tool-info" />
70-
<property name="async-generator-console" value="${tool.path}tools/netcoreapp2.1/AsyncGenerator.CommandLine.dll" />
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 and version::get-minor(version::parse(dotnet.version)) >= 1}">
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>
7177
</target>
7278

7379
<target name="generate-async" depends="solution-restore find-async-generator-console">

0 commit comments

Comments
 (0)