122 Commits
Author SHA1 Message Date
Adeel Mujahid 4141913109 Fix typos (#69011) 2022-05-07 11:55:53 -07:00
Jan KotasandTheodore Tsirpanis b59c6491dd Rename CoreRT to NativeAOT (1/N) (#68888)
Co-authored-by: Theodore Tsirpanis <teo@tsirpanis.gr>
2022-05-05 18:14:28 -07:00
Igor Velikorossov 3088b0549d Update breaking-change-rules.md (#66978)
* Update breaking-change-rules.md

Add the rule for the removal of finalizers

* Update breaking-change-rules.md

* Update breaking-change-rules.md

* Update breaking-change-rules.md

* Update breaking-change-rules.md
2022-04-14 17:19:47 -07:00
Viktor Hofer 538934c25f Only add placeholder pkg file if folder is empty (#67647)
* Only add placeholder pkg file if folder is empty

Originally reported in https://github.com/dotnet/runtime/issues/63413,
placeholder files are added unconditionally by the .NETStandard compat
error packaging infrastructure, even if the
buildTransitive/$(SupportedTFM) folder isn't empty.

That hinders our libraries to package their own set of buildTransitive
props and targets files for the supported set of tfms.

This change makes sure that placeholder files are added only if no None
or Content items are declared that point to the same package folder.

Adding documentation that explains the .NETStandard compatibility
packaging infrasturcture and how to correctly package hand-authored
msbuild files next to the generated targets files.

* Fix NETStandardCompatError empty cases

* Update packaging.targets
2022-04-12 22:16:00 +02:00
Adeel Mujahid 1094cee781 Update coding-style.md (#67801)
* Remove mention of outdated formatting script and C++ language that was removed from libraries.
* Move C# coding style at the top of document.
2022-04-09 06:37:05 -07:00
Eric Erhardt 7508080ebc Update coding-style to include target-typed new() guideline (#67061)
* Update coding-style to include target-typed new guideline

Similar to `var` usage, `new()` usage is only allowed when the Type can be understood from the same line.

Fix #53369

* Fix coding style violations
2022-03-23 18:54:51 -06:00
Elinor Fung c2ec86b1c5 Rename GeneratedDllImportAttribute -> LibraryImportAttribute (#66307) 2022-03-09 18:07:52 -08:00
Jan Kotas 17662fc30c Replace TargetFrameworks with TargetFramework where possible (#66198) 2022-03-04 22:21:59 -08:00
Elinor Fung a0635832f1 Rename DllImportGenerator project to LibraryImportGenerator (#66029) 2022-03-03 22:17:23 -08:00
Viktor Hofer 9ebe0efa48 sfx+oob split, shim project refactoring, P2Ps
Split the build of shared framework and out-of-band projects so that
it's possible to just build the shard framework projects, which was
requested by the CLR teams. In the next infrastructure rollout, the
current "libs.ref+libs.src" subsets should be removed. Generate the
targeting pack with an incomplete (without shims) frameworklist as part
of the "libs.sfx" subset.

Build the shim projects after the shared framework and oob projects and
re-generate the targeting pack's frameworklist to include the shims.

Refactor the shims so that they aren't grouped anymore by generated &
manual. Instead group them by "ref" and "src" same as other libraries
in the tree which allows to reference the source project shims and read
from the ReferenceAssembly metadata.

Use ProjectReferences in traversal projects and shim projects instead
of named references that point to binplace directories (see graph below)
This allows to build parts of the product dynamically, i.e. the shim
projects, apicompat.proj, sfx.proj and oob.proj.
2022-02-24 12:32:04 +01:00
Viktor Hofer 20e8f905d0 Don't use Targets* helper properties in libs (#64500)
* Don't use Targets* helper properties in libs projs

This change makes it possible to migrate 200+ (ref+src) projects to use
TargetFramework instead of TargetFrameworks which avoids the additional
outer build evaluation and invocation which ultimately makes the overall
build faster.

Targets* properties (i.e. TargetsWindows, TargetsAnyOS, TargetsUnix,
etc.) rely on the TargetFramework property which usually are set
inside a project. The TargetFramework property is only
available before a project specifies it if it's explicitly set in a props
file or if the project is cross-targeting and the outer-build dispatches
into the inner-build. During the dispatch, the TargetFramework property
is passed in as a global property.

Until now that behavior wasn't a problem because every libraries project
cross-targeted (by setting the TargetFrameworks property) even though
many only include a single TargetFramework (i.e. NetCoreAppCurrent).

To allow projects to use the TargetFramework property instead of
TargetFrameworks, the Targets* helper properties can't be calculated
anymore early in a props file as the TargetFramework property isn't set
at that time.

In general, the guidance by the SDK/msbuild team is to not read from the
TargetFramework property before the project sets it
(in a property group). That effectively means that the TargetFramework
property shouldn't be used in props files at all.

Therefore these helper properties can't be used anymore for property
conditions and I'm replacing their usage with TargetPlatformIdentifier
comparisons for both properties and items.
In nearly all cases, the Targets* helper properties can be replaced with
TargetPlatformIdentifier checks on items and in the few cases where
TargetsUnix or TargetsLinux marks multiple tfms as compatible, the exact
tfms must be used instead for the TargetPlatformIdentifier comparison.

Whenever a project needs to condition properties on the platform, I'm
first setting the TargetPlatformIdentifier the same way the SDK sets it
so that the SDK later doesn't need to set it again to avoid the
additional expensive msbuild function call.

* Use TargetFramework singular to avoid outer builds

Use TargetFramework instead of TargetFrameworks property whenever a
projects only targets a single target framework. This avoid unnecessary
outer builds and evaluations and makes the build faster.
2022-02-12 13:07:16 +01:00
Viktor Hofer ef5803de62 Delete NS2x runtime specific impls (#64610)
* Remove .NETStandard runtime implementations

Remove the remaining ten .NETStandard runtime specific implementations.
For reasoning please see https://github.com/dotnet/runtime/issues/64536.

* Remove infra support for NS platform specific tfms

Also cleaning-up some logic and stop disabling AppendTargetFramework.
2022-02-01 22:51:32 +01:00
Eric Erhardt d99fa6789a Respond to feedback in GenerateMultiTargetRoslynComponentTargetsFile (#63943)
* Respond to feedback in GenerateMultiTargetRoslynComponentTargetsFile

Two small follow up changes from #58446

- Fix a type-o that breaks incremental build. Forgot to use MSBuild property syntax
- Instead of having the infrastructure hard-code removing 'Abstractions', packages can set their own Disable source gen property name.

* PR feedback
2022-01-24 10:42:15 -06:00
Andy Gocke 83f8df4e78 Revert "Enable System.Text.Json tests on netfx (#63803)" (#64108)
This reverts commit 34794bc5f2.
2022-01-21 13:32:37 -08:00
Krzysztof Wicher 34794bc5f2 Enable System.Text.Json tests on netfx (#63803)
* Enable System.Text.Json tests on netfx

* use NETFRAMEWORK define

* disable another two test cases after rebase

* disable last test case which repros only on CI for me

* add p2p only on netfx
2022-01-19 13:45:01 +01:00
Matt KotsenasandStephen Toub 83c97613a3 Clarify P/Invoke shims guidance for OOB assemblies (#63470)
* Clarify P/Invoke shims guidance for OOB assemblies

The discussion in PR #63421 clarified that System.Native shims for UNIX
APIs aren't appropriate for assemblies that don't ship as part of the
Microsoft.NETCore.App framework.

Updating the interop guidelines to capture that clarification.

* Update docs/coding-guidelines/interop-guidelines.md

Co-authored-by: Stephen Toub <stoub@microsoft.com>

Co-authored-by: Stephen Toub <stoub@microsoft.com>
2022-01-07 15:31:55 -05:00
Elinor Fung 4a1bcc3524 Add comment about using source-generated p/invokes to interop guidelines (#63350) 2022-01-04 15:29:44 -05:00
Jeremy Koritzinsky a526e77b6d Move clang-format download into dotnet/runtime and add docs for setting up auto-formatting in the repository (#59374) 2021-09-23 14:34:00 -07:00
Viktor Hofer 331823f404 Simplify .NETFramework tfms (#58558)
* Simplfy .NETFramework tfms

Libraries which target .NET Framework usually have rid agnostic tfms,
i.e. net461. If the library targets netstandard2.0-windows as well,
the .NET Framework tfm must be rid specific, as rid specific
.NET Framework apps would otherwise pick the .NETStandard asset over
the .NETFramework one (based on the RID compatibility rules)

There is yet another reason that requires .NETFramework tfms to be RID
specific, which is when a project P2Ps other projects which are
rid-specific. Without the RID specific .NETFramework tfm, a compatible
.NETStandard asset would be picked instead.

NuGet doesn't support setting a TargetPlatform in the TargetFramework
alias when targeting .NETFramework or .NETStandard. Any such tfms in
dotnet/runtime are currently leveraging a hack that strips the
TargetPlatform / TargetFrameworkSuffix away during restore and packaging
(as NuGet Pack uses the project.assets.json file).

As NuGet will likely never support RID specific .NETFramework tfm
aliases, the distinction between a RID specific and a RID agnostic
.NETFramework tfm is unnecessary.

Remove all "TargetFrameworkSuffixes" / TargetPlatforms / RIDs
(whatever you would like to call them) from .NETFramework tfms and let
the packaging targets handle the cases where a RID specific asset is
required in the package.

Explictly don't set TargetsWindows to true for .NETFramework builds as
the Targets* properties are infered from the platform / suffix and
many projects make the assumption that net461
(without the "-windows" part) doesn't set TargetsWindows=true.

Fixes https://github.com/dotnet/runtime/issues/58495

* Warn on .NETFramework duplicate runtime assets

* Ignore .NEtFramework non Windows and non empty RIDs

Also cleaning up the packaging.targets file and removing
the ExcludeFromPackage option which isn't needed anymore as
target frameworks aren't excluded from packages produced in
dotnet/runtime anymore.
2021-09-10 09:50:11 +02:00
Viktor Hofer 67354a2fb4 Upgrade to net7.0 and remove target frameworks (#58011)
* Remove EOL tfms and upgrade to net7.0

* Make linker tests net7 aware

Make installer tests run on net7.0

Don't attempt to use live apphost

Fix payloads

Regenerate test files

Fix package testing
2021-09-08 22:04:23 +02:00
Viktor Hofer 6c47cf8a2f Rename transport packages to follow convention (#57504)
* Rename transport packages to follow convention

As agreed on in https://github.com/dotnet/windowsdesktop/pull/1936, we
want to follow a common schema when naming our transport packages.

Also updating the docs to reflect the name changes and to also
accomodate for the WindowsDesktop transport package.

* Update src.proj

* Update src.proj
2021-08-16 22:18:08 +02:00
Viktor Hofer 21e340dcaf P2P instead of binplacing aspnetcore transport pkg (#57239)
Use ProjectReferences to compose the aspnetcore tranport package.
Avoid binplacing and with that unnecessary copies which overall
simplifies the infrastructure and allows to add additional transport
packages without creating a binplace configuration for each.

This also makes sure that the dependencies are compatible with the
package's tfm.
2021-08-12 20:37:23 +02:00
Viktor Hofer 22cee85aa0 Clean-up pkgproj leftovers in libs and apply fixes (#56899)
* Clean-up pkgproj leftovers in libs and apply fixes

Remove any pkgproj infrastructure that was only used by src/libraries
(which is the majority). Delete the packageindex *YAY*.
Update the documentation that covered the packageindex and the pkgprojs.

Avoid any incremental builds during packaging by removing
libraries-packages.proj and use src.proj for packaging instead. Make use
of the `GeneratePackageOnBuild` property to build package during the
allconfigurations without requiring a different entry target.

Fix the addition of the DocumentationFile during packaging when
`GeneratePackageOnBuid` is used by hooking onto the
`DocumentationProjectOutputGroup` that NuGet uses and replacing the
generated documentation file with the one that comes via the
intellisense package.
Also introduce a property to choose the generated documentation file
over the one from the intellisense package:
<UseIntellisenseDocumentationFile>false</UseIntellisenseDocumentationFile>

Removing a few leftover PackageDescription properties from the projects'
Directory.Build.props file.

Cleaning up properties in Directory.Build.props & Directory.Build.targets
files.

* Actually run packaging during the allconfigurations build

* Update docs

* make runtime specific pkgs non packable

* io.ports native pkg fixes
2021-08-06 12:01:36 +02:00
iinuwa f0d1a8b390 Fix indentation on Interop directory tree example (#56718) 2021-08-02 13:17:23 -04:00
Eric StJohn ffa4923a6e Add analyzers to ref-pack / ASP.NET transport package (#54950)
* Add analyzers to ref-pack / ASP.NET transport package

* Updating shared framework SDK

* Respond to feedback

* Update arcade SDKs and remove property
2021-07-01 05:49:52 -07:00