forked from dotnet/runtime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathslngen.proj
36 lines (31 loc) · 1.52 KB
/
slngen.proj
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
<Project Sdk="Microsoft.Build.NoTargets">
<PropertyGroup>
<ScriptExt Condition="$([MSBuild]::IsOSPlatform('WINDOWS'))">.cmd</ScriptExt>
<ScriptExt Condition="!$([MSBuild]::IsOSPlatform('WINDOWS'))">.sh</ScriptExt>
<ProjTemplatePath>$(RepositoryEngineeringDir)slngen.template.proj</ProjTemplatePath>
<SolutionNameOverride Condition="'$(SolutionNameOverride)' == ''">*</SolutionNameOverride>
</PropertyGroup>
<ItemGroup>
<!-- Unless a "/p:SolutionNameOverride" property is passed in, glob all solutions under src/libraries. -->
<SolutionFile Include="$(MSBuildThisFileDirectory)$(SolutionNameOverride)\*.sln" />
</ItemGroup>
<Target Name="UpdateSolutionFile"
AfterTargets="Build"
DependsOnTargets="GetSolutionFiles"
Inputs="@(SolutionFile)"
Outputs="%(ProjFilePath)">
<!-- Copy template files, required by slngen -->
<Copy SourceFiles="$(ProjTemplatePath)"
DestinationFiles="%(SolutionFile.ProjFilePath)" />
<!-- Invoke slngen -->
<Exec Command=""$(RepoRoot)dotnet$(ScriptExt)" slngen -p SlnGenMainProject=%(SolutionFile.Filename) --launch false --nologo "%(SolutionFile.ProjFilePath)"" />
<!-- Delete temporary template file -->
<Delete Files="%(SolutionFile.ProjFilePath)" />
</Target>
<Target Name="GetSolutionFiles">
<ItemGroup>
<!-- Add attributes that require a separate item mutation. -->
<SolutionFile ProjFilePath="%(RelativeDir)%(Filename).proj" />
</ItemGroup>
</Target>
</Project>