mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-03-12 23:01:44 +01:00
Fix casing problem, part II
This commit is contained in:
parent
16346a7743
commit
a7f3c71960
@ -0,0 +1,114 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
<PropertyGroup>
|
||||||
|
<TargetFrameworks>net471;netcoreapp2.1</TargetFrameworks>
|
||||||
|
<SignAssembly>false</SignAssembly>
|
||||||
|
|
||||||
|
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
|
||||||
|
<NoPackageAnalysis>true</NoPackageAnalysis>
|
||||||
|
|
||||||
|
<PublishRepositoryUrl>true</PublishRepositoryUrl>
|
||||||
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
|
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
|
||||||
|
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||||
|
<FileVersion>1.0.0.0</FileVersion>
|
||||||
|
<Version>1.0-local$([System.DateTime]::UtcNow.ToString(yyMMddHHmm))</Version>
|
||||||
|
|
||||||
|
<NuspecFile>$(MSBuildThisFileDirectory)CapnpC.CSharp.MsBuild.Generation.nuspec</NuspecFile>
|
||||||
|
<NuspecProperties>version=$(Version);configuration=$(Configuration)</NuspecProperties>
|
||||||
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
||||||
|
<PackageOutputPath>..\bin\$(Configuration)</PackageOutputPath>
|
||||||
|
<Configurations>Debug;Release</Configurations>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Composition" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.SDK" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.ProjectSystem.SDK.Tools" />
|
||||||
|
<PackageReference Include="Microsoft.VisualStudio.Threading" />
|
||||||
|
<PackageReference Include="Microsoft.Xaml" />
|
||||||
|
<PackageReference Include="System.Collections.Immutable" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemDefinitionGroup>
|
||||||
|
<PackageReference>
|
||||||
|
<PrivateAssets>All</PrivateAssets>
|
||||||
|
</PackageReference>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Microsoft.Build.Framework" Version="15.8.166" />
|
||||||
|
<PackageReference Include="Microsoft.Build.Utilities.Core" Version="15.8.166" />
|
||||||
|
<PackageReference Update="@(PackageReference)" PrivateAssets="All" />
|
||||||
|
<PackageReference Update="Microsoft.VisualStudio.Composition" Version="15.8.98" />
|
||||||
|
<PackageReference Update="Microsoft.VisualStudio.ProjectSystem" Version="15.8.243" />
|
||||||
|
<PackageReference Update="Microsoft.VisualStudio.ProjectSystem.SDK" Version="15.8.243" />
|
||||||
|
<PackageReference Update="Microsoft.VisualStudio.ProjectSystem.SDK.Tools" Version="15.8.243" />
|
||||||
|
<PackageReference Update="Microsoft.VisualStudio.Threading" Version="16.3.52" />
|
||||||
|
<PackageReference Update="Microsoft.Xaml" Version="4.0.0.1" />
|
||||||
|
<PackageReference Update="System.Collections.Immutable" Version="1.5.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Remove="FrameworkDependent\**\*.cs" />
|
||||||
|
<Compile Include="FrameworkDependent\*.cs" />
|
||||||
|
<None Include="FrameworkDependent\**\*.cs" />
|
||||||
|
<Compile Include="FrameworkDependent\FullFramework\**\*.cs" Condition="'$(TargetFramework)' == '$(CapnpcCsharp_FullFramework_Tools_TFM)'" />
|
||||||
|
<Compile Include="FrameworkDependent\DotNetCore\**\*.cs" Condition="'$(TargetFramework)' == '$(CapnpcCsharp_Core_Tools_TFM)'" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="FrameworkDependent\DotNetCore\" />
|
||||||
|
<Folder Include="FrameworkDependent\FullFramework\" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\CapnpC.CSharp.Generator\CapnpC.CSharp.Generator.csproj">
|
||||||
|
<Private>true</Private>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Microsoft.Build">
|
||||||
|
<HintPath>Microsoft.Build</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Build.Framework">
|
||||||
|
<HintPath>Microsoft.Build.Framework</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Build.Utilities.Core">
|
||||||
|
<HintPath>Microsoft.Build.Utilities.Core</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.ComponentModel.Composition" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<None Update="buildMultiTargeting\CapnpC.CSharp.MsBuild.Generation.props">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="build\CapnpC.CSharp.MsBuild.Generation.props">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="build\CapnpC.CSharp.MsBuild.Generation.targets">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="build\CapnpC.CSharp.MsBuild.Generation.tasks">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="build\CPS\Buildsystem\CpsExtension.DesignTime.targets">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="build\CPS\Buildsystem\Rules\CapnpFileType.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
<None Update="build\CPS\Buildsystem\Rules\ProjectItemsSchema.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
</None>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="rmdir /s /q $(SolutionDir)MsBuildGenerationTest\obj" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,31 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>CapnpC.CSharp.MsBuild.Generation</id>
|
||||||
|
<version>$version$</version>
|
||||||
|
<title>CapnpC.CSharp.MsBuild.Generation</title>
|
||||||
|
<authors>Christian Köllner and contributors</authors>
|
||||||
|
<owners>Christian Köllner</owners>
|
||||||
|
<description>Package to enable the .capnp -> .cs file generation during build time</description>
|
||||||
|
<summary>Package to enable the .capnp -> .cs file generation during build time</summary>
|
||||||
|
<language>en-US</language>
|
||||||
|
<projectUrl>https://github.com/c80k/capnproto-dotnetcore</projectUrl>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<license type="expression">MIT</license>
|
||||||
|
<tags>capnproto csharp msbuild</tags>
|
||||||
|
<copyright>Christian Köllner and contributors</copyright>
|
||||||
|
<dependencies>
|
||||||
|
<dependency id="Capnp.Net.Runtime" version="1.0" />
|
||||||
|
</dependencies>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<file src="build\**\*" target="build" />
|
||||||
|
<file src="buildMultiTargeting\**\*" target="buildMultiTargeting" />
|
||||||
|
<file src="bin\$configuration$\net471\*.dll" target="tasks\net471" />
|
||||||
|
<file src="bin\$configuration$\netcoreapp2.1\*.dll" target="tasks\netcoreapp2.1" />
|
||||||
|
<file src="bin\$configuration$\netcoreapp2.1\*.deps.json" target="tasks\netcoreapp2.1" />
|
||||||
|
|
||||||
|
<file src="..\Licenses\**\*" target="licenses" />
|
||||||
|
<file src="..\LICENSE" target="LICENSE" />
|
||||||
|
</files>
|
||||||
|
</package>
|
@ -0,0 +1,15 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<CpsExtensionSchemaDirectory Condition="'$(CpsExtensionSchemaDirectory)' == ''">$(MSBuildThisFileDirectory)Rules\</CpsExtensionSchemaDirectory>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PropertyPageSchema Include="$(CpsExtensionSchemaDirectory)\ProjectItemsSchema.xaml;"/>
|
||||||
|
|
||||||
|
<PropertyPageSchema Include="$(CpsExtensionSchemaDirectory)\CapnpFileType.xaml;">
|
||||||
|
<Context>File;BrowseObject</Context>
|
||||||
|
</PropertyPageSchema>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--Copyright, Microsoft Corporation, All rights reserved.-->
|
||||||
|
|
||||||
|
<Rule
|
||||||
|
Name="Capnp"
|
||||||
|
DisplayName="Cap'n Proto"
|
||||||
|
PageTemplate="tool"
|
||||||
|
Description="Cap'n Proto schema file"
|
||||||
|
xmlns="http://schemas.microsoft.com/build/2009/properties">
|
||||||
|
|
||||||
|
<Rule.DataSource>
|
||||||
|
<DataSource Persistence="ProjectFile" HasConfigurationCondition="True" ItemType="CapnpFiles" />
|
||||||
|
</Rule.DataSource>
|
||||||
|
|
||||||
|
|
||||||
|
<StringProperty Name="Identity" DisplayName="File Name" ReadOnly="true" Category="Misc">
|
||||||
|
<StringProperty.DataSource>
|
||||||
|
<DataSource Persistence="Intrinsic" ItemType="CapnpFiles" PersistedName="Identity" />
|
||||||
|
</StringProperty.DataSource>
|
||||||
|
</StringProperty>
|
||||||
|
|
||||||
|
<StringProperty Name="FullPath" DisplayName="Full Path" ReadOnly="true" Category="Misc">
|
||||||
|
<StringProperty.DataSource>
|
||||||
|
<DataSource Persistence="Intrinsic" ItemType="CapnpFiles" PersistedName="FullPath" />
|
||||||
|
</StringProperty.DataSource>
|
||||||
|
</StringProperty>
|
||||||
|
|
||||||
|
<StringProperty Name="DependentUpon" Visible="false" />
|
||||||
|
<StringProperty Name="Link" Visible="false" />
|
||||||
|
<!--<StringProperty Name="Generator" Visible="true" DisplayName="Custom Tool"/>-->
|
||||||
|
|
||||||
|
<!--<BoolProperty Name="Exclude" DisplayName="Exclude from build" Category="Misc" Visible="True"
|
||||||
|
Description="Whether to skip code generation for this item"/>-->
|
||||||
|
|
||||||
|
<StringProperty Name="WorkingDirectory" DisplayName="Working Directory" ReadOnly="false" Category="Misc" Visible="True"
|
||||||
|
Subtype="Folder" Description="Working directory for capnp"/>
|
||||||
|
|
||||||
|
<StringListProperty Name="ImportPaths" DisplayName="Import Paths" Category="Misc" Visible="True" Subtype="Folder"
|
||||||
|
Description="List of directories searched for non-relative imports (ones that start with a '/')"/>
|
||||||
|
|
||||||
|
<StringProperty Name="SourcePrefix" DisplayName="Source Prefix" Switch="src-prefix" SwitchPrefix="--" Category="Misc" Visible="True"
|
||||||
|
Description="If a file specified for compilation starts with the specified prefix, remove the prefix for the purpose of deciding the names of output files."/>
|
||||||
|
|
||||||
|
<BoolProperty Name="Verbose" DisplayName="Verbose" Switch="verbose" SwitchPrefix="--" Category="Misc" Visible="True"
|
||||||
|
Description="Log informational messages to stderr; useful for debugging."/>
|
||||||
|
</Rule>
|
@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--Copyright, Microsoft Corporation, All rights reserved.-->
|
||||||
|
<ProjectSchemaDefinitions
|
||||||
|
xmlns="http://schemas.microsoft.com/build/2009/properties">
|
||||||
|
|
||||||
|
<ContentType
|
||||||
|
Name="CapnpFile"
|
||||||
|
DisplayName="CapnpFileType source file"
|
||||||
|
ItemType="CapnpFiles">
|
||||||
|
<NameValuePair Name="DependentExtensions" Value=".capnp.cs" />
|
||||||
|
</ContentType>
|
||||||
|
|
||||||
|
<ItemType Name="CapnpFiles" DisplayName="Cap'n Proto schema file"/>
|
||||||
|
|
||||||
|
<FileExtension Name=".capnp" ContentType="CapnpFile" />
|
||||||
|
|
||||||
|
</ProjectSchemaDefinitions>
|
||||||
|
|
@ -0,0 +1,78 @@
|
|||||||
|
<Project TreatAsLocalProperty="TaskFolder;TaskAssembly">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<CapnpcCsharp_CpsExtensionDesignTimeTargetsPath Condition="'$(CapnpcCsharp_CpsExtensionDesignTimeTargetsPath)' == ''">$(MSBuildThisFileDirectory)CPS\Buildsystem\CpsExtension.DesignTime.targets</CapnpcCsharp_CpsExtensionDesignTimeTargetsPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Import Project="$(CapnpcCsharp_CpsExtensionDesignTimeTargetsPath)" Condition="'$(DesignTimeBuild)' == 'true' " />
|
||||||
|
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<CapnpcCsharp_UseHostCompilerIfAvailable Condition="'$(CapnpcCsharp_UseHostCompilerIfAvailable)'==''">false</CapnpcCsharp_UseHostCompilerIfAvailable>
|
||||||
|
<UseHostCompilerIfAvailable>$(CapnpcCsharp_UseHostCompilerIfAvailable)</UseHostCompilerIfAvailable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OverwriteReadOnlyFiles Condition="'$(OverwriteReadOnlyFiles)'==''">false</OverwriteReadOnlyFiles>
|
||||||
|
<ForceGeneration Condition="'$(ForceGeneration)'==''">false</ForceGeneration>
|
||||||
|
|
||||||
|
<ShowTrace Condition="'$(ShowTrace)'==''">false</ShowTrace>
|
||||||
|
<VerboseOutput Condition="'$(VerboseOutput)'==''">true</VerboseOutput>
|
||||||
|
<CapnpcCsharp_DebugMSBuildTask Condition="'$(CapnpcCsharp_DebugMSBuildTask)' == ''">false</CapnpcCsharp_DebugMSBuildTask>
|
||||||
|
|
||||||
|
<_CapnpcCsharpPropsImported Condition="'$(_CapnpcCsharpPropsImported)'==''">true</_CapnpcCsharpPropsImported>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
property group for feature flags
|
||||||
|
-->
|
||||||
|
<PropertyGroup>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
feature flag to enable experimental support for cleaning up generated code-behind files during rebuild and clean scenarios
|
||||||
|
-->
|
||||||
|
<CapnpcCsharp_DeleteCodeBehindFilesOnCleanRebuild Condition="'$(CapnpcCsharp_DeleteCodeBehindFilesOnCleanRebuild)'==''">false</CapnpcCsharp_DeleteCodeBehindFilesOnCleanRebuild>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
net.sdk support: feature flag to enable experimental support for net.sdk project system
|
||||||
|
-->
|
||||||
|
<CapnpcCsharp_EnableDefaultCompileItems Condition="'$(CapnpcCsharp_EnableDefaultCompileItems)'==''">true</CapnpcCsharp_EnableDefaultCompileItems>
|
||||||
|
<CapnpcCsharp_EnableWarnForFeatureCodeBehindFilesWithoutCorrespondingCapnpFile Condition="'$(CapnpcCsharp_EnableWarnForFeatureCodeBehindFilesWithoutCorrespondingCapnpFile)'==''">$(CapnpcCsharp_EnableDefaultCompileItems)</CapnpcCsharp_EnableWarnForFeatureCodeBehindFilesWithoutCorrespondingCapnpFile>
|
||||||
|
|
||||||
|
<DefaultItemExcludes>$(DefaultItemExcludes);**/*.capnp</DefaultItemExcludes>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<CapnpFiles Include="**\*.capnp" >
|
||||||
|
<CodeBehindFile>%(RelativeDir)%(Filename).capnp.cs</CodeBehindFile>
|
||||||
|
<Visible>$(UsingMicrosoftNETSdk)</Visible>
|
||||||
|
<WorkingDirectory>$(ProjectDir)</WorkingDirectory>
|
||||||
|
</CapnpFiles>
|
||||||
|
|
||||||
|
<!-- obsolete codebehind files, scenarios:
|
||||||
|
- after rename operation
|
||||||
|
- after deletion of a feature file
|
||||||
|
- after pulling latest changes from version control with above changes
|
||||||
|
-->
|
||||||
|
<CapnpCsharpObsoleteCodeBehindFiles Include="**\*.capnp.cs" Exclude="@(CapnpFiles->'%(CodeBehindFile)')" />
|
||||||
|
|
||||||
|
<!-- Support for Visual Studio Incremental Build
|
||||||
|
https://github.com/techtalk/SpecFlow/issues/1319
|
||||||
|
-->
|
||||||
|
<UpToDateCheckInput Include="@(CapnpFiles)" />
|
||||||
|
<UpToDateCheckBuild Include="@(CapnpFiles->'%(CodeBehindFile)')" Original="@(CapnpFiles)" />
|
||||||
|
<CustomAdditionalCompileInputs Include="@(CapnpFiles->'%(CodeBehindFile)')" />
|
||||||
|
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<_CapnpcCsharp_TaskFolder Condition=" '$(MSBuildRuntimeType)' == 'Core' And '$(_CapnpcCsharp_TaskFolder)' == ''">netcoreapp2.1</_CapnpcCsharp_TaskFolder>
|
||||||
|
<_CapnpcCsharp_TaskFolder Condition=" '$(MSBuildRuntimeType)' != 'Core' And '$(_CapnpcCsharp_TaskFolder)' == ''">net471</_CapnpcCsharp_TaskFolder>
|
||||||
|
<_CapnpcCsharp_TaskAssembly Condition=" '$(_CapnpcCsharp_TaskAssembly)' == '' ">..\tasks\$(_CapnpcCsharp_TaskFolder)\CapnpC.CSharp.MsBuild.Generation.dll</_CapnpcCsharp_TaskAssembly>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Import Project="CapnpC.CSharp.MsBuild.Generation.tasks"/>
|
||||||
|
|
||||||
|
</Project>
|
@ -0,0 +1,133 @@
|
|||||||
|
<Project>
|
||||||
|
|
||||||
|
<Import Project="CapnpC.CSharp.MsBuild.Generation.props" Condition="'$(_CapnpcCsharpPropsImported)'==''"/>
|
||||||
|
|
||||||
|
<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="WarnForCapnpCsharpCodeBehindFilesWithoutCorrespondingCapnpFile" AfterTargets="CoreCompile"
|
||||||
|
Condition="'$(CapnpcCsharp_EnableWarnForFeatureCodeBehindFilesWithoutCorrespondingCapnpFile)' == 'true'">
|
||||||
|
<Warning Text="For codebehind file '@(CapnpCsharpObsoleteCodeBehindFiles)', no capnp file was found." File="@(CapnpCsharpObsoleteCodeBehindFiles)" Condition="'@(CapnpCsharpObsoleteCodeBehindFiles)' != ''" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
|
||||||
|
<Target Name="SwitchToForceGenerate">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ForceGeneration>true</ForceGeneration>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
|
||||||
|
<Target Name="UpdateCapnpFilesInProject"
|
||||||
|
DependsOnTargets="BeforeUpdateCapnpFilesInProject">
|
||||||
|
|
||||||
|
<Message Text="CapnpFiles: @(CapnpFiles)" Importance="high" Condition="'$(VerboseOutput)' == 'true'" />
|
||||||
|
|
||||||
|
<GenerateCapnpFileCodeBehindTask
|
||||||
|
ProjectPath="$(MSBuildProjectFullPath)"
|
||||||
|
CapnpFiles="@(CapnpFiles)" >
|
||||||
|
|
||||||
|
<Output TaskParameter="GeneratedFiles" ItemName="CapnpcCsharpGeneratedFiles" />
|
||||||
|
</GenerateCapnpFileCodeBehindTask>
|
||||||
|
|
||||||
|
<Message Text="CapnpcCsharpGeneratedFiles: %(CapnpcCsharpGeneratedFiles.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="@(CapnpCsharpObsoleteCodeBehindFiles)" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="BeforeUpdateCapnpFilesInProject">
|
||||||
|
|
||||||
|
</Target>
|
||||||
|
|
||||||
|
<Target Name="IncludeCodeBehindFilesInProject" DependsOnTargets="UpdateCapnpFilesInProject">
|
||||||
|
<ItemGroup Condition="'$(UsingMicrosoftNETSdk)' != 'true'">
|
||||||
|
<Compile Include="@(CapnpcCsharpGeneratedFiles)" 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 capnp files -->
|
||||||
|
<Delete Files="%(CapnpFiles.CodeBehindFile)" ContinueOnError="true" />
|
||||||
|
|
||||||
|
<!-- remove obsolete codebehind files, scenarios:
|
||||||
|
- after rename operation
|
||||||
|
- after deletion of a capnp file
|
||||||
|
- after pulling latest changes from version control with above changes
|
||||||
|
-->
|
||||||
|
<Delete Files="@(CapnpCsharpObsoleteCodeBehindFiles)" ContinueOnError="true" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
@ -0,0 +1,3 @@
|
|||||||
|
<Project>
|
||||||
|
<UsingTask TaskName="CapnpC.CSharp.MsBuild.Generation.GenerateCapnpFileCodeBehindTask" AssemblyFile="$(_CapnpcCsharp_TaskAssembly)" />
|
||||||
|
</Project>
|
@ -0,0 +1,5 @@
|
|||||||
|
<Project TreatAsLocalProperty="TaskFolder;TaskAssembly">
|
||||||
|
|
||||||
|
<Import Project="..\build\CapnpC.CSharp.MsBuild.Generation.props"/>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
x
Reference in New Issue
Block a user