New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Publish projects during build #3138
Comments
|
I wanted to recommend using solution extensibility, so I documented that first (MicrosoftDocs/visualstudio-docs#816). You can add a target to the solution build with <Project>
<Target Name="PublishRoslynExecutableProjects"
AfterTargets="Build">
<ItemGroup>
<ProjectsToPublish Include="src/Compilers/CSharp/csc/csc.csproj" />
<ProjectsToPublish Include="src/Compilers/VisualBasic/vbc/vbc.csproj" />
<ProjectsToPublish Include="src/Compilers/Server/VBCSCompiler/VBCSCompiler.csproj" />
<ProjectsToPublish Include="src/Compilers/Core/MSBuildTask/MSBuildTask.csproj" />
</ItemGroup>
<Message Importance="high"
Text="Publishing .NET Core executables ..." />
<MSBuild Projects="@(ProjectsToPublish)"
Targets="PublishWithoutBuilding"
BuildInParallel="true"
Properties="TargetFramework=netcoreapp2.0" />
</Target>
</Project>One thing that complicates this (rather a lot, unfortunately): when building individual projects, the solution passes configuration derived from solution configurations to the projects. That means that if you separately list projects and Since Roslyn already defined |
|
I'm also looking into running the publish step for a project during solution build time. Has there been any work in this area since the above? Intuitively, it would be nice if I could simply add a property to a |
|
I agree that a Actually I wanted to look into |
The rosyln project has a solution with ~160 projects in it of which ~5 need to be published. Today our work flow is to do the following:
msbuild /t:Publish /p:TargetFramework=netcoreapp2.0 TheProject.csprojInvoking MSBuild this many times is wasteful because every publish has to re-evaluate the state of our build before moving onto the publish step. It would be more efficient if during the build we could publish the set of projects that require publishing.
Chaining targets almost works by using this syntax:
>msbuild /t:Build /t:path\to\project1:Publish /t:path\to\project2:PublishHowever Publish requires that a TargetFramework property also be set. How can that be combined with the target syntax above?
The text was updated successfully, but these errors were encountered: