<Import Project="$(MSBuildThisFileDirectory)directories.props" />
- <!-- Common Properties -->
- <PropertyGroup>
- <PublicModuleListFile>$(PackageSrcDir)PublicModuleList.txt</PublicModuleListFile>
- <DummyBuildProject>$(MSBuildThisFileDirectory)build.dummy.csproj</DummyBuildProject>
- </PropertyGroup>
-
<!-- Build Properties -->
<PropertyGroup>
- <Configuration>Release</Configuration>
+ <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
+ <BuildWithAnalyzer Condition="'$(BuildWithAnalyzer)' == ''">False</BuildWithAnalyzer>
+ <BuildDesignAssembly Condition="'$(BuildDesignAssembly)' == ''">False</BuildDesignAssembly>
+ <BuildPublicOnly Condition="'$(BuildPublicOnly)' == ''">False</BuildPublicOnly>
</PropertyGroup>
<!-- Projects to build -->
<ItemGroup>
- <ProjectToBuild Include="$(ProjectSrcDir)\$(Project)\$(Project).csproj" Condition="'$(Project)' != ''" />
- <ProjectToBuild Include="$(ProjectSrcDir)**\*.csproj" Condition="'$(Project)' == ''" />
+ <DesignProject Include="$(ProjectSrcDir)**\*.Design.csproj" />
+ <DesignProject Include="$(InternalProjectSrcDir)**\*.Design.csproj" />
+
+ <PublicProject Include="$(ProjectSrcDir)**\*.csproj" Condition="'$(Project)' == ''" />
+ <PublicProject Include="$(ProjectSrcDir)\$(Project)\$(Project).csproj"
+ Condition="'$(Project)' != '' And Exists('$(ProjectSrcDir)\$(Project)\$(Project).csproj') " />
+ <PublicProject Remove="@(DesignProject)" />
+
+ <InternalProject Include="$(InternalProjectSrcDir)**\*.csproj" Condition="'$(Project)' == '' " />
+ <InternalProject Include="$(InternalProjectSrcDir)\$(Project)\$(Project).csproj"
+ Condition="'$(Project)' != '' And Exists('$(InternalProjectSrcDir)\$(Project)\$(Project).csproj') " />
+ <InternalProject Remove="@(DesignProject)" />
+
+ <ProjectToBuild Include="@(DesignProject)" Condition="'$(BuildDesignAssembly)' == 'True' " />
+ <ProjectToBuild Include="@(PublicProject)" Condition="'$(BuildDesignAssembly)' != 'True' " />
+ <ProjectToBuild Include="@(InternalProject)" Condition="'$(BuildDesignAssembly)' != 'True' And '$(BuildPublicOnly)' != 'True'" />
+ </ItemGroup>
+
+ <!-- Nuspec files to pack -->
+ <ItemGroup>
+ <NuspecFiles Include="$(ProjectRootDir)pkg\**\*.nuspec" />
</ItemGroup>
<!--
Target : Clean
==============
Delete all artifacts,
- including the Artifacts/ directory and the obj/ directories for all projects.
+ including the Artifacts/ directory and the obj and bin directories of all projects.
-->
<Target Name="Clean">
<ItemGroup>
- <ProjectIntermediateAllFiles Include="$(ProjectSrcDir)**\obj\*" />
+ <ProjectIntermediateAllFiles Include="$(ProjectSrcDir)**\obj\**" />
+ <ProjectIntermediateAllFiles Include="$(ProjectSrcDir)**\bin\**" />
+ <ProjectIntermediateAllFiles Include="$(InternalProjectSrcDir)**\obj\**" />
+ <ProjectIntermediateAllFiles Include="$(InternalProjectSrcDir)**\bin\**" />
<ProjectIntermediateDir Include="@(ProjectIntermediateAllFiles->'%(RootDir)%(Directory)'->Distinct())" />
</ItemGroup>
</Target>
-
<!--
- Target : Build
+ Target : Restore
==============
- Build all projects in src/ directory.
- The output(.dll, .pdb, .xml) of the project specfied in
- pkg/PublicModuleList.txt is copied to Artifacts/bin/public,
- and the rest are copied to Artifacts/bin/platform.
+ Restore all projects.
-->
- <Target Name="Build" DependsOnTargets="Clean">
+ <Target Name="Restore">
<MSBuild Projects="@(ProjectToBuild)"
- Properties="Configuration=$(Configuration);RestoreSources=$(RestoreSources)"
+ Properties="Configuration=$(Configuration);RestoreSources=$(RestoreSources);BuildWithAnalyzer=$(BuildWithAnalyzer)"
+ BuildInParallel="false"
Targets="Restore" />
+ </Target>
+
+ <!--
+ Target : Build
+ ==============
+ Build all projects.
+ -->
+ <Target Name="Build">
+
<MSBuild Projects="@(ProjectToBuild)"
- Properties="Configuration=$(Configuration);OutDir=$(OutputPlatformDir)"
+ Properties="Configuration=$(Configuration);BuildWithAnalyzer=$(BuildWithAnalyzer)"
BuildInParallel="true"
UseResultsCache="true"
- Targets="Build" />
+ Targets="Rebuild" />
- <ReadLinesFromFile File="$(PublicModuleListFile)">
- <Output TaskParameter="Lines" ItemName="PublicProject" />
- </ReadLinesFromFile>
+ <MSBuild Projects="@(ProjectToBuild)"
+ Properties="Configuration=$(Configuration)"
+ BuildInParallel="false"
+ Targets="CopyToArtifactsDirectory" />
- <ItemGroup>
- <PlatformFiles Include="$(OutputPlatformDir)*" />
- <_PublicFilesToMove Include="$(OutputPlatformDir)%(PublicProject.Identity).dll" />
- <_PublicFilesToMove Include="$(OutputPlatformDir)%(PublicProject.Identity).pdb" />
- <_PublicFilesToMove Include="$(OutputPlatformDir)%(PublicProject.Identity).xml" />
- <PublicFilesToMove Include="@(_PublicFilesToMove)" Condition="'@(PlatformFiles)' == '@(_PublicFilesToMove)' and '%(Identity)' != '' " />
- </ItemGroup>
+ </Target>
- <MakeDir Directories="$(OutputPublicDir)" />
- <Move SourceFiles="@(PublicFilesToMove)" DestinationFolder="$(OutputPublicDir)" />
+ <!--
+ Target : Pack
+ ==============
+ Generate nuget packages.
+ -->
+ <Target Name="Pack">
+
+ <MSBuild Projects="$(MSBuildThisFileDirectory)pack.csproj"
+ Properties="NoBuild=True"
+ Targets="Restore" />
- <Message Text="Moved %(PublicFilesToMove.Filename)%(PublicFilesToMove.Extension) -> $(OutputPublicDir)%(PublicFilesToMove.Filename)%(PublicFilesToMove.Extension)" Importance="High" />
+ <MSBuild Projects="$(MSBuildThisFileDirectory)pack.csproj"
+ Properties="NoBuild=True;Version=$(Version);NuspecFile=%(NuspecFiles.Identity)"
+ Targets="Pack" />
</Target>
<!--
- Target : BuildDummy
- ===================
- Build dummy assemblies using GenAPI
+ Target : Dummy
+ ==============
+ Generate dummy assemblies of all projects.
-->
- <Target Name="BuildDummy">
+ <Target Name="Dummy">
+
+ <PropertyGroup>
+ <APIToolPath>$(MSBuildThisFileDirectory)..\tools\bin\APITool.dll</APIToolPath>
+ </PropertyGroup>
- <MSBuild Projects="$(DummyBuildProject)"
- Properties="Configuration=$(Configuration);RestoreSources=$(RestoreSources)"
- Targets="Restore;Rebuild" />
+ <MakeDir Directories="$(OutputDummyDir)" />
+ <Exec Command="dotnet $([System.IO.Path]::GetFullPath('$(APIToolPath)')) dummy $(OutputPublicDir)ref $(OutputDummyDir) " />
</Target>