1
- <Project InitialTargets = " _ExportAnnotations_CheckSupport " >
1
+ <Project >
2
2
3
3
<PropertyGroup >
4
4
<MSBuildAllProjects Condition =" '$(MSBuildToolsVersion)' != 'Current'" >$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects >
5
5
</PropertyGroup >
6
6
7
- <!-- Build command line according to which kind of runtime MSBuild is running in -->
8
- <PropertyGroup >
9
-
10
- <_ExportAnnotationsToolsDirectory >$([System.IO.Path]::GetFullPath($(MSBuildThisFileDirectory)..\tools))\</_ExportAnnotationsToolsDirectory >
11
-
12
- <_ExportAnnotationsCommand Condition =" '$(MSBuildRuntimeType)' == 'Core'" >dotnet </_ExportAnnotationsCommand >
13
- <_ExportAnnotationsCommand Condition =" '$(MSBuildRuntimeType)' == 'Full'" />
14
- <_ExportAnnotationsCommand Condition =" '$(MSBuildRuntimeType)' == 'Mono'" >mono </_ExportAnnotationsCommand >
15
-
16
- <_ExportAnnotationsExe Condition =" '$(MSBuildRuntimeType)' == 'Core'" >$(_ExportAnnotationsToolsDirectory)netcoreapp2.1\ExportAnnotations.dll</_ExportAnnotationsExe >
17
- <_ExportAnnotationsExe Condition =" '$(MSBuildRuntimeType)' == 'Full'" >$(_ExportAnnotationsToolsDirectory)net471\ExportAnnotations.exe</_ExportAnnotationsExe >
18
- <_ExportAnnotationsExe Condition =" '$(MSBuildRuntimeType)' == 'Mono'" >$(_ExportAnnotationsToolsDirectory)net471\ExportAnnotations.exe</_ExportAnnotationsExe >
19
-
20
- <_ExportAnnotationsCommand >$(_ExportAnnotationsCommand)$(_ExportAnnotationsExe)</_ExportAnnotationsCommand >
21
-
22
- </PropertyGroup >
23
-
24
- <!-- Issue errors on unsupported project type / MSBuild runtime type -->
25
- <Target Name =" _ExportAnnotations_CheckSupport" >
26
- <Error Condition =" '$(MSBuildProjectExtension)' != '.csproj' And '$(MSBuildProjectExtension)' != '.vbproj'" Text =" ReSharper.ExportAnnotations.Task: unsupported project type '$(MSBuildProjectExtension)' (only .csproj and .vbproj are supported)" />
27
- <Error Condition =" '$(_ExportAnnotationsCommand)' == ''" Text =" ReSharper.ExportAnnotations.Task: unsupported MSBuild runtime type '$(MSBuildRuntimeType)' (only Core, Full, and Mono are supported)" />
28
- </Target >
29
-
30
- <!-- Normalize properties related to tool settings -->
7
+ <!-- Unless set otherwise, ExportJetBrainsAnnotations is true for libraries, false for other projects. -->
31
8
<PropertyGroup Condition =" '$(ExportJetBrainsAnnotations)' == ''" >
32
9
<ExportJetBrainsAnnotations Condition =" '$(OutputType)' != 'Library'" >false</ExportJetBrainsAnnotations >
33
10
<ExportJetBrainsAnnotations Condition =" '$(OutputType)' == 'Library'" >true</ExportJetBrainsAnnotations >
34
11
</PropertyGroup >
35
12
<PropertyGroup >
36
- <StripJetBrainsAnnotations Condition =" '$(StripJetBrainsAnnotations )' == ' '" >true</ StripJetBrainsAnnotations >
13
+ <ExportJetBrainsAnnotations Condition =" '$(ExportJetBrainsAnnotations )' != 'true '" >false</ ExportJetBrainsAnnotations >
37
14
</PropertyGroup >
38
15
39
- <!-- Define the appropriate constant to embed annotations into compiled assembly -->
16
+ <!-- Unless set otherwise, StripJetBrainsAnnotations is true. -->
40
17
<PropertyGroup >
41
- <DefineConstants Condition =" '$(DefineConstants )' != ''" >$(DefineConstants);</ DefineConstants >
42
- <DefineConstants >$(DefineConstants)JETBRAINS_ANNOTATIONS</ DefineConstants >
18
+ <StripJetBrainsAnnotations Condition =" '$(StripJetBrainsAnnotations )' == ''" >true</ StripJetBrainsAnnotations >
19
+ <StripJetBrainsAnnotations Condition = " '$(StripJetBrainsAnnotations)' != 'true' " >false</ StripJetBrainsAnnotations >
43
20
</PropertyGroup >
44
21
45
- <!-- Run tool immediately after compiler -->
46
- <Target Name =" _ExportAnnotations_RunTool"
47
- Condition =" ($(ExportJetBrainsAnnotations) Or $(StripJetBrainsAnnotations)) And ('$(SkipCompilerExecution)' != 'true')"
48
- AfterTargets =" CoreCompile" >
49
-
50
- <PropertyGroup >
51
- <_ExportAnnotationsLibraryList >$(IntermediateOutputPath)ExportAnnotations.libraries</_ExportAnnotationsLibraryList >
52
- </PropertyGroup >
22
+ <Import Condition =" '$(RebuildingWithoutJetBrainsAnnotations)' != 'true'"
23
+ Project =" ReSharper.ExportAnnotations.Task.Building.targets" />
53
24
54
- <WriteLinesToFile
55
- File =" $(_ExportAnnotationsLibraryList)"
56
- Lines =" @(ReferencePathWithRefAssemblies)"
57
- Overwrite =" true" />
25
+ <Import Condition =" '$(RebuildingWithoutJetBrainsAnnotations)' == 'true'"
26
+ Project =" ReSharper.ExportAnnotations.Task.Rebuilding.targets" />
58
27
59
- <!-- Complete command line with options -->
60
- <PropertyGroup >
61
- <_ExportAnnotationsCommandLine >$(_ExportAnnotationsCommand) " %(IntermediateAssembly.FullPath)" </_ExportAnnotationsCommandLine >
62
- <_ExportAnnotationsCommandLine Condition =" !$(ExportJetBrainsAnnotations)" >$(_ExportAnnotationsCommandLine) --no-export</_ExportAnnotationsCommandLine >
63
- <_ExportAnnotationsCommandLine Condition =" $(StripJetBrainsAnnotations)" >$(_ExportAnnotationsCommandLine) --strip</_ExportAnnotationsCommandLine >
64
- <_ExportAnnotationsCommandLine >$(_ExportAnnotationsCommandLine) --liblist " $(_ExportAnnotationsLibraryList)" </_ExportAnnotationsCommandLine >
65
- </PropertyGroup >
66
-
67
- <!-- Run for every IntermediateAssembly (item fed to Roslyn compilers as output assembly) -->
68
- <Exec Command =" $(_ExportAnnotationsCommandLine)" />
69
-
70
- </Target >
71
-
72
- <!-- Hook into CopyFilesToOutputDirectory -->
73
- <Target Name =" _ExportAnnotations_CopyFilesToOutputDirectory"
74
- Condition =" $(ExportJetBrainsAnnotations)"
75
- AfterTargets =" CopyFilesToOutputDirectory" >
76
-
77
- <Copy SourceFiles =" @(IntermediateAssembly->'%(RootDir)%(Directory)%(Filename).ExternalAnnotations.xml')"
78
- DestinationFolder =" $(OutDir)"
79
- SkipUnchangedFiles =" $(SkipCopyUnchangedFiles)"
80
- OverwriteReadOnlyFiles =" $(OverwriteReadOnlyFiles)"
81
- Retries =" $(CopyRetryCount)"
82
- RetryDelayMilliseconds =" $(CopyRetryDelayMilliseconds)"
83
- UseHardlinksIfPossible =" $(CreateHardLinksForCopyFilesToOutputDirectoryIfPossible)"
84
- UseSymboliclinksIfPossible =" $(CreateSymbolicLinksForCopyFilesToOutputDirectoryIfPossible)"
85
- Condition =" '$(CopyBuildOutputToOutputDirectory)' == 'true' and '$(SkipCopyBuildProduct)' != 'true'" >
86
- <Output TaskParameter =" DestinationFiles" ItemName =" FileWrites" />
87
- </Copy >
88
-
89
- </Target >
90
-
91
- <!-- Hook into package creation to add external annotations file to package -->
28
+ <!-- Add external annotations file to package -->
92
29
<PropertyGroup Condition =" $(ExportJetBrainsAnnotations)" >
93
30
<TargetsForTfmSpecificContentInPackage >$(TargetsForTfmSpecificContentInPackage);_ExportAnnotations_IncludeExternalAnnotationsInPackage</TargetsForTfmSpecificContentInPackage >
94
31
</PropertyGroup >
95
-
96
- <!-- Add external annotations file to package -->
32
+
97
33
<Target Name =" _ExportAnnotations_IncludeExternalAnnotationsInPackage"
98
34
Condition =" $(ExportJetBrainsAnnotations)" >
35
+
99
36
<ItemGroup >
100
37
<TfmSpecificPackageFile Include =" $(OutputPath)\$(AssemblyName).ExternalAnnotations.xml" PackagePath =" lib/$(TargetFramework)" />
101
38
</ItemGroup >
39
+
102
40
</Target >
103
41
104
42
</Project >
0 commit comments