forked from kzu/InjectModuleInitializer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInjectModuleInitializer.csproj
127 lines (106 loc) · 7.15 KB
/
InjectModuleInitializer.csproj
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<RootNamespace>EinarEgilsson.Utilities.InjectModuleInitializer</RootNamespace>
<AssemblyName>InjectModuleInitializer</AssemblyName>
<TargetFrameworks>net35;net40;net45;netstandard2.0</TargetFrameworks>
<DefaultItemExcludes>*.binlog;Test\**\*.*;nuget\**\*.*</DefaultItemExcludes>
<AppendTargetFrameworkToOutputPath>true</AppendTargetFrameworkToOutputPath>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NoWarn>NU5105</NoWarn>
<Description>Enables module initialization, as described here: http://einaregilsson.com/module-initializers-in-csharp </Description>
<Company>Einar Egilsson</Company>
<Copyright>Copyright © Einar Egilsson 2009-2018</Copyright>
<Authors>Anateus</Authors>
<PackageId>Anateus.$(AssemblyName)</PackageId>
<PackageTags>module initializer assembly constructor</PackageTags>
<PackageLicenseUrl>https://github.com/einaregilsson/InjectModuleInitializer/blob/master/license.txt</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/einaregilsson/InjectModuleInitializer</PackageProjectUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<DevelopmentDependency>true</DevelopmentDependency>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<BuildOutputTargetFolder>tools</BuildOutputTargetFolder>
<TargetsForTfmSpecificBuildOutput>IncludeCecil</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net35' ">
<PackageReference Include="Mono.Cecil" Version="0.10.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'net40' or '$(TargetFramework)' == 'net45' ">
<PackageReference Include="Mono.Cecil" Version="0.11.4" PrivateAssets="all" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Mono.Cecil" Version="0.11.5" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="GitInfo" Version="2.2.0" PrivateAssets="all" />
</ItemGroup>
<!-- Need to use Include instead of Update attribute on outer build when using
multiple TargetFrameworks, because it doesn't include anything by default for the outer build.-->
<ItemGroup Condition=" '$(TargetFramework)' == '' ">
<None Include="InjectModuleInitializer.props" Pack="true" PackagePath="build\$(PackageId).props" />
<None Include="InjectModuleInitializer.targets" Pack="true" PackagePath="build\$(PackageId).targets" />
<None Include="readme.txt" Pack="true" PackagePath="readme.txt" />
</ItemGroup>
<Target Name="IncludeCecil" DependsOnTargets="ResolveAssemblyReferences">
<ItemGroup>
<BuildOutputInPackage Include="@(ReferencePath -> WithMetadataValue('NuGetPackageId', 'Mono.Cecil'))" />
</ItemGroup>
</Target>
<PropertyGroup Condition="'$(CI)' == ''">
<CI Condition="'$(APPVEYOR)' != '' or '$(TF_BUILD)' == 'true'">true</CI>
<CI Condition="'$(CI)' == ''">false</CI>
</PropertyGroup>
<!-- This custom entry target requires that PrepareForBuild is executed first, so that all build directories
are created, before they are used. -->
<Target Name="Version" DependsOnTargets="PrepareForBuildOnCrossTargeting;SetVersion">
<Message Importance="high" Text="PackageVersion=$(PackageVersion)
AssemblyVersion=$(AssemblyVersion)" />
<Message Text="##vso[build.updatebuildnumber]$(PackageVersion)" Importance="high" Condition="'$(TF_BUILD)' == 'true'" />
</Target>
<Target Name="_SetLocalCommits" BeforeTargets="_GitPopulateVersionInfo" Condition="'$(CI)' != 'true'">
<PropertyGroup>
<!-- Local builds should always be commit count +1, since we'll be always working on the next version to be published. -->
<GitCommits>$([MSBuild]::Add('$(GitCommits)', '1'))</GitCommits>
</PropertyGroup>
</Target>
<Target Name="_SetPrepareForBuildInnerTarget" Returns="@(InnerOutput)">
<PropertyGroup Condition="'$(InnerTargets)' == ''">
<InnerTargets>PrepareForBuild</InnerTargets>
</PropertyGroup>
</Target>
<Target Name="PrepareForBuildOnCrossTargeting"
DependsOnTargets="_SetPrepareForBuildInnerTarget;DispatchToInnerBuilds"
Condition="'$(IsCrossTargetingBuild)' == 'true'" />
<!-- '$(ExcludeRestorePackageImports)' == 'true' when invoking /t:Restore -->
<Target Name="SetVersion"
BeforeTargets="GetAssemblyVersion;GetPackageVersion;GenerateNuspec;Pack"
DependsOnTargets="GitVersion"
Condition="'$(ExcludeRestorePackageImports)' != 'true' and '$(GitInfoImported)' == 'true'">
<PropertyGroup>
<!-- PR builds are *always* prerelease -->
<!-- TFS case: BUILD_REASON=PullRequest and BUILD_SOURCEBRANCH=refs/pull/#/merge -->
<GitSemVerDashLabel Condition="'$(TF_BUILD)' == 'true' and '$(BUILD_REASON)' == 'PullRequest'">$(GitSemVerDashLabel)-pr$(BUILD_SOURCEBRANCH.Substring(10).TrimEnd('/merge'))</GitSemVerDashLabel>
<GitSemVerDashLabel Condition="'$(APPVEYOR_PULL_REQUEST_NUMBER)' != ''">$(GitSemVerDashLabel)-pr$(APPVEYOR_PULL_REQUEST_NUMBER)</GitSemVerDashLabel>
<!-- Adjust branch name to CI provided value if available -->
<GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' != ''">$(SYSTEM_PULLREQUEST_TARGETBRANCH)</GitBranch>
<GitBranch Condition="'$(SYSTEM_PULLREQUEST_TARGETBRANCH)' == '' and '$(BUILD_SOURCEBRANCHNAME)' != ''">$(BUILD_SOURCEBRANCHNAME)</GitBranch>
<GitBranch Condition="'$(APPVEYOR_REPO_BRANCH)' != ''">$(APPVEYOR_REPO_BRANCH)</GitBranch>
<!-- NOTE: build metadata does not affect version matching, so even if you work from a different branch+commit that gets
rebased+merged later on, the version # might still be the same (provided there weren't additional commits in master
before the rebase+merge.
-->
<_IndexOfBranchSlash>$(GitBranch.LastIndexOf('/'))</_IndexOfBranchSlash>
<_IndexOfBranchSubstring>$([MSBuild]::Add('$(_IndexOfBranchSlash)', '1'))</_IndexOfBranchSubstring>
<_GitBranch Condition="'$(_IndexOfBranchSlash)' != '0'">$(GitBranch.Substring($(_IndexOfBranchSubstring)))</_GitBranch>
<_GitBranch Condition="'$(_IndexOfBranchSlash)' == '0'">$(GitBranch)</_GitBranch>
<!-- We'll use GitFlow and ship publicly from master, meaning we don't need branch metadata from there -->
<GitSemVerDashLabel Condition="'$(GitSemVerDashLabel)' == '' and '$(_GitBranch)' != 'master'">-$(_GitBranch)</GitSemVerDashLabel>
<SemVerMetadata Condition="'$(GitSemVerDashLabel)' != '-$(_GitBranch)' and '$(_GitBranch)' != 'master'">$(_GitBranch).</SemVerMetadata>
<SemVerMetadata>$(SemVerMetadata)sha.$(GitCommit)</SemVerMetadata>
<AssemblyVersion>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)</AssemblyVersion>
<FileVersion>$(AssemblyVersion)</FileVersion>
<PackageVersion>$(FileVersion)$(GitSemVerDashLabel)+$(SemVerMetadata)</PackageVersion>
<InformationalVersion>$(PackageVersion)</InformationalVersion>
</PropertyGroup>
</Target>
</Project>