Skip to content

Commit

Permalink
Always Create Code Generation Root for StrawberryShake (#6229)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelstaib committed Jun 1, 2023
1 parent 35b5fa4 commit 49acfea
Showing 1 changed file with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@
<Target
Name="GenerateGraphQLCode"
BeforeTargets="BeforeBuild"
DependsOnTargets="_GenerateGraphQLCode">
DependsOnTargets="_GraphQLCodeGenerationRoot; _GenerateGraphQLCode">
<ItemGroup>
<Compile Include="$(GraphQLCodeGenerationRoot)\**\*.cs" />
</ItemGroup>
</Target>

<Target
Name="_GraphQLCodeGenerationRoot">
<PropertyGroup>
<GraphQLCodeGenerationRoot>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)berry'))</GraphQLCodeGenerationRoot>
</PropertyGroup>
</Target>

<Target Name="_ParseVersion">
<Exec Command="dotnet --version" StandardOutputImportance="Low" ConsoleToMsBuild="true">
<Output TaskParameter="ConsoleOutput" PropertyName="DotNetVersion" />
Expand All @@ -34,7 +41,7 @@
Name="_GenerateGraphQLCode"
Inputs="@(GenerateGraphQLCodeItems)"
Outputs="$(MSBuildProjectDirectory)\$(IntermediateOutputPath)berry\.build.info"
DependsOnTargets="_ParseVersion"
DependsOnTargets="_ParseVersion;_GraphQLCodeGenerationRoot"
Condition="'@(GraphQL)' != ''">

<PropertyGroup>
Expand All @@ -47,7 +54,6 @@
Condition="'$(DotNetMajor)' != '6' AND '$(DotNetMajor)' != '7'" />

<PropertyGroup>
<GraphQLCodeGenerationRoot>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)berry'))</GraphQLCodeGenerationRoot>
<GraphQLQueryGenerationRoot>$(MSBuildProjectDirectory)\$(GraphQLPersistedQueryOutput.TrimEnd('/').TrimEnd('\'))</GraphQLQueryGenerationRoot>
<GenTool Condition="'$(DotNetMajor)' == '6'">$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net6", "dotnet-graphql.dll"))</GenTool>
<GenTool Condition="'$(DotNetMajor)' == '7'">$([System.IO.Path]::Combine($(MSBuildThisFileDirectory), "..", "tools", "net7", "dotnet-graphql.dll"))</GenTool>
Expand Down

0 comments on commit 49acfea

Please sign in to comment.