|
113 | 113 |
|
114 | 114 | <Target Name="_ServiceProjectReferenceGenerator_Core"
|
115 | 115 | Condition="'@(ServiceProjectReference)' != ''"
|
116 |
| - DependsOnTargets="@(ServiceProjectReference -> '%(DocumentGenerator)DocumentGenerator')" /> |
| 116 | + Inputs="@(ServiceProjectReference)" |
| 117 | + Outputs="@(ServiceProjectReference -> '%(DocumentPath)')"> |
| 118 | + <MSBuild BuildInParallel="$(BuildInParallel)" |
| 119 | + Projects="$(MSBuildProjectFullPath)" |
| 120 | + Properties="GeneratorTargetPath=%(DocumentPath)" |
| 121 | + Targets="%(DocumentGenerator)DocumentGenerator" /> |
| 122 | + </Target> |
117 | 123 |
|
118 | 124 | <Target Name="ServiceProjectReferenceGenerator"
|
119 | 125 | Condition="'@(ServiceProjectReference)' != ''"
|
120 | 126 | DependsOnTargets="$(ServiceProjectReferenceGeneratorDependsOn)" />
|
121 | 127 |
|
122 | 128 | <!-- DefaultDocumentGenerator -->
|
123 | 129 |
|
124 |
| - <Target Name="_DefaultDocumentGenerator_GetMetadata"> |
125 |
| - <ItemGroup> |
126 |
| - <_Temporary Remove="@(_Temporary)" /> |
127 |
| - <_Temporary Include="@(ServiceProjectReference -> WithMetadataValue('DocumentGenerator', 'Default'))" /> |
128 |
| - </ItemGroup> |
129 |
| - |
130 |
| - <Error Condition="'@(_Temporary)' != '' AND '%(_Temporary.Method)' != '' AND '%(_Temporary.Uri)' != ''" |
131 |
| - Text="ServiceProjectReference items '@(_Temporary)' have both Method and Uri metadata." /> |
132 |
| - <Error Condition="'@(_Temporary)' != '' AND '%(_Temporary.Service)' != '' AND '%(_Temporary.Uri)' != ''" |
133 |
| - Text="ServiceProjectReference items '@(_Temporary)' have both Service and Uri metadata." /> |
134 |
| - </Target> |
135 |
| - |
136 |
| - <Target Name="_DefaultDocumentGenerator_Core" Inputs="%(_Temporary.ProjectTargetPath)" Outputs="%(_Temporary.DocumentPath)"> |
| 130 | + <Target Name="_DefaultDocumentGenerator_Core"> |
137 | 131 | <!-- aspnetcore2swagger -->
|
138 | 132 | <PropertyGroup>
|
139 | 133 | <_Command>dotnet getdocument --configuration $(Configuration) --no-build</_Command>
|
140 | 134 | </PropertyGroup>
|
141 | 135 | <ItemGroup>
|
| 136 | + <_Temporary Remove="@(_Temporary)" /> |
| 137 | + <_Temporary Include="@(ServiceProjectReference)" Condition="'%(DocumentPath)' == '$(GeneratorTargetPath)'" /> |
142 | 138 | <_Temporary Update="@(_Temporary)">
|
143 |
| - <Options |
144 |
| - Condition="'%(_Temporary.Options)' == '' AND '$(DefaultDocumentGeneratorDefaultOptions)' != ''">$(DefaultDocumentGeneratorDefaultOptions)</Options> |
145 | 139 | <Command>$(_Command) --project %(FullPath) --output %(DocumentPath) --framework %(TargetFramework)</Command>
|
146 |
| - </_Temporary> |
147 |
| - <_Temporary Update="@(_Temporary)"> |
| 140 | + <Command Condition="'%(_Temporary.Method)' != ''">%(Command) --method %(_Temporary.Method)</Command> |
| 141 | + <Command Condition="'%(_Temporary.Service)' != ''">%(Command) --service %(_Temporary.Service)</Command> |
148 | 142 | <Command Condition="'%(_Temporary.Uri)' != ''">%(Command) --uri %(_Temporary.Uri)</Command>
|
149 |
| - </_Temporary> |
150 |
| - <_Temporary Update="@(_Temporary)"> |
151 |
| - <Command Condition="'%(_Temporary.Service)' != ''">%(Command) --service %(_Temporary.Service) --method %(_Temporary.Method)</Command> |
152 |
| - </_Temporary> |
153 |
| - <_Temporary Update="@(_Temporary)"> |
154 |
| - <Command Condition="'%(_Temporary.Options)' != ''">%(Command) %(_Temporary.Options)</Command> |
| 143 | + <DefaultDocumentGeneratorOptions |
| 144 | + Condition="'%(_Temporary.DefaultDocumentGeneratorOptions)' == '' AND '$(DefaultDocumentGeneratorDefaultOptions)' != ''">$(DefaultDocumentGeneratorDefaultOptions)</DefaultDocumentGeneratorOptions> |
| 145 | + <Command Condition="'%(_Temporary.DefaultDocumentGeneratorOptions)' != ''">%(Command) %(_Temporary.DefaultDocumentGeneratorOptions)</Command> |
155 | 146 | </_Temporary>
|
156 | 147 | </ItemGroup>
|
157 | 148 |
|
|
227 | 218 |
|
228 | 219 | <Target Name="_ServiceFileReferenceGenerator_Core"
|
229 | 220 | Condition="'@(ServiceFileReference)' != ''"
|
230 |
| - DependsOnTargets="@(ServiceFileReference -> '%(CodeGenerator)CodeGenerator')" /> |
| 221 | + Inputs="@(ServiceFileReference)" |
| 222 | + Outputs="@(ServiceFileReference -> '%(OutputPath)')"> |
| 223 | + <MSBuild BuildInParallel="$(BuildInParallel)" |
| 224 | + Projects="$(MSBuildProjectFullPath)" |
| 225 | + Properties="GeneratorTargetPath=%(OutputPath)" |
| 226 | + Targets="%(CodeGenerator)CodeGenerator" /> |
| 227 | + </Target> |
231 | 228 |
|
232 | 229 | <Target Name="ServiceFileReferenceGenerator" BeforeTargets="BeforeCompile" DependsOnTargets="$(ServiceFileReferenceGeneratorDependsOn)" />
|
233 | 230 | </Project>
|
0 commit comments