mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 14:51:41 +01:00
145 lines
6.5 KiB
XML
145 lines
6.5 KiB
XML
<Project>
|
|
|
|
<Import Project="Capnpc.Csharp.MsBuild.Generation.props" Condition="'$(_SpecFlowPropsImported)'==''"/>
|
|
|
|
<PropertyGroup Condition="'$(BuildServerMode)' == ''">
|
|
<BuildServerMode Condition="'$(BuildingInsideVisualStudio)'=='true'">false</BuildServerMode>
|
|
<BuildServerMode Condition="'$(BuildingInsideVisualStudio)'!='true'">true</BuildServerMode>
|
|
|
|
<!--
|
|
net.sdk experimental support:
|
|
- currently we only want to support either classic project system or netsdk project system.
|
|
- currently we don't want to support globbing with classic project system => ensure globbing only get enabled with 'UsingMicrosoftNETSdk'
|
|
- currently we are supporting $(EnableDefaultCompileItems) for disabling globbing support for codebehind files
|
|
-->
|
|
<_CapnpcCsharp_EnableDefaultCompileItems Condition="'$(CapnpcCsharp_EnableDefaultCompileItems)' == '' And '$(UsingMicrosoftNETSdk)' == 'true'">true</_CapnpcCsharp_EnableDefaultCompileItems>
|
|
<_CapnpcCsharp_EnableDefaultCompileItems Condition="'$(CapnpcCsharp_EnableDefaultCompileItems)' == 'true' And '$(UsingMicrosoftNETSdk)' == 'true'">true</_CapnpcCsharp_EnableDefaultCompileItems>
|
|
</PropertyGroup>
|
|
|
|
<PropertyGroup>
|
|
<BuildDependsOn>
|
|
BeforeUpdateCapnpFilesInProject;
|
|
UpdateCapnpFilesInProject;
|
|
IncludeCodeBehindFilesInProject;
|
|
AfterUpdateCapnpFilesInProject;
|
|
$(BuildDependsOn)
|
|
</BuildDependsOn>
|
|
<CleanDependsOn>
|
|
CleanCapnpFilesInProject;
|
|
$(CleanDependsOn)
|
|
</CleanDependsOn>
|
|
<RebuildDependsOn>
|
|
SwitchToForceGenerate;
|
|
$(RebuildDependsOn)
|
|
</RebuildDependsOn>
|
|
</PropertyGroup>
|
|
|
|
<!--
|
|
net.sdk support: update default compile items to show generated files as nested items
|
|
-->
|
|
<ItemGroup Condition="'$(_CapnpcCsharp_EnableDefaultCompileItems)' == 'true' and '$(EnableDefaultItems)' == 'true' ">
|
|
<Compile Update="@(CapnpFiles->'%(CodeBehindFile)')"
|
|
DependentUpon="%(Filename)"
|
|
AutoGen="true"
|
|
DesignTime="true"
|
|
Visible="true"
|
|
Condition="'$(EnableDefaultCompileItems)' == 'true'" />
|
|
|
|
</ItemGroup>
|
|
|
|
|
|
<Target Name="WarnForFeatureCodeBehindFilesWithoutCorrespondingFeatureFile" AfterTargets="CoreCompile"
|
|
Condition="'$(CapnpcCsharp_EnableWarnForFeatureCodeBehindFilesWithoutCorrespondingFeatureFile)' == 'true'">
|
|
<Warning Text="For codebehind file '@(SpecFlowObsoleteCodeBehindFiles)', no feature file was found." File="@(SpecFlowObsoleteCodeBehindFiles)" Condition="'@(SpecFlowObsoleteCodeBehindFiles)' != ''" />
|
|
</Target>
|
|
|
|
|
|
<Target Name="SwitchToForceGenerate">
|
|
<PropertyGroup>
|
|
<ForceGeneration>true</ForceGeneration>
|
|
</PropertyGroup>
|
|
</Target>
|
|
|
|
|
|
<Target Name="UpdateCapnpFilesInProject"
|
|
DependsOnTargets="BeforeUpdateCapnpFilesInProject">
|
|
|
|
<Message Text="CapnpFiles: @(CapnpFiles)" Importance="high" Condition="'$(VerboseOutput)' == 'true'" />
|
|
|
|
<Error
|
|
Text="CapnpCsharp codebehind generation is not compatible with MSBuild codebehind generation. The custom tool must be removed from the file."
|
|
File="@(None)"
|
|
Condition="%(None.Extension) == '.feature' AND %(None.Generator) == 'SpecFlowSingleFileGenerator'"/>
|
|
|
|
<!-- <PropertyGroup>
|
|
<SpecFlowCodeBehindOutputPath Condition="'$(SpecFlowCodeBehindOutputPath)' == ''">Features.Generated</SpecFlowCodeBehindOutputPath>
|
|
</PropertyGroup> -->
|
|
|
|
<GenerateFeatureFileCodeBehindTask
|
|
ProjectPath="$(MSBuildProjectFullPath)"
|
|
OutputPath="$(SpecFlowCodeBehindOutputPath)"
|
|
CapnpFiles="@(CapnpFiles)"
|
|
RootNamespace="$(RootNamespace)"
|
|
GeneratorPlugins="@(SpecFlowGeneratorPlugins)" >
|
|
|
|
<Output TaskParameter="GeneratedFiles" ItemName="CapnpCsharpGeneratedFiles" />
|
|
</GenerateFeatureFileCodeBehindTask>
|
|
|
|
<Message Text="CapnpCsharpGeneratedFiles: %(CapnpCsharpGeneratedFiles.Identity)" Importance="high" Condition="'$(VerboseOutput)' == 'true'" />
|
|
|
|
|
|
<!--
|
|
net.sdk support: globbing does not support including files which are dynamically generated inside targets, we have to manually update compile items
|
|
-->
|
|
<ItemGroup Condition="'$(_CapnpcCsharp_EnableDefaultCompileItems)' == 'true' and '$(EnableDefaultItems)' == 'true' and '$(EnableDefaultCompileItems)' == 'true'">
|
|
|
|
<!-- if this is the first time generation of codebehind files, we have to manually add them as compile items -->
|
|
<Compile Include="@(CapnpFiles->'%(CodeBehindFile)')"
|
|
Exclude="@(Compile)"/>
|
|
|
|
<!--
|
|
eather if codebehind files are added manually to compile item group or are added by net.sdk globbing support,
|
|
ensure they are nested under feature files like in previous specflow versions
|
|
currently, we cannot use itemgroup update attribute inside a target because of some bugs in MSBuild (all items will be updated)
|
|
- https://github.com/Microsoft/msbuild/issues/1618
|
|
- https://github.com/Microsoft/msbuild/issues/2835
|
|
- https://github.com/Microsoft/msbuild/issues/1124
|
|
-->
|
|
<Compile DependentUpon="@(CapnpFiles)"
|
|
AutoGen="true"
|
|
DesignTime="true"
|
|
Visible="true"
|
|
Condition="'%(Compile.Identity)' == '@(CapnpFiles->'%(CodeBehindFile)')'" />
|
|
|
|
<!-- remove files which got obsolete, typically after rename operation, or getting changes from source control -->
|
|
<Compile Remove="@(SpecFlowObsoleteCodeBehindFiles)" />
|
|
</ItemGroup>
|
|
|
|
</Target>
|
|
|
|
<Target Name="BeforeUpdateCapnpFilesInProject">
|
|
|
|
</Target>
|
|
|
|
<Target Name="IncludeCodeBehindFilesInProject" DependsOnTargets="UpdateCapnpFilesInProject">
|
|
<ItemGroup Condition="'$(UsingMicrosoftNETSdk)' != 'true'">
|
|
<Compile Include="@(CapnpCsharpGeneratedFiles)" Exclude="@(Compile)" />
|
|
</ItemGroup>
|
|
</Target>
|
|
|
|
<Target Name="AfterUpdateCapnpFilesInProject" DependsOnTargets="IncludeCodeBehindFilesInProject">
|
|
<!-- include any generated SpecFlow files in the compilation of the project if not included yet -->
|
|
</Target>
|
|
|
|
<Target Name="CleanCapnpFilesInProject" Condition="'$(CapnpcCsharp_DeleteCodeBehindFilesOnCleanRebuild)' == 'true'">
|
|
<!-- remove known codebehind files for existing feature files -->
|
|
<Delete Files="%(CapnpFiles.CodeBehindFile)" ContinueOnError="true" />
|
|
|
|
<!-- remove obsolete codebehind files, scenarios:
|
|
- after rename operation
|
|
- after deletion of a feature file
|
|
- after pulling latest changes from version control with above changes
|
|
-->
|
|
<Delete Files="@(SpecFlowObsoleteCodeBehindFiles)" ContinueOnError="true" />
|
|
</Target>
|
|
</Project> |