Skip to content
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

Make dotnet publish use Release by default in 8.0+ Projects #29155

Merged
merged 74 commits into from
Jan 27, 2023
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
fef73a3
First attempt at implementing default release behavior
nagilson Nov 22, 2022
b897115
Basic case is working.
nagilson Nov 22, 2022
1657da1
Add test for failing if conflicting (need asset) AND fix logic
nagilson Nov 24, 2022
0d5d088
Improve test quality
nagilson Nov 28, 2022
0ed140f
Update the name of some publish release and pack release related strings
nagilson Nov 29, 2022
d67c269
Move the pack error to a place where it'll actually trigger and fix r…
nagilson Nov 29, 2022
f2d81f0
Remove the publishsinglefileError that I somehow added -- don't know …
nagilson Nov 29, 2022
de55192
Make tests that demonstrate the new default behavior
nagilson Nov 29, 2022
0b7520e
Add test for pack release multi-targeting. Publishing with multi-targ…
nagilson Nov 29, 2022
954ce09
Use simple identifier for the test
nagilson Dec 15, 2022
d0dcfa1
Use specialized asserts instead of asset.true
nagilson Dec 15, 2022
e7d07d2
Simplify a pack release test identifier
nagilson Dec 15, 2022
8be1cbd
use path.combine instead of string concat in pack release test
nagilson Dec 15, 2022
9e6e28e
Respond to some basic pr feedback about tests and tmp files
nagilson Dec 15, 2022
390f985
Respond to all of the 'nits' before the more substantive issues
nagilson Dec 15, 2022
890169f
Consider multi-targeted projects with inherit implicit p*release conf…
nagilson Dec 19, 2022
be3728c
[WIP] Add test infra code to create test solutions
nagilson Dec 20, 2022
7d897c7
Clean-up test code regarding TestSolution.cs
nagilson Dec 20, 2022
65e819c
Merge remote-tracking branch 'primary/main' into nagilson-publish-rel…
nagilson Dec 20, 2022
cc99dc5
Merge with main
nagilson Dec 20, 2022
e2616d8
Fail even if P*Release not defined, and enable PackRelease regardless…
nagilson Jan 11, 2023
b303257
[WIP] check the target framework in a better way
nagilson Jan 11, 2023
cb7f0b1
Move PublishRelease default to a new area so it can be picked up in p…
nagilson Jan 12, 2023
983e49e
Update solution tests to use correct identifier syntax
nagilson Jan 12, 2023
09e53a5
Merge branch 'nagilson-publish-release-default' of https://github.com…
nagilson Jan 12, 2023
12557b8
Do PublishRelease error only if IsPublishing so we don't fail VS publish
nagilson Jan 12, 2023
d140c91
Make it so the P*Release errors dont occur if env-var opt out enabled.
nagilson Jan 12, 2023
aac4107
Cleanup code and add the names of a TON of edge cases in tests with m…
nagilson Jan 12, 2023
025aec4
Make the code build before finishing tests
nagilson Jan 12, 2023
57844da
Merge remote-tracking branch 'primary/main' into nagilson-publish-rel…
nagilson Jan 12, 2023
2f0fcc2
update xlf post merge of PR and ILLink error conflict
nagilson Jan 12, 2023
e36427a
Update tests and fix bug where the solution arbitrary project not def…
nagilson Jan 13, 2023
98fa0e6
Consider that the filepath of project is not a fullpath
nagilson Jan 13, 2023
3a3d4a0
[WIP] Fix some of the newly added PublishRelease tests
nagilson Jan 14, 2023
2f7c1d3
Merge branch 'main' into nagilson-publish-release-default
nagilson Jan 17, 2023
1bb42a1
.WithTargetframeworks uses Targetframeworks instead of TargetFramewor…
nagilson Jan 17, 2023
466b909
Fix a bug I added trying to simplify code where publish command parse…
nagilson Jan 17, 2023
ec10854
CONSIDER: 1 Project Turns Into 9 Evaluations With Pack Multitarget ->…
nagilson Jan 17, 2023
ccda58c
Make publish tests with Debug hardcoded use Release. Code cleanup.
nagilson Jan 18, 2023
0638edc
Fix some more tests expecting publish debug
nagilson Jan 18, 2023
44b2397
Clean-up publishrelease default code again before review, anticipatin…
nagilson Jan 18, 2023
1fc9949
Make error message not say use Directory.Build.props because it doesn…
nagilson Jan 18, 2023
b3a342e
Remove quotes from error message
nagilson Jan 18, 2023
eb32cf3
UCR test to use release config instead of debug
nagilson Jan 18, 2023
bfd1f90
PublishRelease only affects publish test change
nagilson Jan 18, 2023
80b58d5
Fix solution handling code to not undefine properties if not set
nagilson Jan 18, 2023
0447d59
Fix some crappy code in .net tool pack test per @dsplaisted where mul…
nagilson Jan 19, 2023
f3fc8d6
Revert back to the old error message
nagilson Jan 19, 2023
c301b25
[!] Change the design to be slower but break less customers.
nagilson Jan 19, 2023
66b69bb
Update one remaining test to reflect new change that fails less often
nagilson Jan 19, 2023
be4ef83
Respond to PR feedback and add the slow and fast way as a flag
nagilson Jan 24, 2023
90ed485
Merge remote-tracking branch 'primary/main' into nagilson-publish-rel…
nagilson Jan 24, 2023
baa0905
Remove test with the old environment variable idea.
nagilson Jan 24, 2023
d94f360
Remove the test solution files and update tests
nagilson Jan 24, 2023
59abc25
Clean up remaining tests with removed solution file gunk code that ca…
nagilson Jan 24, 2023
2523195
Improve comment clarity by removing TFM and making it TargetFramework
nagilson Jan 25, 2023
9803137
Respond to PR feedback -> improve comments regarding PublishRelease, …
nagilson Jan 25, 2023
168a0dd
Merge branch 'nagilson-publish-release-default' of https://github.com…
nagilson Jan 25, 2023
47a78ee
Make a comment point to what MSBuild code it is relying oon
nagilson Jan 26, 2023
693546c
Use Assert.Equal instead of Assert.True ==
nagilson Jan 26, 2023
af4eb20
Use Path.Combine instead of str + str
nagilson Jan 26, 2023
ebf7fea
Remove the "v" that was supposed to be a down arrow in the comment
nagilson Jan 26, 2023
fda2de8
Update parameter name to reflect the pass by reference default of C#
nagilson Jan 26, 2023
d057474
Be clear that Configuration > PublishRelease or PackRelease in the er…
nagilson Jan 26, 2023
66e4967
Check that FileInfo exists instead of using Assert.True(File.Exists..…
nagilson Jan 26, 2023
a353113
Do FileInfo asserts because they give the path if they fail
nagilson Jan 26, 2023
51e4385
Fix a small typo in the test name
nagilson Jan 26, 2023
951e941
Use Tuples with named elements instead of a Tuple<K, V>
nagilson Jan 26, 2023
0c7d76f
Use named tuples over Tuple<>
nagilson Jan 26, 2023
26e5f57
Respond to PR feedback to improve code quality
nagilson Jan 27, 2023
71902de
Merge branch 'nagilson-publish-release-default' of https://github.com…
nagilson Jan 27, 2023
905b44b
Update XLF
nagilson Jan 27, 2023
3d70802
Respond to PR feedback to improve test code quality for publishrelease
nagilson Jan 27, 2023
d6e4e38
Remove the / in a test that would fail because paths in linux are dif…
nagilson Jan 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@

Microsoft Visual Studio Solution File, Format Version 12.00
nagilson marked this conversation as resolved.
Show resolved Hide resolved
# Visual Studio 15
VisualStudioVersion = 15.0.26006.2
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "App", "App\App.csproj", "{7072A694-548F-4CAE-A58F-12D257D5F486}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "App2", "App2\App2.csproj", "{1093F664-9565-46CA-A9D3-372A445D87EB}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.ActiveCfg = Debug|x64
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x64.Build.0 = Debug|x64
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.ActiveCfg = Debug|x86
{7072A694-548F-4CAE-A58F-12D257D5F486}.Debug|x86.Build.0 = Debug|x86
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|Any CPU.Build.0 = Release|Any CPU
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.ActiveCfg = Release|x64
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x64.Build.0 = Release|x64
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.ActiveCfg = Release|x86
{7072A694-548F-4CAE-A58F-12D257D5F486}.Release|x86.Build.0 = Release|x86
{1093F664-9565-46CA-A9D3-372A445D87EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Debug|x64.ActiveCfg = Debug|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Debug|x64.Build.0 = Debug|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Debug|x86.ActiveCfg = Debug|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Debug|x86.Build.0 = Debug|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Release|Any CPU.Build.0 = Release|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Release|x64.ActiveCfg = Release|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Release|x64.Build.0 = Release|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Release|x86.ActiveCfg = Release|Any CPU
{1093F664-9565-46CA-A9D3-372A445D87EB}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishRelease>false</PublishRelease>
<PackRelease>true</PackRelease>
nagilson marked this conversation as resolved.
Show resolved Hide resolved
</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;

class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello from the main app");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PublishRelease>true</PublishRelease>
<PackRelease>false</PackRelease>
</PropertyGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Console.WriteLine("Hello, World!");
7 changes: 0 additions & 7 deletions src/Cli/dotnet/CommonLocalizableStrings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -523,10 +523,6 @@
<data name="ToolSettingsUnsupportedRunner" xml:space="preserve">
<value>Command '{0}' uses unsupported runner '{1}'."</value>
</data>
<data name="SolutionExecutableConfigurationMismatchError" xml:space="preserve">
<value>Multiple executable projects in the solution contain conflicting '{0}' values. Ensure the values match. Consider using a Directory.build.props file to set all project configurations. Conflicting projects:
{1}.</value>
</data>
<data name="ShellShimConflict" xml:space="preserve">
<value>Command '{0}' conflicts with an existing command from another tool.</value>
</data>
Expand Down Expand Up @@ -709,7 +705,4 @@ The default is 'true' if a runtime identifier is specified.</value>
<data name="ResponseFileNotFound" xml:space="preserve">
<value>Response file '{0}' does not exist.</value>
</data>
<data name="CustomConfigurationDisablesPublishAndPackReleaseProperties" xml:space="preserve">
<value>A custom configuration was detected in the project '{0}', so the property '{1}' will not take effect.</value>
</data>
</root>
Loading