未验证 提交 277f4486 编写于 作者: V Vatsan Madhavan 提交者: GitHub

release/3.0 <- master integration for Preview 6 (#817)

上级 a482367a

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
# editorconfig.org
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
# top-most EditorConfig file
root = true
......@@ -139,6 +138,10 @@ csharp_space_between_square_brackets = false
curly_bracket_next_line = true
indent_brace_style = Allman
# Visual Studio Solution files
[*.sln]
end_of_line = lf
# Xml project files
[*.{csproj,vcxproj,vcxproj.filters,proj,nativeproj,locproj}]
indent_size = 2
......@@ -159,4 +162,4 @@ indent_size = 2
[*.sh]
end_of_line = lf
[*.{cmd, bat}]
end_of_line = crlf
\ No newline at end of file
end_of_line = crlf
......@@ -332,6 +332,7 @@ ASALocalRun/
/.dotnet
/.packages
/.tools/vswhere/2.5.2
/.tools/native/iltools
### OSX ###
......
<Project>
<PropertyGroup>
<RepositoryName>wpf</RepositoryName>
</PropertyGroup>
<!-- Normalize $(TestWpfArcadeSdkPath) by appending a '\' to it if one is missing -->
<PropertyGroup Condition="'$(TestWpfArcadeSdkPath)'!=''">
<WpfArcadeSdkPath>$(TestWpfArcadeSdkPath)</WpfArcadeSdkPath>
......
# Pull Request Acceptance Criteria
Thank you for contributing to **WPF for .NET Core!** We ask that before you start work on a feature that you would like to contribute, please file an issue describing your proposed change: We will be happy to work with you to figure out the best approach, provide guidance and mentorship throughout feature development, and help avoid any wasted or duplicate effort.
#### What types of pull requests will be accepted before WPF for .NET Core General Availability in September?
WPF for .NET Core is seeking functional and performance parity with .NET Framework to offer customers a direct porting path from .NET Framework. Given this, only the following will be considered:
* Bug fixes that are not reproducible on .NET Framework
* IL-neutral formatting changes done by Roslyn analyzers and automatic code fixers
* Performance fixes that bring .NET Core to performance parity with .NET Framework
All other changes will be tagged as 'future' and postponed until after .NET Core 3.0 GA in September.
**Please see the chart below for more details.**
| Category | Description | Accepted pre-GA |
| --- | --- | :---: |
| .NET Core code defect | .NET Core bugs that *are not* reproducible on .NET Framework will be accepted pre-GA. | :heavy_check_mark: |
| .NET Framework code defect | Fixes for .NET Core bugs that are **also** reproducible on .NET Framework will not be accepted. (If this was a recent regression in .NET Framework 4.8, or this blocks a core scenario, then we will likely consider bugs in this category). | :x: |
| .NET Core API change | An **enhancement** of an existing .NET Core API will not be accepted pre-GA. (We are also seeking to minimize deprecation and removal of APIs, unless they are unsupported by .NET core.)| :x: |
| New API (feature addition, public API) | New features and public APIs will not be considered until after .NET Core 3.0 GA. | :x: |
| Performance Optimization | We would like to achieve performance parity with .NET Framework. Fixes for performance regressions in .NET Core will be accepted, and other performance optimizations will be considered. | :heavy_check_mark: |
| Automated code formatting change | Automated IL-neutral changes with an associated Roslyn analyzer or editor config update will be accepted. Automated changes that result in differences to the IL will be individually considered. | :heavy_check_mark: |
| Manual code formatting change | Manual code formatting changes without an associated Roslyn analyzer or editor config update will not be accepted pre-GA. | :x: |
### General Guidelines
> 👉 **Remember\!** Your contributions may be incorporated into future versions of WPF\! Because of this, all pull requests will be subject to the same level of scrutiny for quality, coding standards, performance, globalization, accessibility, and compatibility as those of our internal contributors.
* **DO** create an issue before creating a pull request.
* **DO** create one pull request per Issue, and ensure that the Issue is linked in the pull request.
* **DO** follow our [coding and style guidelines](https://github.com/dotnet/corefx/blob/master/Documentation/coding-guidelines/coding-style.md), and keep code changes as small as possible.
* **DO** check for additional occurrences of the same problem in other parts of the codebase before submitting your PR.
* **DO** link the issue you are addressing in the pull request.
* **DO** write a good description for your pull request. More detail is better. Describe why the change is being made and why you have chosen a particular solution. Describe any manual testing you performed to validate your change.
* **DO** take an IL diff for code formatting changes and include IL-neutral or not IL-neutral in the PR.
* **DO NOT** submit a PR unless it is linked to an Issue marked triage approved. This enables us to have a discussion on the idea before anyone invests time in an implementation.
* **DO NOT** merge multiple changes into one PR unless they have the same root cause.
* **DO NOT** submit pure formatting/typo changes to code that has not been modified otherwise.
# Pull Request Process
### All pull requests must have an issue
1. If any guidance is required, please read the [contribution guidelines](contributing.md) and/or submit an issue requesting clarification.
2. Review the pre-GA acceptance table and open a new issue.
3. The issue will be triaged by someone from the WPF team.
4. If the issue meets the pre-GA acceptance criteria, the contributor will be assigned a WPF developer to help with the submission process. The issue will be assigned as a work item to the WPF developer.
5. The issue will be discussed with community members and WPF developers to understand the problem and review possible solutions.
6. When the a solution has been agreed upon, implement and **validate the change locally**.
> Please follow the testing requirements [Developer Guide](developer-guide.md).
> Verify your change works. Create and test the updated feature area locally with a WPF test application compiled against a version of the WPF Framework that contains your changes. See the [Developer Guide](developer-guide.md) for instructions on testing against local builds.
7. When the code is completed and has been verified locally, the contributor should submit a pull request that references the associated issue. Please complete the Contributor License Agreement if required.
8. GitHub checks will run against each new commit
- *GitHub Checks*
- License Check
- Style and Formatting
- Commit Message
- PR Build with Roslyn analyzers enabled
9. When the PR has been submitted and all GitHub checks pass (no build breaks or other issues) community members and WPF developers will review the code.
10. Additional internal testing may be performed by WPF developers if the change is determined to be high risk.
11. Community members and WPF developers need to review the change and sign-off on the pull request before the PR can be merged.
12. After the PR has been signed off, a WPF developer will manually squash and merge the PR.
#### At this point, the change is in master. Further internal testing will be performed. If there are no regressions, the change will be included in the next milestone release.
13. The internal developer regression test loop will be run against a build that includes the merged changes from the PR.
14. If a test fails, the squash-merge commit will be undone, and the WPF developer assigned to the issue will work with the submitter to root-cause and fix the regression. A new PR will need to be created by the submitter with the fixed code.
15. If the internal DRT test loop succeeds, the internal feature test loop will run. If this fails, the assigned WPF developer will work with the submitter to fix the regression and to submit a new PR with fixed code.
16. Finally, pre-milestone release, a full internal test pass is run. This test pass contains tens of thousands of tests across a large number of operating systems and machine configurations. If everything succeeds, the change (along with any others) will remain in master to be included in the next milestone release.
17. The repo is 'snapped' to a milestone release containing the PR.
### Would you like to contribute new features after September?
Please open an issue describing what feature area you would like to work on. We will begin assigning community owners and WPF developer peers some time in the future. Thanks!
# CodeGen in the dotnet/wpf repo
The following document describes how code generation in this repo works. The goal is to have all our code generation done through the use of T4 text generation. See the offical [Visual Studio T4 documentation](https://docs.microsoft.com/en-us/visualstudio/modeling/design-time-code-generation-by-using-t4-text-templates?view=vs-2019) for more information.
## Design-Time vs Run-Time T4 templates
Currently, we are evaluating the use of design-time text templates. This gives us the ability to simply add the templates and associated targets to the build, without the need of maintaining a separate tool to do run-time generation. When using the SDK-style project format, including the `Microsoft.TextTemplating.targets` requires us to manually import `Sdk.Targets` because the `BuildDependsOn` variable, which is modified by the T4 targets, would otherwise be overwritten by the automatic inclusion of `Sdk.targets`. This causes the `TransformAll` target to not run before the `Build` target. The boilerplait for including design-time templates has been encapsulated in the `$(WpfCodeGenDir)DesignTimeTextTemplating.targets` file, so the pattern for enabling these in a project looks like this:
```
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
<Import Project="$(WpfCodeGenDir)AvTrace\GenTraceSources.targets" />
<Import Project="$(WpfCodeGenDir)AvTrace\GenAvMessages.targets" />
<Import Project="$(WpfCodeGenDir)DesignTimeTextTemplating.targets" />
```
## Basic T4 code generation philosophy and guidelines
T4 templates can be a powerful tool, however without a conscious effort, they can quickly become unmaintainable and difficult to understand. When authoring/modifying a T4 template, extra care should be taken to ensure that the templates are as readable as possible. While the "readability" of a template may be a bit subjective, there are a few common guidelines that really help. Note that these are guidelines, and are not mandatory. The readability of the template is paramount to all things.
* When multiple lines of code need to be written inside of "<# #>" blocks, the "<#" and "#>" tags should be on seperate lines. This makes it easier to tell where the code starts and stops. If we follow this policy, we can know that a line that only contains a "<#" tag is the start of a multi-line code block.
**Correct**
```
<#
string helloWorld = " Hello World ";
hellowWorld = helloWorld.Trim();
#>
<#= hellowWorld #>
```
**Incorrect**
```
<# string helloWorld = " Hello World ";
helloWorld = helloWorld.Trim(); #>
<#= hellowWorld #>
```
* In similar fashion, single-line code statements should contain the "<#" and "#>" tags on the same line as the code. This way we can know that any line that starts with a "<#" that has code next to it is only a one-line statement.
* if/else/elseif statements, and the closing bracket, should all be contained on a single line
**Correct**
```
<# if (WriteAsFunction()){ #>
bool GetFoo()
{
...
}
<# } else { #>
bool Foo
{
get {...}
}
<# } #>
```
**Incorrect**
```
<#
if (WriteAsFunction())
{
#>
bool GetFoo()
{
...
}
<#
}
else
{
#>
bool Foo
{
get {...}
}
<#
}
#>
```
* T4 generation allows you to write functions that you can invoke in the template inside of "<#+ #>" blocks. If the function is intended to be re-used to output some common text, the name of the function should start with "Output" so that is clear to the reader the intent of the function. Also, these functions should not impose any extra indentation (or it should be minimal), as this makes it more complicated to re-use and plug
in the function anywhere throughout the template.
**Correct**
```
<#+ void OutputFooFunction() { #>
bool GetFoo()
{
...
}
<#+ } #>
```
**Incorrect**
```
<#+ void FooFunction() { #>
bool GetFoo()
{
...
}
<#+ } #>
```
## Location of CodeGen targets
Unless there is a good reason (that should be documented), all codegen related targets should go into the $(WpfArcadeSdk)tools\CodeGen folder. This way we have a clean and clear location where we are able to keep track of all code generation in the codebase.
## GenTraceSources and GenAvMessages
These two projects codegen the files the WPF codebase uses for tracing, and both use the AvTraceMessages.xml files located in the project location that includes it, located via the MSBuild property $(MSBuildProjectFileDirectory).
**Note**: GenTraceSources should currently only be used by WindowsBase. It generates the [PresentationTraceSources](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.presentationtracesources?view=netcore3.0) class, which is a public class. Changing this file can impact the public API surface of WindowsBase or other WPF assemblies.
\ No newline at end of file
......@@ -2,10 +2,7 @@
The primary focus of .NET Core 3.0 release for WPF is to achieve parity with .NET Framework. Priority will be given to changes that align with that goal. See the [roadmap](../roadmap.md) to understand project goals.
We need the most help with the following types of changes:
* Test fixes, test improvements and new tests increasing code coverage.
* Bug fixes that specifically target partity between .NET Core and .NET Framework.
See the [acceptance criteria](acceptance_criteria.md) for types of issues that will be accepted before General Availability of .NET Core 3.0.
Please [file an issue](https://github.com/dotnet/wpf/issues) for any larger change you would like to propose.
......@@ -13,19 +10,15 @@ See [Developer Guide](developer-guide.md) to learn how to develop changes for th
This project follows the general [.NET Core Contribution Guidelines](https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/contributing.md). The contribution bar from the general contribution guidelines is copied below.
## Do not change files in the `Shared`, `WindowsBase`, `PresentationCore`, and `PresentationFramework` directories
The directories [`src/Microsoft.DotNet.Wpf/src/Shared`](https://github.com/dotnet/wpf/tree/master/src/Microsoft.DotNet.Wpf/src/Shared), [`src/Microsoft.DotNet.Wpf/src/WindowsBase`](https://github.com/dotnet/wpf/tree/master/src/Microsoft.DotNet.Wpf/src/WindowsBase), [`src/Microsoft.DotNet.Wpf/src/PresentationCore`](https://github.com/dotnet/wpf/tree/master/src/Microsoft.DotNet.Wpf/src/PresentationCore), [`src/Microsoft.DotNet.Wpf/src/PresentationFramework`](https://github.com/dotnet/wpf/tree/master/src/Microsoft.DotNet.Wpf/src/PresentationFramework) contains files that are shared between the public GitHub repo and the internal WPF repos. Changes to files in this directory will *not* be accepted since they also affect internal code. Once all the appropriate sources have been published to the public repo, this restriction will no longer be needed.
## Contribution "Bar"
Project maintainers will consider changes that improve the product or fix known bugs (please file issues to make bugs "known").
Maintainers will not merge changes that have narrowly-defined benefits due to compatibility risk or complexity added to the product. We may revert changes if they are found to be breaking.
Most .NET Core components are cross-platform and we appreciate contributions that either improve their feature set in a given environment or that add support for a new environment. We will typically not accept contributions that implement support for an OS-specific technolology on another operating system. For example, we do not intend to create an implementation of the Windows registry for Linux or an implementation of the macOS keychain for Windows. We also do not intend to accept contributions that provide cross-platform implementations for Windows Forms or WPF.
Most .NET Core components are cross-platform and we appreciate contributions that either improve their feature set in a given environment or that add support for a new environment. We will typically not accept contributions that implement support for an OS-specific technolology on another operating system. We also do not intend to accept contributions that provide cross-platform implementations for Windows Forms or WPF.
Contributions must also satisfy the other published guidelines defined in this document.
Contributions must also satisfy the [acceptance criteria](acceptance_criteria.md) to learn how to develop changes for this repo.as well as other published guidelines defined in this document.
## Code Formatting Improvements and Minor Enhancements
......
......@@ -23,6 +23,136 @@ We use the following workflow for building and testing features and fixes.
You first need to [Fork](https://github.com/dotnet/corefx/wiki/Checking-out-the-code-repository#fork-the-repository) and [Clone](https://github.com/dotnet/corefx/wiki/Checking-out-the-code-repository#clone-the-repository) this WPF repository. This is a one-time task.
### Testing Locally built WPF assemblies (excluding PresentationBuildTasks)
This section of guide is intended to discuss the different approaches for ad-hoc testing of WPF assemblies,
and not automated testing. There are a few different ways this can be done, and for the most part,
it can be a matter of personal preference on which workflow you choose.
#### Copying binaries to publish location of a self-contained application
The simplest approach is to publish your sample app using `dotnet publish -r <rid> --self-contained`.
You can add the `<SelfContained>true</SelfContained>` and `<RuntimeIdentifer>rid</RuntimeIdentifier>`
properties to your .csproj or .vbproj file and then you can simply execute `dotnet publish`.
We recommend always supplying a runtime identifier, as many of the WPF assemblies are architecture dependent.
The values you can choose here are `win-x86` or `win-x64`.
Then to copy the WPF assemblies to this published location, simply run the copy-wpf.ps1 script
located in the `eng` folder of the repo and point it to the location of your test application:
> eng\copy-wpf.ps1 -destination "c:\mysampleproj"
#### Copying binaries to local dotnet installation
If you want/need to test an existing application that targets the shared installation,
it is safest to setup a test host, rather than trying to copy assemblies over the shared installation.
The arcade infrastructure creates a local dotnet installation in the `.dotnet` folder contained at the root
of the repository when you do a full build using the `build.cmd` or `build.sh` script.
You can run the copy-wpf.ps1 script again, except you can leave out the destination and be sure to pass in the
the `-testhost` parameter:
> eng\copy-wpf.ps1 -testhost
```cmd eng\copy-wpf.ps1 -testhost ```
You need to set environment variables so that your testhost installation is used when launching the application.
Once these are set, you should be able to launch the executable from the command line and then your assemblies
will be used.
- DOTNET_ROOT=<path_to_wpf_repo>\\.dotnet
- DOTNET_MULTILEVEL_LOOKUP=0
**How to find location of the exe to test?**
If you are testing an application and don't know where the executable is located, the easiest thing to do
is use Process Explorer (from SysInternals) or attach to the process with a debugger like Visual Studio.
#### Testing API changes
The above instructions imply that you are testing assemblies that don't have any changes to the
public API surface that the test application needs to use. If you need to test some API changes
you are making, the C# team has done some great work to make this relatively straightforward.
When the C# compiler detects a collision with assembly references, the assembly with the
higher version number is chosen. Assuming our locally built binaries are newer than what is
installed, we can then simply reference those local binaries directly from the project file, like this:
*Note: you should build locally with the `-pack` param to ensure the binaries are put in the correct location.*
```xml
<PropertyGroup>
<!-- Change this value based on where your local repo is located -->
<WpfRepoRoot>d:\dev\src\dotnet\wpf</WpfRepoRoot>
<!-- Change based on which assemblies you build (Release/Debug) -->
<WpfConfig>Debug</WpfConfig>
<!-- Publishing a self-contained app ensures our binaries are used. -->
<SelfContained>true</SelfContained>
<!-- The runtime identifier needs to match the architecture you built WPF assemblies for. -->
<RuntimeIdentifier>win-x86</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<Reference Include="$(WpfRepoRoot)\artifacts\packaging\$(WpfConfig)\Microsoft.DotNet.Wpf.GitHub\ref\netcoreapp3.0\*.dll" Private="false" />
<ReferenceCopyLocalPaths Include="$(WpfRepoRoot)\artifacts\packaging\$(WpfConfig)\Microsoft.DotNet.Wpf.GitHub\lib\netcoreapp3.0\*.dll" />
<ReferenceCopyLocalPaths Include="$(WpfRepoRoot)\artifacts\packaging\$(WpfConfig)\Microsoft.DotNet.Wpf.GitHub\lib\$(RuntimeIdentifier)\*.dll" />
</ItemGroup>
```
### Testing specific versions of the Microsoft.WindowsDesktop.App runtime
At times, it is necessary to install and test specific versions of the runtime. This can be helpful if you are trying to root cause when an issue started occuring.
For testing different versions of the runtime, you can install a specific version of the runtimes via the dotnet install script: https://docs.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script
**Note**: These install the versions to your %user% directory, so you can use the DOTNET_ROOT environment variables to ensure these get used as described above. Otherwise, you can point them to install in %programfiles% and specify which version of the runtime should be picked up.
Below is an example powershell script of how you can use the `dotnet-install.ps1` script:
```
$dotnet_install = "$env:TEMP\dotnet-install.ps1"
$x64InstallDir = "$env:ProgramFiles\dotnet"
$x86InstallDir = "${env:ProgramFiles(x86)}\dotnet"
Invoke-WebRequest https://dot.net/v1/dotnet-install.ps1 -OutFile $dotnet_install
.$dotnet_install -Channel master -Version 3.0.0-preview5-27619-18 -Runtime windowsdesktop -Architecture x64 -InstallDir $x64InstallDir
.$dotnet_install -Channel master -Version 3.0.0-preview5-27619-18 -Runtime windowsdesktop -Architecture x86 -InstallDir $x86InstallDir
```
This would install version `3.0.0-preview5-27619-18` of the `Microsoft.WindowsDesktop.App` shared runtime. You can pass `"Latest"` to get the latest version of the runtime. You can also use this script to install the runtimes as well as the SDK. If you know a particular SDK version and are curious to know what `Microsoft.WindowsDesktop.App` version is associated with it, there is a file called `Microsoft.NETCoreSdk.BundledVersions.props` contained inside the SDK folder. Inside that file, you will find an entry that looks like this:
```xml
<KnownFrameworkReference Include="Microsoft.WindowsDesktop.App"
TargetFramework="netcoreapp3.0"
RuntimeFrameworkName="Microsoft.WindowsDesktop.App"
DefaultRuntimeFrameworkVersion="3.0.0-preview4-27613-28"
LatestRuntimeFrameworkVersion="3.0.0-preview4-27613-28"
TargetingPackName="Microsoft.WindowsDesktop.App.Ref"
TargetingPackVersion="3.0.0-preview4-27615-11"
RuntimePackNamePatterns="runtime.**RID**.Microsoft.WindowsDesktop.App"
RuntimePackRuntimeIdentifiers="win-x64;win-x86"
/>
```
In this example, the version of `Microsoft.WindowsDesktop.App` associated with this SDK is `3.0.0-preview4-27613-28`.
**Note**: The ability to install the WindowsDesktop runtime via the dotnet install script is being tracked by: https://github.com/dotnet/cli/issues/11115
#### Specifying which version of the runtime to use
If you can build directly from source, you can add this to your project file to pick up the version of the shared runtime you want to test:
```xml
<PropertyGroup>
<MicrosoftWindowsDesktopAppVersion>3.0.0-preview5-27619-18</MicrosoftWindowsDesktopAppVersion>
<PropertyGroup>
<FrameworkReference Update="Microsoft.WindowsDesktop.App">
<TargetingPackVersion>$(MicrosoftWindowsDesktopAppVersion)</TargetingPackVersion>
</FrameworkReference>
```
If you don't have the ability to build from source, you can update the *.runtimeconfig.json file located next to the executable to pick up your version:
```json
{
"runtimeOptions": {
"tfm": "netcoreapp3.0",
"framework": {
"name": "Microsoft.WindowsDesktop.App",
"version": "3.0.0-preview5-27619-18"
}
}
}
```
#### Finding a specific version of Microsoft.WindowsDesktop.App that interests you
Follow the steps defined [here](https://github.com/dotnet/arcade/blob/master/Documentation/SeePackagesLatestVersion.md) to get setup for [swagger API](https://maestro-prod.westus2.cloudapp.azure.com/swagger/ui/index.html). Note that you need to authorize each time you login, so keep note of your token or you'll have to generate a new one. Assuming you have a commit (and therefore an Azure DevOps build id) that you are interested in, you can enter the build id into your query.
### Testing PresentationBuildTasks
-- add more content here --
## More Information
......@@ -31,3 +161,4 @@ You first need to [Fork](https://github.com/dotnet/corefx/wiki/Checking-out-the-
* [Coding guidelines](https://github.com/dotnet/corefx/tree/master/Documentation#coding-guidelines)
* [up-for-grabs WPF issues](https://github.com/dotnet/wpf/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs)
* [easy WPF issues](https://github.com/dotnet/wpf/issues?utf8=%E2%9C%93&q=is%3Aopen+is%3Aissue+label%3Aeasy)
* [Code generation in dotnet/wpf](codegen.md)
......@@ -32,17 +32,9 @@ For WPF API documentation, see the [.NET API Browser](https://docs.microsoft.com
For conceptual documentation (architecture, how-tos, etc.) most of the [documentation for WPF for .NET Framework](https://docs.microsoft.com/en-us/visualstudio/designers/getting-started-with-wpf?view=vs-2017) applies equally well to WPF for .NET Core 3. The main differences are around project structure and lack of Designer support.
## Known issues
* WPF Applications crash with `System.TypeLoadException` when the Visual C++ Redistributable for Visual Studio 2017 is not installed. The latest version of VC++ redistributable can be obtained from [the Visual C++ downloads page](https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads). This dependency will be removed prior to .NET Core 3.0 final release.
* This is tracked by [#37](https://github.com/dotnet/wpf/issues/37).
* WPF Applications crash with 'Module not found' with a stack originating from wpfgfx_cor3.dll (see [#167](https://github.com/dotnet/wpf/issues/167)). This is due to a dependency on d3d_compiler.dll added in .NET Framework 4.7. The workarounds linked [here](https://support.microsoft.com/en-us/help/4020302/the-net-framework-4-7-installation-is-blocked-on-windows-7-windows-ser) will fix this issue. This dependency will be handled prior to .NET Core 3.0 final release.
* This is tracked by [#189](https://github.com/dotnet/wpf/issues/189)
## Missing features
* In this initial preview, WPF for .NET Core doesn't support the XAML Designer. If you want to use the XAML Designer, you will need to do that in the context of a .NET Framework project, e.g. by linking your .NET Core source files into a .NET Framework project.
* You can see examples of how to do this in the [WPF Samples repo](https://github.com/Microsoft/WPF-Samples).
* To use the XAML Designer for WPF on .NET Core 3 you will need VS 2019 16.2 Preview 1.
* [XAML Browser applications (XBAPs)](https://docs.microsoft.com/en-us/dotnet/framework/wpf/app-development/wpf-xaml-browser-applications-overview) are not supported for .NET Core 3.
* Not all .NET Framework features are supported for .NET Core 3. You can use the [.NET API Portability Analyzer](https://github.com/microsoft/dotnet-apiport) to see if your existing code can run on .NET Core 3.
......
此差异已折叠。
......@@ -6,9 +6,11 @@
<add key="myget-fxlab" value="https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
<add key="arcade" value="https://dotnetfeed.blob.core.windows.net/dotnet-tools-internal/index.json" />
<add key="dotnet-core" value="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json" />
<add key="dotnet-coreclr" value="https://dotnetfeed.blob.core.windows.net/dotnet-coreclr/index.json" />
<add key="myget-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
<add key="dotnet-wd" value="https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json" />
<add key="aspnet-core" value="https://dotnetfeed.blob.core.windows.net/aspnet-aspnetcore/index.json" />
<!--
Add additional paths here
For e.g., if you want to test a locally build nuget package, you can add it like this:
......

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28010.2026
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DrtXaml.Tests", "src\Microsoft.DotNet.Wpf\test\DRT\DrtXaml\DrtXaml\DrtXaml.Tests.csproj", "{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestServices", "src\Microsoft.DotNet.Wpf\test\Common\TestServices\TestServices.csproj", "{387F3700-8C0B-4CEC-A68A-1725F656A249}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XamlTestClasses", "src\Microsoft.DotNet.Wpf\test\DRT\DrtXaml\XamlTestClasses\XamlTestClasses.csproj", "{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XamlTestClasses.FriendWithKey", "src\Microsoft.DotNet.Wpf\test\DRT\DrtXaml\XamlTestClasses.FriendWithKey\XamlTestClasses.FriendWithKey.csproj", "{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "XamlTestClasses.FriendWithoutKey", "src\Microsoft.DotNet.Wpf\test\DRT\DrtXaml\XamlTestClasses.FriendWithoutKey\XamlTestClasses.FriendWithoutKey.csproj", "{7D204145-BB36-4239-AD55-24DCE26BE997}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BamlTestClasses40", "src\Microsoft.DotNet.Wpf\test\DRT\DrtXaml\BamlTestClasses40\BamlTestClasses40.csproj", "{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BamlAvoidXmlTest", "src\Microsoft.DotNet.Wpf\test\DRT\DrtXaml\BamlAvoidXmlTest\BamlAvoidXmlTest.csproj", "{9163F98E-E941-45F5-9A57-47F375F50333}"
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
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Debug|x64.ActiveCfg = Debug|x64
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Debug|x64.Build.0 = Debug|x64
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Debug|x86.ActiveCfg = Debug|Any CPU
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Debug|x86.Build.0 = Debug|Any CPU
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Release|Any CPU.Build.0 = Release|Any CPU
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Release|x64.ActiveCfg = Release|x64
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Release|x64.Build.0 = Release|x64
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Release|x86.ActiveCfg = Release|Any CPU
{FAB114A2-2C6C-4372-A6BB-BC087B646E3A}.Release|x86.Build.0 = Release|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Debug|Any CPU.Build.0 = Debug|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Debug|x64.ActiveCfg = Debug|x64
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Debug|x64.Build.0 = Debug|x64
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Debug|x86.ActiveCfg = Debug|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Debug|x86.Build.0 = Debug|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Release|Any CPU.ActiveCfg = Release|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Release|Any CPU.Build.0 = Release|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Release|x64.ActiveCfg = Release|x64
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Release|x64.Build.0 = Release|x64
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Release|x86.ActiveCfg = Release|Any CPU
{387F3700-8C0B-4CEC-A68A-1725F656A249}.Release|x86.Build.0 = Release|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Debug|x64.ActiveCfg = Debug|x64
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Debug|x64.Build.0 = Debug|x64
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Debug|x86.ActiveCfg = Debug|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Debug|x86.Build.0 = Debug|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Release|Any CPU.Build.0 = Release|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Release|x64.ActiveCfg = Release|x64
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Release|x64.Build.0 = Release|x64
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Release|x86.ActiveCfg = Release|Any CPU
{3C1FC36C-E3E6-4EED-9ECA-CFF2EB950486}.Release|x86.Build.0 = Release|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Debug|x64.ActiveCfg = Debug|x64
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Debug|x64.Build.0 = Debug|x64
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Debug|x86.ActiveCfg = Debug|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Debug|x86.Build.0 = Debug|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Release|Any CPU.Build.0 = Release|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Release|x64.ActiveCfg = Release|x64
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Release|x64.Build.0 = Release|x64
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Release|x86.ActiveCfg = Release|Any CPU
{BA5AFF97-E993-49CB-BD2D-593F85E83FD5}.Release|x86.Build.0 = Release|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Debug|x64.ActiveCfg = Debug|x64
{7D204145-BB36-4239-AD55-24DCE26BE997}.Debug|x64.Build.0 = Debug|x64
{7D204145-BB36-4239-AD55-24DCE26BE997}.Debug|x86.ActiveCfg = Debug|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Debug|x86.Build.0 = Debug|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Release|Any CPU.Build.0 = Release|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Release|x64.ActiveCfg = Release|x64
{7D204145-BB36-4239-AD55-24DCE26BE997}.Release|x64.Build.0 = Release|x64
{7D204145-BB36-4239-AD55-24DCE26BE997}.Release|x86.ActiveCfg = Release|Any CPU
{7D204145-BB36-4239-AD55-24DCE26BE997}.Release|x86.Build.0 = Release|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Debug|x64.ActiveCfg = Debug|x64
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Debug|x64.Build.0 = Debug|x64
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Debug|x86.ActiveCfg = Debug|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Debug|x86.Build.0 = Debug|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Release|Any CPU.Build.0 = Release|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Release|x64.ActiveCfg = Release|x64
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Release|x64.Build.0 = Release|x64
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Release|x86.ActiveCfg = Release|Any CPU
{2127AC4D-78F4-44BE-A93F-8872EA9A8BB2}.Release|x86.Build.0 = Release|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Debug|x64.ActiveCfg = Debug|x64
{9163F98E-E941-45F5-9A57-47F375F50333}.Debug|x64.Build.0 = Debug|x64
{9163F98E-E941-45F5-9A57-47F375F50333}.Debug|x86.ActiveCfg = Debug|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Debug|x86.Build.0 = Debug|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Release|Any CPU.Build.0 = Release|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Release|x64.ActiveCfg = Release|x64
{9163F98E-E941-45F5-9A57-47F375F50333}.Release|x64.Build.0 = Release|x64
{9163F98E-E941-45F5-9A57-47F375F50333}.Release|x86.ActiveCfg = Release|Any CPU
{9163F98E-E941-45F5-9A57-47F375F50333}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B4340004-DAC0-497D-B69D-CFA7CD93F567}
EndGlobalSection
EndGlobal
......@@ -4,19 +4,13 @@
# Parameters ARE available in template expressions, and parameters can have default values,
# so they can be used to control yaml flow.
#
# TODO:
# BuildMsBuildSdkPackages, _BuildMsBuildSdkPackages, _BuildMsBuildSdkPackagesArgs should be removed eventually, when
# Microsoft.DotNet.Arcade.Wpf.Sdk is moved from dnceng/dotnet-wpf-int to github/dotnet/wpf.
# When that move happens, there would be no need to suppress the Sdk build by default. Currently,
# allowing the Sdk to build every time will result in an infinite loop that triggers a dotnet/wpf built,
variables:
# clean the local repo on the build agents
Build.Repository.Clean: true
# When set to true in a manual built, it produces and publishes
# Microsoft.DotNet.Arcade.Wpf.Sdk
BuildMsBuildSdkPackages: false
_PublishUsingPipelines: true
_DotNetArtifactsCategory: WINDOWSDESKTOP
......
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ProductDependencies>
<Dependency Name="Microsoft.Private.Winforms" Version="4.8.0-preview5.19222.16">
<Dependency Name="Microsoft.Private.Winforms" Version="4.8.0-preview6.19279.2">
<Uri>https://github.com/dotnet/winforms</Uri>
<Sha>ac5d565f7a9b42c9031a45bfd4a96f1bae0a5aa5</Sha>
<Sha>bbde30e7f09411d9c045015e8f3b6517bec2828a</Sha>
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="Microsoft.Win32.Registry" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.CodeDom" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.CodeDom" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Configuration.ConfigurationManager" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Configuration.ConfigurationManager" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Diagnostics.EventLog" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.DirectoryServices" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.DirectoryServices" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Drawing.Common" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Drawing.Common" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Reflection.Emit" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Reflection.Emit" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Reflection.MetadataLoadContext" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Reflection.MetadataLoadContext" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Security.AccessControl" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.AccessControl" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Cryptography.Xml" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Permissions" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Security.Principal.Windows" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="System.Windows.Extensions" Version="4.6.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="System.Windows.Extensions" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.App" Version="3.0.0-preview5-27621-08">
<Dependency Name="Microsoft.NETCore.App" Version="3.0.0-preview6-27730-01">
<Uri>https://github.com/dotnet/core-setup</Uri>
<Sha>416ae9f2f223d349130198b96d7ce9c617fa25cd</Sha>
<Sha>63abc77da6d99470caa5bfa0465afe244105e595</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19220.1">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="1.0.0-beta.19302.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c24866e3dece1ac0af7b54ff783d706019a05902</Sha>
<Sha>e6a5d5f970bb872451c6310ae34eda31041fb552</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="1.0.0-beta.19220.1">
<Dependency Name="Microsoft.DotNet.CodeAnalysis" Version="1.0.0-beta.19302.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>c24866e3dece1ac0af7b54ff783d706019a05902</Sha>
<Sha>e6a5d5f970bb872451c6310ae34eda31041fb552</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview5.19221.5" CoherentParentDependency="Microsoft.NETCore.App">
<Dependency Name="Microsoft.NETCore.Platforms" Version="3.0.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>b96247e76506e81ff6eb28dd2a14914a59e2a257</Sha>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Wpf.DncEng" Version="4.8.0-preview6.19302.3">
<Uri>https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int</Uri>
<Sha>203957c8267fb90505dc6c1a12b2d7ad2fe7a47e</Sha>
</Dependency>
<Dependency Name="System.IO.Packaging" Version="4.6.0-preview6.19279.8" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/corefx</Uri>
<Sha>e23119d577e644d2c2a25419c88c1181681358e0</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.Runtime.CoreCLR" Version="3.0.0-preview6.19280.1" CoherentParentDependency="Microsoft.NETCore.App">
<Uri>https://github.com/dotnet/coreclr</Uri>
<Sha>41832cedbb2d46362239d2b272964a39ca37cd89</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.ILDAsm" Version="3.0.0-preview6.19280.1" CoherentParentDependency="Microsoft.NETCore.Runtime.CoreCLR">
<Uri>https://github.com/dotnet/coreclr</Uri>
<Sha>41832cedbb2d46362239d2b272964a39ca37cd89</Sha>
</Dependency>
<Dependency Name="Microsoft.NETCore.ILAsm" Version="3.0.0-preview6.19280.1" CoherentParentDependency="Microsoft.NETCore.Runtime.CoreCLR">
<Uri>https://github.com/dotnet/coreclr</Uri>
<Sha>41832cedbb2d46362239d2b272964a39ca37cd89</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
......@@ -2,42 +2,45 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>4.8.0</VersionPrefix>
<PreReleaseVersionLabel>preview5</PreReleaseVersionLabel>
<PreReleaseVersionLabel>preview6</PreReleaseVersionLabel>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<SystemReflectionMetadataLoadContextVersion>4.6.0-preview4.19212.13</SystemReflectionMetadataLoadContextVersion>
<MicrosoftPrivateWinformsVersion>4.8.0-preview5.19222.16</MicrosoftPrivateWinformsVersion>
<SystemDrawingCommonVersion>4.6.0-preview4.19212.13</SystemDrawingCommonVersion>
<SystemDirectoryServicesVersion>4.6.0-preview4.19212.13</SystemDirectoryServicesVersion>
<SystemIOPackagingVersion>4.6.0-preview6.19279.8</SystemIOPackagingVersion>
</PropertyGroup>
<!-- NuGet Package Versions -->
<PropertyGroup>
<MicrosoftPrivateWinformsVersion>4.8.0-preview5.19218.1</MicrosoftPrivateWinformsVersion>
<MicrosoftPrivateWinformsVersion>4.8.0-preview6.19279.2</MicrosoftPrivateWinformsVersion>
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/coreclr -->
<PropertyGroup>
<MicrosoftNETCoreRuntimeCoreCLRVersion>3.0.0-preview6.19280.1</MicrosoftNETCoreRuntimeCoreCLRVersion>
<MicrosoftNETCoreILDAsmVersion>3.0.0-preview6.19280.1</MicrosoftNETCoreILDAsmVersion>
<MicrosoftNETCoreILAsmVersion>3.0.0-preview6.19280.1</MicrosoftNETCoreILAsmVersion>
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/core-setup -->
<PropertyGroup>
<MicrosoftNETCoreAppVersion>3.0.0-preview5-27621-08</MicrosoftNETCoreAppVersion>
<MicrosoftNETCorePlatformsVersion>3.0.0-preview5.19221.5</MicrosoftNETCorePlatformsVersion>
<SystemDrawingCommonVersion>4.6.0-preview5.19221.5</SystemDrawingCommonVersion>
<SystemDirectoryServicesVersion>4.6.0-preview5.19221.5</SystemDirectoryServicesVersion>
<SystemReflectionMetadataLoadContextVersion>4.6.0-preview5.19221.5</SystemReflectionMetadataLoadContextVersion>
<MicrosoftNETCoreAppVersion>3.0.0-preview6-27730-01</MicrosoftNETCoreAppVersion>
<MicrosoftNETCorePlatformsVersion>3.0.0-preview6.19279.8</MicrosoftNETCorePlatformsVersion>
<SystemDrawingCommonVersion>4.6.0-preview6.19279.8</SystemDrawingCommonVersion>
<SystemDirectoryServicesVersion>4.6.0-preview6.19279.8</SystemDirectoryServicesVersion>
<SystemReflectionMetadataLoadContextVersion>4.6.0-preview6.19279.8</SystemReflectionMetadataLoadContextVersion>
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/corefx via core-setup coherency parent dependency -->
<PropertyGroup>
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview5.19221.5</MicrosoftWin32RegistryPackageVersion>
<SystemCodeDomPackageVersion>4.6.0-preview5.19221.5</SystemCodeDomPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>4.6.0-preview5.19221.5</SystemConfigurationConfigurationManagerPackageVersion>
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview5.19221.5</SystemDiagnosticsEventLogPackageVersion>
<SystemReflectionEmitPackageVersion>4.6.0-preview5.19221.5</SystemReflectionEmitPackageVersion>
<MicrosoftWin32RegistryPackageVersion>4.6.0-preview6.19279.8</MicrosoftWin32RegistryPackageVersion>
<SystemCodeDomPackageVersion>4.6.0-preview6.19279.8</SystemCodeDomPackageVersion>
<SystemConfigurationConfigurationManagerPackageVersion>4.6.0-preview6.19279.8</SystemConfigurationConfigurationManagerPackageVersion>
<SystemDiagnosticsEventLogPackageVersion>4.6.0-preview6.19279.8</SystemDiagnosticsEventLogPackageVersion>
<SystemReflectionEmitPackageVersion>4.6.0-preview6.19279.8</SystemReflectionEmitPackageVersion>
<SystemReflectionTypeExtensionsPackageVersion>4.6.0-preview4.19176.11</SystemReflectionTypeExtensionsPackageVersion>
<SystemSecurityAccessControlPackageVersion>4.6.0-preview5.19221.5</SystemSecurityAccessControlPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview5.19221.5</SystemSecurityCryptographyXmlPackageVersion>
<SystemSecurityPermissionsPackageVersion>4.6.0-preview5.19221.5</SystemSecurityPermissionsPackageVersion>
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview5.19221.5</SystemSecurityPrincipalWindowsPackageVersion>
<SystemWindowsExtensionsPackageVersion>4.6.0-preview5.19221.5</SystemWindowsExtensionsPackageVersion>
<SystemSecurityAccessControlPackageVersion>4.6.0-preview6.19279.8</SystemSecurityAccessControlPackageVersion>
<SystemSecurityCryptographyXmlPackageVersion>4.6.0-preview6.19279.8</SystemSecurityCryptographyXmlPackageVersion>
<SystemSecurityPermissionsPackageVersion>4.6.0-preview6.19279.8</SystemSecurityPermissionsPackageVersion>
<SystemSecurityPrincipalWindowsPackageVersion>4.6.0-preview6.19279.8</SystemSecurityPrincipalWindowsPackageVersion>
<SystemWindowsExtensionsPackageVersion>4.6.0-preview6.19279.8</SystemWindowsExtensionsPackageVersion>
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/arcade -->
<PropertyGroup>
<MicrosoftDotNetCodeAnalysisPackageVersion>1.0.0-beta.19220.1</MicrosoftDotNetCodeAnalysisPackageVersion>
<MicrosoftDotNetCodeAnalysisPackageVersion>1.0.0-beta.19302.2</MicrosoftDotNetCodeAnalysisPackageVersion>
</PropertyGroup>
<!-- Packages that come from https://github.com/dotnet/corefxlab -->
<PropertyGroup>
......@@ -60,7 +63,9 @@
<RestoreSources>
$(RestoreSources);
https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json
https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-coreclr/index.json;
https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json;
</RestoreSources>
</PropertyGroup>
<!--Package names-->
......@@ -69,5 +74,30 @@
<MicrosoftPrivateWinformsPackage>Microsoft.Private.Winforms</MicrosoftPrivateWinformsPackage>
<SystemDrawingCommonPackage>System.Drawing.Common</SystemDrawingCommonPackage>
<SystemDirectoryServicesPackage>System.DirectoryServices</SystemDirectoryServicesPackage>
<MicrosoftDotNetWpfDncEngPackage>Microsoft.DotNet.Wpf.DncEng</MicrosoftDotNetWpfDncEngPackage>
<SystemIOPackagingPackage>System.IO.Packaging</SystemIOPackagingPackage>
<SystemReflectionMetadataLoadContextPackage>System.Reflection.MetadataLoadContext</SystemReflectionMetadataLoadContextPackage>
</PropertyGroup>
<!--
This is a toolset dependency added for use *only* by tests
!!!This dependency creates a cycle in the dependency-graph, but only in the 'toolset' portion of the graph. !!!
Note: Also see [Dependency graph](https://github.com/dotnet/arcade/blob/master/Documentation/Darc.md#viewing-the-dependency-graph)
- https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int consumes Microsoft.DotNet.Wpf.GitHub published by dotnet/wpf (this repo)
- https://dev.azure.com/dnceng/internal/_git/dotnet-wpf-int produces Microsoft.DotNet.Wpf.DncEng
- Microsoft.DotNet.Wpf.DncEng should, normally, be passed further along (and be consumed back by dotnet/wpf)
- Many WPF tests are non-trivial integration tests which require references to the whole WPF stack.
- In order to satisfy these references, we consume Microsoft.DotNet.Wpf.DncEng for tests-only.
- This is added as a DARC subscription that
- (a) Updates EveryDay
- (b) Updates *only* in ".NET Core 3 Dev" channel
- (c) Does not update in ".NET Core 3 Release" channel
It is worth reiterating that this package *should not* be consumed to build the product.
-->
<PropertyGroup>
<MicrosoftDotNetWpfDncEngVersion>4.8.0-preview6.19302.3</MicrosoftDotNetWpfDncEngVersion>
</PropertyGroup>
</Project>
......@@ -13,11 +13,7 @@
<Import Project="$(WpfArcadeSdkToolsDir)ShippingProjects.props" />
<PropertyGroup>
<GenTraceSources>$(WpfArcadeSdkToolsDir)AvTrace\GenTraceSources.pl</GenTraceSources>
<GenXmlStringTable>$(WpfArcadeSdkToolsDir)GenXmlStringTable.pl</GenXmlStringTable>
<PublishWindowsPdb Condition="'$(IsShipping)'=='' And '$(IsPackagingProject)'!='true'">true</PublishWindowsPdb>
<LangVersion Condition="'$(LangVersion)'==''">8.0</LangVersion>
<CLSCompliant Condition="'$(CLSCompliant)'==''">true</CLSCompliant>
<IncludeDllSafeSearchPathAttribute Condition="'$(IncludeDllSafeSearchPathAttribute )'==''">true</IncludeDllSafeSearchPathAttribute>
......@@ -35,10 +31,12 @@
<Import Project="$(WpfArcadeSdkToolsDir)Redist.props" />
<Import Project="$(WpfArcadeSdkToolsDir)Pbt.props" />
<Import Project="$(WpfArcadeSdkToolsDir)Signing.props" />
<Import Project="$(WpfArcadeSdkToolsDir)CodeGen.props" />
<PropertyGroup>
<DebugType>full</DebugType>
<DebugType Condition="'$(Configuration)'=='Release'">pdbonly</DebugType>
<PerlCommand>"$(RepoRoot).tools\native\bin\strawberry-perl\$(StrawberryPerlVersion)\portableshell.bat"</PerlCommand>
<WpfCppProps>$(WpfArcadeSdkToolsDir)Wpf.Cpp.props</WpfCppProps>
......@@ -56,6 +54,11 @@
https://github.com/dotnet/arcade/issues/2304
-->
<NoWarn>$(NoWarn);NU3027</NoWarn>
<!--
Suppress NU1605 (Package downgrade warnings) when building inside Visual Studio
-->
<NoWarn Condition="'$(BuildingInsideVisualStudio)'=='true'">$(NoWarn);NU1605</NoWarn>
</PropertyGroup>
<!-- When an Sdk-style project sets NoTargets=true, it will produce no assemblies -->
......
......@@ -3,11 +3,11 @@
<Import Project="$(WpfArcadeSdkToolsDir)Signing.targets" />
<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="$(WpfArcadeSdkToolsDir)FolderPaths.targets"/>
<Import Project="$(WpfArcadeSdkToolsDir)RuntimeFrameworkReference.targets"/>
<Import Project="$(WpfArcadeSdkToolsDir)InlineTasks.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)ShippingProjects.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)GenerateProgramFileForTests.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)GenerateAvTraceMessages.targets"/>
<Import Project="$(WpfArcadeSdkToolsDir)Packaging.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)Publishing.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)ReferenceAssembly.targets"/>
......@@ -20,6 +20,8 @@
<Import Project="$(WpfArcadeSdkToolsDir)CodeAnalysis.targets" />
<Import Project="$(WpfArcadeSdkToolsDir)Wpf.Cpp.targets" Condition="'$(MSBuildProjectExtension)'=='.vcxproj'"/>
<Import Project="$(NoTargetsTargets)" Condition="'$(NoTargets)'=='true'"/>
<Import Project="$(WpfArcadeSdkToolsDir)InjectModuleInitializer.targets" Condition="'$(InjectModuleInitializer)'=='true'"/>
<Import Project="$(WpfArcadeSdkToolsDir)TestProjects.targets" />
<!-- PresentationBuildTasks related targets files -->
<Import Project="$(WpfArcadeSdkToolsDir)Pbt.targets" Condition="'$(InternalMarkupCompilation)'=='true'"/>
......
<Project>
<PropertyGroup>
<WpfCodeGenDir>$(WpfArcadeSdkToolsDir)CodeGen\</WpfCodeGenDir>
</PropertyGroup>
</Project>
\ No newline at end of file
<#@ template hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Xml" #>
<#@ assembly name="System.Xml.XDocument" #>
<#@ assembly name="System.Xml.Linq" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Xml.Linq" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>
<#@ parameter type="System.String" name="AvTraceMessageFile" #>
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// NOTE: This file was generated by $(WpfCodeGenDir)AvTrace\AvTraceMessages.tt.
// Any manual updates to this file will overwritten.
using System;
using System.Diagnostics;
namespace MS.Internal
{
<#
string fileName = this.Host.ResolvePath(AvTraceMessageFile);
XDocument doc = XDocument.Load(fileName);
foreach (XElement source in doc.Root.Elements("Source"))
{
string name = source.Attribute("Name").Value;
string traceClassName = source.Attribute("TraceNameOverride")?.Value ?? $"Trace{name}";
#>
static internal partial class <#= traceClassName #>
{
static private AvTrace _avTrace = new AvTrace(
delegate() { return PresentationTraceSources.<#=name#>Source; },
delegate() { PresentationTraceSources._<#=name#>Source = null; }
);
<#
int id = 0;
foreach (XElement traceDetails in source.Elements("TraceDetails"))
{
++id;
string traceName = traceDetails.Attribute("Name").Value;
#>
static AvTraceDetails _<#=traceName#>;
<# if (IsFormattedTraceMessage(traceDetails)) { #>
static public AvTraceDetails <#= traceName #>(params object[] args)
{
if ( _<#=traceName#> == null )
{
<# OutputTraceCreation(id, traceDetails); #>
}
return new AvTraceFormat(_<#= traceName #>, args);
}
<# } else { #>
static public AvTraceDetails <#= traceName #>
{
get
{
if ( _<#= traceName #> == null )
{
<# OutputTraceCreation(id, traceDetails); #>
}
return _<#= traceName #>;
}
}
<# } #>
<# } #>
/// <summary> Send a single trace output </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, params object[] parameters )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, parameters );
}
/// <summary> These help delay allocation of object array </summary>
static public void Trace( TraceEventType type, AvTraceDetails traceDetails )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1 )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1 } );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2 )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2 } );
}
static public void Trace( TraceEventType type, AvTraceDetails traceDetails, object p1, object p2, object p3 )
{
_avTrace.Trace( type, traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2, p3 } );
}
/// <summary> Send a singleton "activity" trace (really, this sends the same trace as both a Start and a Stop) </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails, params Object[] parameters )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, parameters );
}
/// <summary> These help delay allocation of object array </summary>
static public void TraceActivityItem( AvTraceDetails traceDetails )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[0] );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1 )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1 } );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2 )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2 } );
}
static public void TraceActivityItem( AvTraceDetails traceDetails, object p1, object p2, object p3 )
{
_avTrace.TraceStartStop( traceDetails.Id, traceDetails.Message, traceDetails.Labels, new object[] { p1, p2, p3 } );
}
static public bool IsEnabled
{
get { return _avTrace != null && _avTrace.IsEnabled; }
}
/// <summary> Is there a Tracesource? (See comment on AvTrace.IsEnabledOverride.) </summary>
static public bool IsEnabledOverride
{
get { return _avTrace.IsEnabledOverride; }
}
/// <summary> Re-read the configuration for this trace source </summary>
static public void Refresh()
{
_avTrace.Refresh();
}
}
<# } #>
}
<#+
string GetTraceDataString(XElement labels)
{
// We need to ensure that we have quotes around each of these so that they will be written with them
string traceDataString = $"\"{labels.Attribute("Message").Value}\"";
if (labels.HasElements)
{
foreach (XElement param in labels.Elements("Parameters"))
{
traceDataString += labels.LastNode != param ? $"\"{param}\", " : $"\"{param}\"";
}
}
return traceDataString;
}
bool IsFormattedTraceMessage(XElement traceDetails)
{
XElement labels = traceDetails.Element("Labels");
string traceMessage = labels.Attribute("Message").Value;
return traceMessage.Contains("{0}");
}
// Put any Output* methods at the end, as they tend to be a bit messier because they need the special tags.
// For ease of re-use, methods that output text should not make any assumptions about the indentation, and it
// should be the callers responsibility for properly indenting
void OutputTraceCreation(int id, XElement traceDetails)
{
XElement labels = traceDetails.Element("Labels");
string dataString = GetTraceDataString(labels);
#>
_<#= traceDetails.Attribute("Name").Value #> = new AvTraceDetails(<#=id#>, new string[] { <#= dataString #> } );
<#+
}
#>
\ No newline at end of file
<Project>
<PropertyGroup>
<AvTraceMessageFile>$(MSBuildProjectDirectory)\AvTraceMessages.xml</AvTraceMessageFile>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)AvTraceMessages.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>AvTraceMessages.cs</LastGenOutput>
<OutputFilePath>$(MSBuildProjectDirectory)\MS\Internal\Generated\</OutputFilePath>
</None>
<None Update="AvTraceMessages.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>$(MSBuildThisFileDirectory)AvTraceMessages.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<T4ParameterValues Include="AvTraceMessageFile">
<Value>$(AvTraceMessageFile)</Value>
<Visible>False</Visible>
</T4ParameterValues>
</ItemGroup>
</Project>
\ No newline at end of file
<Project>
<PropertyGroup>
<WindowsBaseAvTraceMessageFile>$(WpfSourceDir)\WindowsBase\AvTraceMessages.xml</WindowsBaseAvTraceMessageFile>
<PresentationCoreAvTraceMessageFile>$(WpfSourceDir)\PresentationCore\AvTraceMessages.xml</PresentationCoreAvTraceMessageFile>
<PresentationFrameworkAvTraceMessageFile>$(WpfSourceDir)\PresentationFramework\AvTraceMessages.xml</PresentationFrameworkAvTraceMessageFile>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)PresentationTraceSources.tt">
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>PresentationTraceSources.cs</LastGenOutput>
<OutputFilePath>$(WpfSourceDir)\WindowsBase\System\Diagnostics\Generated\</OutputFilePath>
</None>
<None Update="PresentationTraceSources.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>$(MSBuildThisFileDirectory)PresentationTraceSources.tt</DependentUpon>
</None>
</ItemGroup>
<ItemGroup>
<T4ParameterValues Include="AvTraceMessageFiles">
<Value>$(WindowsBaseAvTraceMessageFile);$(PresentationCoreAvTraceMessageFile);$(PresentationFrameworkAvTraceMessageFile)</Value>
<Visible>False</Visible>
</T4ParameterValues>
</ItemGroup>
</Project>
\ No newline at end of file
<#@ template hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Xml" #>
<#@ assembly name="System.Xml.XDocument" #>
<#@ assembly name="System.Xml.Linq" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Xml.Linq" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ import namespace="System.IO" #>
<#@ output extension=".cs" #>
<#@ parameter type="System.String" name="AvTraceMessageFiles" #>
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
// NOTE: This file was generated by $(WpfCodeGenDir)AvTrace\PresentationTraceSources.tt.
// Any manual updates to this file will overwritten.
using MS.Internal;
namespace System.Diagnostics
{
/// <summary>Access point for TraceSources</summary>
public static partial class PresentationTraceSources
{
<#
foreach (var avTraceMessageFile in AvTraceMessageFiles.Split(';'))
{
string fileName = this.Host.ResolvePath(avTraceMessageFile);
XDocument doc = XDocument.Load(fileName);
foreach (XElement source in doc.Root.Elements("Source"))
{
string name = source.Attribute("Name").Value;
#>
/// <summary><#=name#>Source for <#=name#></summary>
public static TraceSource <#=name#>Source
{
get
{
if (_<#=name#>Source == null)
{
_<#=name#>Source = CreateTraceSource("<#= source.Attribute("SourceName").Value #>");
}
return _<#=name#>Source;
}
}
internal static TraceSource _<#=name#>Source;
<# }
} #>
}
}
\ No newline at end of file
<Project>
<ItemGroup>
<Service Include="{508349b6-6b84-4df5-91f0-309beebad82d}" />
</ItemGroup>
<PropertyGroup>
<!-- Get the Visual Studio version: -->
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">16.0</VisualStudioVersion>
<!-- Keep the next element all on one line: -->
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<!-- This is what will cause the templates to be transformed when the project is built (default is false) -->
<TransformOnBuild>true</TransformOnBuild>
<!-- Set to false to transform files even if the output appears to be up-to-date (default is true) -->
<TransformOutOfDateOnly>false</TransformOutOfDateOnly>
</PropertyGroup>
<Import Project="$(VSToolsPath)\TextTemplating\Microsoft.TextTemplating.targets" />
<!-- ugly workaround. can be removed once the below issue is addressed: -->
<!-- https://github.com/dotnet/xliff-tasks/issues/75 -->
<UsingTask TaskName="Microsoft.VisualStudio.TextTemplating.Build.Tasks.TransformTemplates" AssemblyFile="$(VSToolsPath)\TextTemplating\Microsoft.TextTemplating.Build.Tasks.dll" />
<Target Name="ExecuteTransformations" DependsOnTargets="CreateT4ItemLists">
<Microsoft.VisualStudio.TextTemplating.Build.Tasks.TransformTemplates
TemplatesToProcess="@(T4TransformInputs)"
IncludeFolders="$(IncludeFolders)"
DirectiveProcessors="@(DirectiveProcessor)"
AssemblyReferences="@(T4AssemblyReference)"
ReferencePaths="@(T4ReferencePath)"
TrackerLogDirectory="$(TrackerLogDirectory)"
TrackFileAccess="$(TrackFileAccess)"
MinimalRebuildFromTracking="$(TransformOutOfDateOnly)"
OverwriteReadOnlyOutputFiles="$(OverwriteReadOnlyOutputFiles)"
ParameterValues="@(T4ParameterValues)"
>
<!-- List of output files that were generated by the task.
If a read-only version of the file was overwritten by the task, the
task item for that file will have the following metadata entry:
<ReadOnlyFileOverwritten>true<ReadOnlyFileOverwritten>
-->
<Output ItemName="GeneratedFiles" TaskParameter="GeneratedFiles"/>
<!-- List of output files that could not be generated because the file file
already exists and is read-only. -->
<Output ItemName="NonGeneratedFiles" TaskParameter="NonGeneratedFiles"/>
</Microsoft.VisualStudio.TextTemplating.Build.Tasks.TransformTemplates>
<PropertyGroup>
<!-- Unless another namespace has been specified, use the project namespace as the
default namespace from pre-processed files. -->
<PreprocessTemplateDefaultNamespace Condition=" $(PreprocessTemplateDefaultNamespace)=='' ">$(RootNamespace)</PreprocessTemplateDefaultNamespace>
</PropertyGroup>
<PreprocessTemplates
DefaultNamespace="$(PreprocessTemplateDefaultNamespace)"
TemplatesToProcess="@(T4PreprocessInputs)"
IncludeFolders="$(IncludeFolders)"
DirectiveProcessors="@(DirectiveProcessor)"
AssemblyReferences="@(T4AssemblyReference)"
ReferencePaths="@(T4ReferencePath)"
TrackerLogDirectory="$(TrackerLogDirectory)"
TrackFileAccess="$(TrackFileAccess)"
MinimalRebuildFromTracking="$(TransformOutOfDateOnly)"
OverwriteReadOnlyOutputFiles="$(OverwriteReadOnlyOutputFiles)"
ParameterValues="@(T4ParameterValues)"
>
<!-- List of output files that were generated by the task.
If a read-only version of the file was overwritten by the task, the
task item for that file will have the following metadata entry:
<ReadOnlyFileOverwritten>true<ReadOnlyFileOverwritten>
-->
<Output ItemName="GeneratedFiles" TaskParameter="GeneratedFiles"/>
<!-- List of output files that could not be generated because the file file
already exists and is read-only. -->
<Output ItemName="NonGeneratedFiles" TaskParameter="NonGeneratedFiles"/>
<!-- List of assemblies that are required to run the processed code. -->
<Output ItemName="T4RequiredAssemblies" TaskParameter="RequiredAssemblies"/>
</PreprocessTemplates>
</Target>
<!-- End workaround -->
</Project>
\ No newline at end of file
......@@ -120,7 +120,7 @@
-->
<UsingTask TaskName="ParseExtendedAssemblyInfo"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" >
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
<ParameterGroup>
<ExtendedAssemblyInfo ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<Result ParameterType="Microsoft.Build.Framework.ITaskItem[]" Output="true" />
......
......@@ -2,6 +2,8 @@
<PropertyGroup>
<WpfCycleBreakersDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\cycle-breakers\</WpfCycleBreakersDir>
<WpfSourceDir>$(RepoRoot)src\Microsoft.DotNet.Wpf\src\</WpfSourceDir>
<WpfSharedDir>$(WpfSourceDir)shared\</WpfSharedDir>
<WpfGraphicsPath>$(WpfSourceDir)WpfGfx\</WpfGraphicsPath>
<WpfGraphicsDir>$(WpfGraphicsPath)</WpfGraphicsDir>
<WpfPresentationNativeDir>$(WpfSourceDir)PresentationNative\</WpfPresentationNativeDir>
</PropertyGroup>
</Project>
<Project>
<PropertyGroup>
<!-- $(WpfSharedDir) is present in the current repository -->
<WpfSharedDir Condition="Exists('$(WpfSourceDir)shared\') And '$(RepositoryName)'!='dotnet-wpf-int'">$(WpfSourceDir)shared\</WpfSharedDir>
<!-- Consume from NuGet cache -->
<WpfSharedDir Condition="'$(WpfSharedDir)'=='' And Exists('$(WpfArcadeSdkRoot)src\shared\')">$(WpfArcadeSdkRoot)src\shared\</WpfSharedDir>
<!-- Consume from $(WpfTestArcadeWpfSdkPath) -->
<WpfSharedDir Condition="'$(WpfSharedDir)'=='' And Exists('$(WpfArcadeSdkRoot)..\..\src\Microsoft.DotNet.Wpf\src\Shared\')">$(WpfArcadeSdkRoot)..\..\src\Microsoft.DotNet.Wpf\src\Shared\</WpfSharedDir>
<!-- $(WpfCommonDir) is present in the current repository -->
<WpfCommonDir Condition="Exists('$(WpfSourceDir)Common\') And '$(RepositoryName)'!='dotnet-wpf-int'">$(WpfSourceDir)Common\</WpfCommonDir>
<!-- Consume from NuGet cache -->
<WpfCommonDir Condition="'$(WpfCommonDir)'=='' And Exists('$(WpfArcadeSdkRoot)src\Common\')">$(WpfArcadeSdkRoot)src\Common\</WpfCommonDir>
<!-- Consume from $(WpfTestArcadeWpfSdkPath) -->
<WpfCommonDir Condition="'$(WpfCommonDir)'=='' And Exists('$(WpfArcadeSdkRoot)..\..\src\Microsoft.DotNet.Wpf\src\Common\')">$(WpfArcadeSdkRoot)..\..\src\Microsoft.DotNet.Wpf\src\Common\</WpfCommonDir>
<WpfTracingDir>$(WpfSharedDir)Tracing\</WpfTracingDir>
</PropertyGroup>
</Project>
<Project>
<!-- We use a local RID here since we don't want to change the build layout by setting the actual RID. -->
<PropertyGroup>
<LocalRuntimeIdentifier Condition="'$(Platform)'=='x64' or '$(Platform)'=='x86' or '$(Platform)'=='arm' or '$(Platform)'=='arm64'">win-$(Platform)</LocalRuntimeIdentifier>
<LocalRuntimeIdentifier Condition="'$(Platform)'=='Win32' or '$(Platform)'=='AnyCPU'">win-x86</LocalRuntimeIdentifier>
<LocalRuntimeIdentifier Condition="'$(Architecture)'==''">win-x64</LocalRuntimeIdentifier>
</PropertyGroup>
<Choose>
<!--
Use the IL Tools that are compiled and distributed with .NET Core. WPF doesn't currently use these as default because they do not
support generating debugging information in the re-assembled binary.
-->
<When Condition="'$(UseNetCoreILTools)'=='true'">
<ItemGroup>
<PackageReference Include="$(PackageRuntimeIdentifierPrefix).Microsoft.NETCore.ILDAsm" Version="MicrosoftNETCoreILDAsmVersion" GeneratePathProperty="true" />
<PackageReference Include="$(PackageRuntimeIdentifierPrefix).Microsoft.NETCore.ILAsm" Version="MicrosoftNETCoreILAsmVersion" GeneratePathProperty="true" />
<PackageReference Include="$(PackageRuntimeIdentifierPrefix).Microsoft.NETCore.Runtime.CoreCLR" Version="MicrosoftNETCoreRuntimeCoreCLRVersion" GeneratePathProperty="true" />
</ItemGroup>
<PropertyGroup Condition="'$(LocalRuntimeIdentifier)'=='win-x86'">
<ILDAsmPath>$(Pkgruntime_win-x86_Microsoft_NETCore_ILDAsm)\runtimes\$(LocalRuntimeIdentifier)\native\</ILDAsmPath>
<ILAsmPath>$(Pkgruntime_win-x86_Microsoft_NETCore_ILAsm)\runtimes\$(LocalRuntimeIdentifier)\native\</ILAsmPath>
<CoreCLRPath>$(Pkgruntime_win-x86_Microsoft_NETCore_Runtime_CoreCLR)\runtimes\$(LocalRuntimeIdentifier)\native\</CoreCLRPath>
</PropertyGroup>
<PropertyGroup Condition="'$(LocalRuntimeIdentifier)'=='win-x64'">
<ILDAsmPath>$(Pkgruntime_win-x64_Microsoft_NETCore_ILDAsm)\runtimes\$(LocalRuntimeIdentifier)\native\</ILDAsmPath>
<ILAsmPath>$(Pkgruntime_win-x64_Microsoft_NETCore_ILAsm)\runtimes\$(LocalRuntimeIdentifier)\native\</ILAsmPath>
<CoreCLRPath>$(Pkgruntime_win-x64_Microsoft_NETCore_Runtime_CoreCLR)\runtimes\$(LocalRuntimeIdentifier)\native\</CoreCLRPath>
</PropertyGroup>
<PropertyGroup>
<ILToolsPath>$(ArtifactsTmpDir)\iltools\$(PackageRuntimeIdentifierPrefix)\</ILToolsPath>
<ILDAsm>$(ILToolsPath)ildasm.exe</ILDAsm>
<ILAsm>$(ILToolsPath)ilasm.exe</ILAsm>
</PropertyGroup>
</When>
</Choose>
<PropertyGroup>
<TaskFactory>RoslynCodeTaskFactory</TaskFactory>
<TaskFactoryAssemblyFile>$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll</TaskFactoryAssemblyFile>
</PropertyGroup>
<ItemGroup>
<TaskFactoryReference Include="mscorlib" />
<TaskFactoryReference Include="netstandard" />
</ItemGroup>
<!--
Locate the IL tools included with the highest version of .NET Framework and the .NET Framework SDK installed on the machine.
-->
<UsingTask TaskName="FindDotNetFrameworkILToolsTask"
TaskFactory="$(TaskFactory)"
AssemblyFile="$(TaskFactoryAssemblyFile)">
<ParameterGroup>
<ILAsm ParameterType="System.String" Output="true"/>
<ILDAsm ParameterType="System.String" Output="true"/>
<DotNetBitness ParameterType="System.String" Required="true"/>
</ParameterGroup>
<Task>
<Using Namespace="Microsoft.Build.Utilities" />
<Code Type="fragment" Language="cs">
<![CDATA[
try
{
var bitness = (DotNetFrameworkArchitecture)Enum.Parse(typeof(DotNetFrameworkArchitecture), DotNetBitness);
ILAsm = ToolLocationHelper.GetPathToDotNetFrameworkFile("ILAsm.exe", TargetDotNetFrameworkVersion.VersionLatest, bitness);
ILDAsm = ToolLocationHelper.GetPathToDotNetFrameworkSdkFile("ILDAsm.exe", TargetDotNetFrameworkVersion.VersionLatest, bitness);
}
catch(Exception e)
{
Log.LogError("FindDotNetFrameworkILToolsTask: Could not find .NET Framework IL Tools: " + e.ToString());
}
]]>
</Code>
</Task>
</UsingTask>
<!-- Call into the supplied ILDAsm. -->
<UsingTask TaskName="ILDasmTask"
TaskFactory="$(TaskFactory)"
AssemblyFile="$(TaskFactoryAssemblyFile)">
<ParameterGroup>
<ILDAsm ParameterType="System.String" Required="true" />
<!-- The assembly to disassemble -->
<Assembly ParameterType="System.String" Required="true" />
<Out ParameterType="System.String" Required="true" Output="true" />
<!-- Output in HTML format -->
<Html ParameterType="System.Boolean" Required="false" />
<!-- Output in rich text format -->
<Rtf ParameterType="System.Boolean" Required="false" />
<!-- Show actual bytes (in hex) as instruction comments -->
<Bytes ParameterType="System.Boolean" Required="false" />
<!-- Show exception handling clauses in raw form -->
<RawEH ParameterType="System.Boolean" Required="false" />
<!-- Show metadata tokens of classes and members -->
<Tokens ParameterType="System.Boolean" Required="false" />
<!-- Show original source lines as comments -->
<Source ParameterType="System.Boolean" Required="false" />
<!-- Include references to original source lines -->
<LineNum ParameterType="System.Boolean" Required="false" />
<!-- =<vis>[+<vis>...] Only disassemble the items with specified
visibility. (<vis> = PUB | PRI | FAM | ASM | FAA | FOA | PSC)
-->
<Visibility ParameterType="System.String" Required="false" />
<!-- Only disassemble the public items (same as /VIS=PUB) -->
<PubOnly ParameterType="System.Boolean" Required="false" />
<!-- Include all names into single quotes -->
<QuoteAllNames ParameterType="System.Boolean" Required="false" />
<!-- Suppress output of custom attributes -->
<NoCA ParameterType="System.Boolean" Required="false" />
<!-- Output CA blobs in verbal form (default - in binary form) -->
<CAVerbal ParameterType="System.Boolean" Required="false" />
<!-- Suppress disassembly progress bar window pop-up -->
<NoBar ParameterType="System.Boolean" Required="false" />
<!-- Use UTF-8 encoding for output (default - ANSI) -->
<Utf8 ParameterType="System.Boolean" Required="false" />
<!-- Use UNICODE encoding for output -->
<Unicode ParameterType="System.Boolean" Required="false" />
<!-- Suppress IL assembler code output -->
<NoIL ParameterType="System.Boolean" Required="false" />
<!-- Use forward class declaration -->
<Forward ParameterType="System.Boolean" Required="false" />
<!-- Output full list of types (to preserve type ordering in round-trip) -->
<TypeList ParameterType="System.Boolean" Required="false" />
<!-- Display .NET projection view if input is a .winmd file -->
<Project ParameterType="System.Boolean" Required="false" />
<!-- Include file headers information in the output -->
<Headers ParameterType="System.Boolean" Required="false" />
<!-- =<class>[::<method>[(<sig>)] Disassemble the specified item only -->
<Item ParameterType="System.String" Required="false" />
<!-- Include statistics on the image -->
<Stats ParameterType="System.Boolean" Required="false" />
<!-- Include list of classes defined in the module -->
<ClassList ParameterType="System.Boolean" Required="false" />
<!-- Combination of /HEADER,/BYTES,/STATS,/CLASSLIST,/TOKENS -->
<All ParameterType="System.Boolean" Required="false" />
<!--
Options for EXE,DLL,OBJ and LIB files:
/METADATA[=<specifier>] Show MetaData, where <specifier> is:
MDHEADER Show MetaData header information and sizes.
HEX Show more things in hex as well as words.
CSV Show the record counts and heap sizes.
UNREX Show unresolved externals.
SCHEMA Show the MetaData header and schema information.
RAW Show the raw MetaData tables.
HEAPS Show the raw heaps.
VALIDATE Validate the consistency of the metadata.
-->
<Metadata ParameterType="System.String" Required="false" />
<!--
Options for LIB files only:
/OBJECTFILE=<obj_file_name> Show MetaData of a single object file in library
-->
<ObjectFile ParameterType="System.String" Required="false" />
</ParameterGroup>
<Task>
<Code Type="Class" Language="cs" Source="$(WpfArcadeSdkToolsDir)InjectModuleInitializer\ILDAsmTask.cs" />
</Task>
</UsingTask>
<!-- Call into the supplied ILAsm. -->
<UsingTask TaskName="ILAsmTask"
TaskFactory="$(TaskFactory)"
AssemblyFile="$(TaskFactoryAssemblyFile)">
<ParameterGroup>
<ILAsm ParameterType="System.String" Required="true" />
<SourceFile ParameterType="System.String" Required="true" />
<Out ParameterType="System.String" Required="true" Output="true" />
<!-- /NOLOGO Don't type the logo -->
<NoLogo ParameterType="System.Boolean" Required="false" />
<!--/QUIET Don't report assembly progress -->
<Quiet ParameterType="System.Boolean" Required="false" />
<!--/NOAUTOINHERIT Disable inheriting from System.Object by default-->
<NoAutoInherit ParameterType="System.Boolean" Required="false" />
<!--/DLL Compile to .dll-->
<Dll ParameterType="System.Boolean" Required="false" />
<!--/EXE Compile to .exe (default)-->
<Exe ParameterType="System.Boolean" Required="false" />
<!--/PDB Create the PDB file without enabling debug info tracking-->
<Pdb ParameterType="System.Boolean" Required="false" />
<!--/APPCONTAINER Create an AppContainer exe or dll-->
<AppContainer ParameterType="System.Boolean" Required="false" />
<!--/DEBUG Disable JIT optimization, create PDB file, use sequence points from PDB-->
<Debug ParameterType="System.Boolean" Required="false" />
<!--/DEBUG=IMPL Disable JIT optimization, create PDB file, use implicit sequence points-->
<DebugDisableJitOptimization ParameterType="System.Boolean" Required="false" />
<!--/DEBUG=OPT Enable JIT optimization, create PDB file, use implicit sequence points -->
<DebugEnableJitOptimization ParameterType="System.Boolean" Required="false" />
<!--/OPTIMIZE Optimize long instructions to short-->
<Optimize ParameterType="System.Boolean" Required="false" />
<!--/FOLD Fold the identical method bodies into one-->
<Fold ParameterType="System.Boolean" Required="false" />
<!--/CLOCK Measure and report compilation times-->
<Clock ParameterType="System.Boolean" Required="false" />
<!--/RESOURCE=<res_file> Link the specified resource file (*.res) into resulting .exe or .dll -->
<Resource ParameterType="System.String" Required="false" />
<!--/CVRES=<path_to_file> Set path to cvtres tool: /CVR=cvtres.exe /CVR=tool\cvtres.cmd /CVR=D:\tool\-->
<CvRes ParameterType="System.String" Required="false" />
<!--/KEY=<keyfile> Compile with strong signature
(<keyfile> contains private key)-->
<KeyFile ParameterType="System.String" Required="false" />
<!--/KEY=@<keysource> Compile with strong signature
(<keysource> is the private key source name)-->
<KeySource ParameterType="System.String" Required="false" />
<!--/INCLUDE=<path> Set path to search for #include'd files-->
<Include ParameterType="System.String" Required="false" />
<!--/SUBSYSTEM=<int> Set Subsystem value in the NT Optional header-->
<SubSystem ParameterType="System.String" Required="false" />
<!--/SSVER=<int>.<int> Set Subsystem version number in the NT Optional header-->
<SubSystemVersion ParameterType="System.String" Required="false" />
<!--/FLAGS=<int> Set CLR ImageFlags value in the CLR header-->
<Flags ParameterType="System.String" Required="false" />
<!--/ALIGNMENT=<int> Set FileAlignment value in the NT Optional header-->
<Alignment ParameterType="System.String" Required="false" />
<!--/BASE=<int> Set ImageBase value in the NT Optional header (max 2GB for 32-bit images)-->
<Base ParameterType="System.String" Required="false" />
<!--/STACK=<int> Set SizeOfStackReserve value in the NT Optional header-->
<Stack ParameterType="System.String" Required="false" />
<!--/MDV=<version_string> Set Metadata version string-->
<MetadataVersion ParameterType="System.String" Required="false" />
<!--/MSV=<int>.<int> Set Metadata stream version (<major>.<minor>)-->
<MetadataStreamVersion ParameterType="System.String" Required="false" />
<!--/PE64 Create a 64bit image (PE32+)-->
<PE64 ParameterType="System.String" Required="false" />
<!--/HIGHENTROPYVA Set High Entropy Virtual Address capable PE32+ images (default for /APPCONTAINER)-->
<HighEntropyVirtualAddress ParameterType="System.String" Required="false" />
<!--/NOCORSTUB Suppress generation of CORExeMain stub-->
<NoCorStub ParameterType="System.String" Required="false" />
<!--/STRIPRELOC Indicate that no base relocations are needed-->
<StripReLoc ParameterType="System.String" Required="false" />
<!--/ITANIUM Target processor: Intel Itanium-->
<Itanium ParameterType="System.String" Required="false" />
<!--/X64 Target processor: 64bit AMD processor-->
<X64 ParameterType="System.String" Required="false" />
<!--/ARM Target processor: ARM processor-->
<Arm ParameterType="System.String" Required="false" />
<!--/32BITPREFERRED Create a 32BitPreferred image (PE32)-->
<Prefer32Bit ParameterType="System.String" Required="false" />
<!--/ENC=<file> Create Edit-and-Continue deltas from specified source file-->
<ENC ParameterType="System.String" Required="false" />
</ParameterGroup>
<Task>
<Code Type="Class" Language="cs" Source="$(WpfArcadeSdkToolsDir)InjectModuleInitializer\ILAsmTask.cs" />
</Task>
</UsingTask>
<!-- Add a module initializer to the supplied IL file. -->
<UsingTask TaskName="AddModuleConstructorTask"
TaskFactory="$(TaskFactory)"
AssemblyFile="$(TaskFactoryAssemblyFile)">
<ParameterGroup>
<ILFile ParameterType="System.String" Required="true" Output="true"/>
<MsCorLibAssemblySectionIL ParameterType="System.String" Required="true" Output="true"/>
<ModuleConstructorIL ParameterType="System.String" Required="true" Output="true"/>
</ParameterGroup>
<Task>
<Code Type="Class" Language="cs" Source="$(WpfArcadeSdkToolsDir)InjectModuleInitializer\AddModuleConstructorTask.cs" />
</Task>
</UsingTask>
<!--
In order to run ILDAsm and ILAsm from .NET Core, we need both the IL* executables and the corresponding version
of CoreCLR in the same directory. This target ensures that for every project using module initializer
injection.
See: https://github.com/dotnet/coreclr/issues/23840 and https://github.com/dotnet/coreclr/issues/15059
-->
<Target Name="CopyILTools" BeforeTargets="DeconstructDll" Condition="'$(UseNetCoreILTools)'=='true'">
<ItemGroup>
<ILDAsm_Files Include="$(ILDAsmPath)*"/>
<ILAsm_Files Include="$(ILAsmPath)*"/>
<CoreCLR_Files Include="$(CoreCLRPath)*"/>
</ItemGroup>
<MakeDir Directories="$(ILToolsPath)" Condition="!Exists($(ILToolsPath))"/>
<Copy SourceFiles="@(ILDAsm_Files)" DestinationFolder="$(ILToolsPath)" SkipUnchangedFiles="true"/>
<Copy SourceFiles="@(ILAsm_Files)" DestinationFolder="$(ILToolsPath)" SkipUnchangedFiles="true"/>
<Copy SourceFiles="@(CoreCLR_Files)" DestinationFolder="$(ILToolsPath)" SkipUnchangedFiles="true"/>
</Target>
<!--
Locate the IL tools included with the highest version of .NET Framework and the .NET Framework SDK installed on the machine.
-->
<Target Name="FindNetFrameworkILTools" BeforeTargets="DeconstructDll" Condition="'$(UseNetCoreILTools)'!='true'">
<PropertyGroup>
<DotNetFrameworkBitness Condition="'$(LocalRuntimeIdentifier)'=='win-x64'">Bitness64</DotNetFrameworkBitness>
<DotNetFrameworkBitness Condition="'$(LocalRuntimeIdentifier)'=='win-x86'">Bitness32</DotNetFrameworkBitness>
</PropertyGroup>
<FindDotNetFrameworkILToolsTask DotNetBitness="$(DotNetFrameworkBitness)">
<Output TaskParameter="ILDAsm" PropertyName="ILDAsm" />
<Output TaskParameter="ILAsm" PropertyName="ILAsm" />
</FindDotNetFrameworkILToolsTask>
</Target>
<!-- Disassemble the target binary. -->
<Target Name="DeconstructDll"
AfterTargets="CreateSatelliteAssemblies"
Inputs="$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)'))"
Outputs="$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName).il'))">
<PropertyGroup>
<InFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)'))</InFile>
<OutFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName).il'))</OutFile>
</PropertyGroup>
<Delete Files="$(OutFile)"
Condition="Exists('$(OutFile)')" />
<ILDasmTask ILDAsm="$(ILDAsm)"
Assembly="$(InFile)"
Condition="Exists('$(InFile)')"
LineNum="true"
Out="$(OutFile)" />
</Target>
<!-- Inject the module initializer into the target IL. -->
<Target Name="AddModuleConstructor"
AfterTargets="DeconstructDll">
<PropertyGroup>
<ILFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName).il'))</ILFile>
<ModuleInitializer>$(WpfArcadeSdkToolsDir)InjectModuleInitializer\ModuleInitializer.il</ModuleInitializer>
<MsCorLibAssemblySection>$(WpfArcadeSdkToolsDir)InjectModuleInitializer\MsCorLibAssemblySection.il</MsCorLibAssemblySection>
</PropertyGroup>
<AddModuleConstructorTask ILFile="$(ILFile)"
MsCorLibAssemblySectionIL="$(ModuleInitializer)"
ModuleConstructorIL="$(MsCorLibAssemblySection)"/>
</Target>
<!-- Re-assembly the target binary. -->
<Target Name="ReconstituteDll"
AfterTargets="AddModuleConstructor"
Inputs="$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName).il'))"
Outputs="$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)'))">
<PropertyGroup>
<TargetFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName)$(TargetExt)'))</TargetFile>
<ILFile>$([System.IO.Path]::GetFullPath('$(IntermediateOutputPath)$(AssemblyName).il'))</ILFile>
</PropertyGroup>
<!--
Make a backup before overwriting $(TargetFile)
-->
<Copy SourceFiles="$(TargetFile)"
DestinationFiles="$(TargetFile).bak"
Condition="Exists('$(TargetFile)')" />
<ILAsmTask ILAsm="$(ILAsm)"
SourceFile="$(ILFile)"
Out="$(TargetFile)"
Dll="true"
Debug="true" />
</Target>
</Project>
using System;
using System.Diagnostics;
using System.IO;
using System.Text.RegularExpressions;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace WpfArcadeSdk.Build.Tasks
{
/// <summary>
/// Append the supplied module constructor to the supplied IL file.
/// Using this requires that the DLL has implemented a static class named
/// ModuleInitializer with a static void Initialize function. This class
/// is called from the module initializer.
/// </summary>
public class AddModuleConstructorTask : Task
{
/// <summary>
/// The original IL file to manipulate
/// </summary>
[Required]
public string ILFile { get; set; }
/// <summary>
/// Contains the IL section referencing mscorlib.
/// This is inserted if not already present.
/// </summary>
[Required]
public string MsCorLibAssemblySectionIL { get; set; }
/// <summary>
/// Contains the IL of the module constructor
/// </summary>
[Required]
public string ModuleConstructorIL { get; set; }
public override bool Execute()
{
try
{
var moduleConstructorIL = File.ReadAllText(ModuleConstructorIL);
var msCorLibAssemblySectionIL = File.ReadAllText(MsCorLibAssemblySectionIL);
var sourceIL = File.ReadAllText(ILFile);
using (var outputIL = new StreamWriter(File.Open(ILFile, FileMode.Truncate)))
{
if (Regex.Match(sourceIL, @"\.class.+?ModuleInitializer.+?\.method.+?static.+?Initialize\(\).+?end of class ModuleInitializer", RegexOptions.Singleline) == Match.Empty)
{
Log.LogError("Inserting a module initializer requires the assembly to implement a class named ModuleInitializer with a static parameterless method named Initialize.");
return false;
}
if (Regex.Match(sourceIL, @"\.assembly extern mscorlib", RegexOptions.Singleline) == Match.Empty)
{
outputIL.WriteLine(msCorLibAssemblySectionIL);
}
if (Regex.Match(sourceIL, @"\.class private auto ansi '\<Module\>'.+?\.method private hidebysig specialname rtspecialname static void \.cctor \(\) cil managed ", RegexOptions.Singleline) == Match.Empty)
{
outputIL.WriteLine(moduleConstructorIL);
}
else
{
Log.LogError("Cannot insert a module initializer into an assembly that already contains one.");
return false;
}
outputIL.WriteLine(sourceIL);
}
return true;
}
catch (Exception e)
{
Log.LogError(e.ToString() + Environment.NewLine + e.StackTrace);
return false;
}
}
}
}
using System;
using System.Diagnostics;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace WpfArcadeSdk.Build.Tasks
{
/// <summary>
/// Runs ILAsm from the path supplied on the assembly supplied.
/// </summary>
public class ILAsmTask : Task
{
/// <summary>
/// The full path to ILAsm.exe
/// </summary>
[Required]
public string ILAsm { get; set; }
/// <summary>
/// The source file to assemble
/// </summary>
[Required]
public string SourceFile { get; set; }
/// <summary>
/// The output path
/// </summary>
[Required]
public string Out { get; set; }
/// <summary>
/// /NOLOGO Don't type the logo
///</summary>
public bool NoLogo { get; set; }
/// <summary>
/// /QUIET Don't report assembly progress
///</summary>
public bool Quiet { get; set; }
/// <summary>
/// /NOAUTOINHERIT Disable inheriting from System.Object by default
///</summary>
public bool NoAutoInherit { get; set; }
/// <summary>
/// /DLL Compile to.dll
///</summary>
public bool Dll { get; set; }
/// <summary>
/// /EXE Compile to.exe(default)
///</summary>
public bool Exe { get; set; }
/// <summary>
/// /PDB Create the PDB file without enabling debug info tracking
///</summary>
public bool Pdb { get; set; }
/// <summary>
/// /APPCONTAINER Create an AppContainer exe or dll
///</summary>
public bool AppContainer { get; set; }
/// <summary>
/// /DEBUG Disable JIT optimization, create PDB file, use sequence points from PDB
///</summary>
public bool Debug { get; set; }
/// <summary>
/// /DEBUG=IMPL Disable JIT optimization, create PDB file, use implicit sequence points
///</summary>
public bool DebugDisableJitOptimization { get; set; }
/// <summary>
/// / DEBUG = OPT Enable JIT optimization, create PDB file, use implicit sequence points
///</summary>
public bool DebugEnableJitOptimization { get; set; }
/// <summary>
/// / OPTIMIZE Optimize long instructions to short
///</summary>
public bool Optimize { get; set; }
/// <summary>
/// / FOLD Fold the identical method bodies into one
///</summary>
public bool Fold { get; set; }
/// <summary>
/// / CLOCK Measure and report compilation times
///</summary>
public bool Clock { get; set; }
/// <summary>
/// / RESOURCE =< res_file > Link the specified resource file(*.res) into resulting.exe or.dll
///</summary>
public string Resource { get; set; }
/// <summary>
/// / CVRES =< path_to_file > Set path to cvtres tool: /CVR= cvtres.exe / CVR = tool\cvtres.cmd /CVR= D:\tool\
///</summary>
public string CvRes { get; set; }
/// <summary>
/// /KEY =< keyfile > Compile with strong signature
/// (<keyfile> contains private key)
/// </summary>
public string KeyFile { get; set; }
/// <summary>
/// /KEY=@<keysource> Compile with strong signature
/// (<keysource> is the private key source name)
/// </summary>
public string KeySource { get; set; }
/// <summary>
/// /INCLUDE=<path> Set path to search for #include'd files
///</summary>
public string Include { get; set; }
/// <summary>
/// /SUBSYSTEM=<int> Set Subsystem value in the NT Optional header
///</summary>
public string SubSystem { get; set; }
/// <summary>
/// /SSVER=<int>.<int> Set Subsystem version number in the NT Optional header
///</summary>
public string SubSystemVersion { get; set; }
/// <summary>
/// /FLAGS=<int> Set CLR ImageFlags value in the CLR header
///</summary>
public string Flags { get; set; }
/// <summary>
/// /ALIGNMENT=<int> Set FileAlignment value in the NT Optional header
///</summary>
public string Alignment { get; set; }
/// <summary>
/// /BASE=<int> Set ImageBase value in the NT Optional header(max 2GB for 32-bit images)
///</summary>
public string Base { get; set; }
/// <summary>
/// /STACK=<int> Set SizeOfStackReserve value in the NT Optional header
///</summary>
public string Stack { get; set; }
/// <summary>
/// /MDV=<version_string> Set Metadata version string
///</summary>
public string MetadataVersion { get; set; }
/// <summary>
/// /MSV=<int>.<int> Set Metadata stream version(<major>.<minor>)
///</summary>
public string MetadataStreamVersion { get; set; }
/// <summary>
/// /PE64 Create a 64bit image(PE32+)
///</summary>
public string PE64 { get; set; }
/// <summary>
/// /HIGHENTROPYVA Set High Entropy Virtual Address capable PE32+ images(default for /APPCONTAINER)
///</summary>
public string HighEntropyVirtualAddress { get; set; }
/// <summary>
/// /NOCORSTUB Suppress generation of CORExeMain stub
///</summary>
public string NoCorStub { get; set; }
/// <summary>
/// /STRIPRELOC Indicate that no base relocations are needed
///</summary>
public string StripReLoc { get; set; }
/// <summary>
/// /ITANIUM Target processor: Intel Itanium
///</summary>
public string Itanium { get; set; }
/// <summary>
/// /X64 Target processor: 64bit AMD processor
///</summary>
public string X64 { get; set; }
/// <summary>
/// /ARM Target processor: ARM processor
///</summary>
public string Arm { get; set; }
/// <summary>
/// /32BITPREFERRED Create a 32BitPreferred image(PE32)
///</summary>
public string Prefer32Bit { get; set; }
/// <summary>
/// /ENC=<file> Create Edit-and-Continue deltas from specified source file
///</summary>
public string ENC { get; set; }
public override bool Execute()
{
try
{
string commandLine = "/OUT=" + Out;
if (NoLogo) commandLine += " /NOLOGO";
if (Quiet) commandLine += " /QUIET";
if (NoAutoInherit) commandLine += " /NOAUTOINHERIT";
if (Dll) commandLine += " /DLL";
if (Exe) commandLine += " /EXE";
if (Pdb) commandLine += " /PDB";
if (AppContainer) commandLine += " /APPCONTAINER";
if (Debug) commandLine += " /DEBUG";
if (DebugDisableJitOptimization) commandLine += " /DEBUG=IMPL";
if (DebugEnableJitOptimization) commandLine += " /DEBUG=OPT";
if (Optimize) commandLine += " /OPTIMIZE";
if (Fold) commandLine += " /FOLD";
if (Clock) commandLine += " /CLOCK";
if (!string.IsNullOrEmpty(Resource)) commandLine += " /RESOURCE=" + Resource;
if (!string.IsNullOrEmpty(CvRes)) commandLine += " /CVRES=" + CvRes;
if (!string.IsNullOrEmpty(KeyFile)) commandLine += " /KeyFile=" + KeyFile;
if (!string.IsNullOrEmpty(KeySource)) commandLine += " /CVRES=@" + KeySource;
if (!string.IsNullOrEmpty(Include)) commandLine += " /INCLUDE=" + Include;
int subSystem = -1;
if (!string.IsNullOrEmpty(SubSystem) && Int32.TryParse(SubSystem, out subSystem)) commandLine += " /SUBSYSTEM=" + subSystem;
if (!string.IsNullOrEmpty(SubSystemVersion)) commandLine += " /SUBSYSTEMVERSION=" + SubSystemVersion;
int flags = -1;
if (!string.IsNullOrEmpty(Flags) && Int32.TryParse(Flags, out flags)) commandLine += " /FLAGS=" + flags;
int alignment = -1;
if (!string.IsNullOrEmpty(Alignment) && Int32.TryParse(Alignment, out alignment)) commandLine += " /ALIGNMENT=" + alignment;
int @base = -1;
if (!string.IsNullOrEmpty(Base) && Int32.TryParse(Base, out @base)) commandLine += " /BASE=" + @base;
int stack = -1;
if (!string.IsNullOrEmpty(Stack) && Int32.TryParse(Stack, out stack)) commandLine += " /STACK=" + stack;
if (!string.IsNullOrEmpty(MetadataVersion)) commandLine += " /MDV=" + MetadataVersion;
if (!string.IsNullOrEmpty(MetadataStreamVersion)) commandLine += " /MSV=" + MetadataStreamVersion;
bool pe64 = false;
if (!string.IsNullOrEmpty(PE64) && bool.TryParse(PE64, out pe64)) commandLine += " /PE64=" + pe64;
bool highEntropyVA = false;
if (!string.IsNullOrEmpty(HighEntropyVirtualAddress) && bool.TryParse(HighEntropyVirtualAddress, out highEntropyVA)) commandLine += " /HIGHENTROPYVA=" + highEntropyVA;
bool noCorStub = false;
if (!string.IsNullOrEmpty(NoCorStub) && bool.TryParse(NoCorStub, out noCorStub)) commandLine += " /NOCORSTUB=" + noCorStub;
bool stripreloc = false;
if (!string.IsNullOrEmpty(StripReLoc) && bool.TryParse(StripReLoc, out stripreloc)) commandLine += " /STRIPRELOC=" + stripreloc;
bool itanium = false;
if (!string.IsNullOrEmpty(Itanium) && bool.TryParse(Itanium, out itanium)) commandLine += " /ITANIUM=" + itanium;
bool x64 = false;
if (!string.IsNullOrEmpty(X64) && bool.TryParse(X64, out x64)) commandLine += " /X64=" + x64;
bool arm = false;
if (!string.IsNullOrEmpty(Arm) && bool.TryParse(Arm, out arm)) commandLine += " /ARM=" + arm;
bool prefer32bit = false;
if (!string.IsNullOrEmpty(Prefer32Bit) && bool.TryParse(Prefer32Bit, out prefer32bit)) commandLine += " /32BITPREFERRED=" + prefer32bit;
if (!string.IsNullOrEmpty(ENC)) commandLine += " /ENC=" + ENC;
ProcessStartInfo startInfo = new ProcessStartInfo(ILAsm);
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.Arguments = SourceFile + " " + commandLine;
Log.LogMessage("Starting process: " + startInfo.FileName + " " + startInfo.Arguments);
Process.Start(startInfo).WaitForExit();
return true;
}
catch (Exception e)
{
Log.LogError(e.ToString() + e.StackTrace);
return false;
}
}
}
}
using System;
using System.Diagnostics;
using Microsoft.Build.Framework;
using Microsoft.Build.Utilities;
namespace WpfArcadeSdk.Build.Tasks
{
/// <summary>
/// Runs ILDAsm from the path supplied on the assembly supplied.
/// </summary>
public class ILDAsmTask : Task
{
[Required]
public string ILDAsm { get; set; }
[Required]
public string Assembly { get; set; }
[Required]
public string Out { get; set; }
/// <summary>
/// Output in HTML format
///</summary>
public bool Html { get; set; }
/// <summary>
/// Output in rich text format
///</summary>
public bool Rtf { get; set; }
/// <summary>
/// Show actual bytes(in hex) as instruction comments
///</summary>
public bool Bytes { get; set; }
/// <summary>
/// Show exception handling clauses in raw form
///</summary>
public bool RawEH { get; set; }
/// <summary>
/// Show metadata tokens of classes and members
///</summary>
public bool Tokens { get; set; }
/// <summary>
/// Show original source lines as comments
///</summary>
public bool Source { get; set; }
/// <summary>
/// Include references to original source lines
///</summary>
public bool LineNum { get; set; }
/// <summary>
/// =<vis>[+<vis>...] Only disassemble the items with specified
/// visibility. (<vis> = PUB | PRI | FAM | ASM | FAA | FOA | PSC)
/// </summary>
public string Visibility { get; set; }
/// <summary>
/// Only disassemble the public items(same as /VIS= PUB)
///</summary>
public bool PubOnly { get; set; }
/// <summary>
/// Include all names into single quotes
///</summary>
public bool QuoteAllNames { get; set; }
/// <summary>
/// Suppress output of custom attributes
///</summary>
public bool NoCA { get; set; }
/// <summary>
/// Output CA blobs in verbal form(default - in binary form)
///</summary>
public bool CAVerbal { get; set; }
/// <summary>
/// Suppress disassembly progress bar window pop-up
///</summary>
public bool NoBar { get; set; }
/// <summary>
/// Use UTF-8 encoding for output(default - ANSI)
///</summary>
public bool Utf8 { get; set; }
/// <summary>
/// Use UNICODE encoding for output
///</summary>
public bool Unicode { get; set; }
/// <summary>
/// Suppress IL assembler code output
///</summary>
public bool NoIL { get; set; }
/// <summary>
/// Use forward class declaration
///</summary>
public bool Forward { get; set; }
/// <summary>
/// Output full list of types(to preserve type ordering in round-trip)
///</summary>
public bool TypeList { get; set; }
/// <summary>
/// Display.NET projection view if input is a.winmd file
///</summary>
public bool Project { get; set; }
/// <summary>
/// Include file headers information in the output
///</summary>
public bool Headers { get; set; }
/// <summary>
/// =<class>[::<method>[(< sig >)] Disassemble the specified item only
///</summary>
public string Item { get; set; }
/// <summary>
/// Include statistics on the image
///</summary>
public bool Stats { get; set; }
/// <summary>
/// Include list of classes defined in the module
///</summary>
public bool ClassList { get; set; }
/// <summary>
/// Combination of /HEADER,/BYTES,/STATS,/CLASSLIST,/TOKENS
///</summary>
public bool All { get; set; }
/// <summary>
/// Options for EXE,DLL,OBJ and LIB files:
/// /METADATA[=< specifier >] Show MetaData, where<specifier> is:
/// /MDHEADER Show MetaData header information and sizes.
/// /HEX Show more things in hex as well as words.
/// /CSV Show the record counts and heap sizes.
/// /UNREX Show unresolved externals.
/// /SCHEMA Show the MetaData header and schema information.
/// /RAW Show the raw MetaData tables.
/// /HEAPS Show the raw heaps.
/// /VALIDATE Validate the consistency of the metadata.
/// </summary>
public string Metadata { get; set; }
/// <summary>
/// Options for LIB files only:
/// /OBJECTFILE=< obj_file_name > Show MetaData of a single object file in library
/// </summary>
public string ObjectFile { get; set; }
public override bool Execute()
{
try
{
string commandLine = "/OUT=" + Out;
if (Html) commandLine += " /HTML";
if (Rtf) commandLine += " /RTF";
if (Bytes) commandLine += " /BYTES";
if (RawEH) commandLine += " /RAWEH";
if (Tokens) commandLine += " /TOKENS";
if (Source) commandLine += " /SOURCE";
if (LineNum) commandLine += " /LINENUM";
if (Visibility != null && Visibility.Trim() != string.Empty) commandLine += " /VISIBILITY=" + Visibility;
if (PubOnly) commandLine += " /PUBONLY";
if (QuoteAllNames) commandLine += " /QUOTEALLNAMES";
if (NoCA) commandLine += " /NOCA";
if (CAVerbal) commandLine += " /CAVERBAL";
if (NoBar) commandLine += " /NOBAR";
if (Utf8) commandLine += " /UTF8";
if (Unicode) commandLine += " /UNICODE";
if (NoIL) commandLine += " /NOIL";
if (Forward) commandLine += " /FORWARD";
if (TypeList) commandLine += " /TYPELIST";
if (Headers) commandLine += " /HEADERS";
if (Item != null && Item.Trim() != string.Empty) commandLine += " /ITEM=" + Item;
if (Stats) commandLine += " /STATS";
if (ClassList) commandLine += " /CLASSLIST";
if (All) commandLine += " /ALL";
if (Metadata != null && Metadata.Trim() != string.Empty) commandLine += " /METADATA=" + Metadata;
if (ObjectFile != null && ObjectFile.Trim() != string.Empty) commandLine += " /OBJECTFILE=" + ObjectFile;
ProcessStartInfo startInfo = new ProcessStartInfo(ILDAsm);
startInfo.CreateNoWindow = true;
startInfo.UseShellExecute = false;
startInfo.Arguments = Assembly + " " + commandLine;
Log.LogMessage("Starting process: " + startInfo.FileName + " " + startInfo.Arguments);
Process.Start(startInfo).WaitForExit();
return true;
}
catch (Exception e)
{
Log.LogError(e.ToString() + e.StackTrace);
return false;
}
}
}
}
.class private auto ansi '<Module>'
{
.method private hidebysig specialname rtspecialname static void .cctor () cil managed
{
// Code size 76 (0x4c)
.maxstack 3
.locals init (class [mscorlib]System.Type V_0, bool V_1, class [mscorlib]System.Reflection.MethodInfo V_2, bool V_3)
IL_0000: nop
IL_0001: call class [mscorlib]System.Reflection.Assembly [mscorlib]System.Reflection.Assembly::GetExecutingAssembly()
IL_0006: ldstr "ModuleInitializer"
IL_000b: callvirt instance class [mscorlib]System.Type [mscorlib]System.Reflection.Assembly::GetType(string)
IL_0010: stloc.0
IL_0011: ldloc.0
IL_0012: ldnull
IL_0013: call bool [mscorlib]System.Type::op_Inequality(class [mscorlib]System.Type, class [mscorlib]System.Type)
IL_0018: stloc.1
IL_0019: ldloc.1
IL_001a: brfalse.s IL_004b
IL_001c: nop
IL_001d: ldloc.0
IL_001e: ldstr "Initialize"
IL_0023: ldc.i4.s 24
IL_0025: callvirt instance class [mscorlib]System.Reflection.MethodInfo [mscorlib]System.Type::GetMethod(string, valuetype [mscorlib]System.Reflection.BindingFlags)
IL_002a: stloc.2
IL_002b: ldloc.2
IL_002c: ldnull
IL_002d: call bool [mscorlib]System.Reflection.MethodInfo::op_Inequality(class [mscorlib]System.Reflection.MethodInfo, class [mscorlib]System.Reflection.MethodInfo)
IL_0032: stloc.3
IL_0033: ldloc.3
IL_0034: brfalse.s IL_004a
IL_0036: nop
.try
{
IL_0037: nop
IL_0038: ldloc.2
IL_0039: ldnull
IL_003a: ldnull
IL_003b: callvirt instance object [mscorlib]System.Reflection.MethodBase::Invoke(object, object[])
IL_0040: pop
IL_0041: nop
IL_0042: leave.s IL_0049
} // end .try
catch [mscorlib]System.Exception
{
IL_0044: pop
IL_0045: nop
IL_0046: nop
IL_0047: leave.s IL_0049
} // end handler
IL_0049: nop
IL_004a: nop
IL_004b: ret
}
}
.assembly extern mscorlib
{
.publickeytoken = (B7 7A 5C 56 19 34 E0 89 )
.ver 4:0:0:0
};
......@@ -15,7 +15,7 @@
<!-- This repo builds a transport package - we don't ship from here -->
<IsShippingPackage>false</IsShippingPackage>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<Copyright Condition="'$(CopyrightNetFoundation)' != ''">$(CopyrightNetFoundation)</Copyright>
......@@ -25,7 +25,7 @@
<PropertyGroup>
<GitHubTransportPackageName>Microsoft.DotNet.Wpf.GitHub</GitHubTransportPackageName>
<DncEngTransportPackageName>Microsoft.DotNet.Wpf.DncEng</DncEngTransportPackageName>
<!-- When ready to go live, remove .private suffix -->
<WindowsDesktopSdkPackageName>Microsoft.NET.Sdk.WindowsDesktop</WindowsDesktopSdkPackageName>
</PropertyGroup>
......
......@@ -5,6 +5,11 @@
<PropertyGroup>
<!-- Projects can override the name of the 'lib' folder to something else - for e.g., 'tools'-->
<LibFolder Condition="'$(LibFolder)'==''">lib</LibFolder>
<!--
Architecture-specific assemblies go under runtimes\<rid>\native\
https://docs.microsoft.com/en-us/nuget/create-packages/supporting-multiple-target-frameworks
-->
</PropertyGroup>
<PropertyGroup>
......@@ -74,21 +79,20 @@ $(PreparePackageAssetsDependsOn):
Returns="@(PackageAsset)"
Condition="'$(PackageName)'!=''">
<!-- Identify $(TargetFrameworkOrRuntimeIdentifier) property -->
<PropertyGroup>
<TargetFrameworkOrRuntimeIdentifier Condition="'$(TargetFrameworkOrRuntimeIdentifier)'=='' and '$(TargetFramework)'!=''">$(TargetFramework)</TargetFrameworkOrRuntimeIdentifier>
<DestinationSubFolder Condition="'$(DestinationSubFolder)'=='' and '$(TargetFramework)'!=''">$(LibFolder)\$(TargetFramework)\</DestinationSubFolder>
</PropertyGroup>
<PropertyGroup Condition="'$(MSBuildProjectExtension)'=='.vcxproj' and '$(TargetFrameworkOrRuntimeIdentifier)'==''">
<TargetFrameworkOrRuntimeIdentifier Condition="'$(Platform)'=='AnyCPU' or '$(Platform)'=='x86' or '$(Platform)'=='Win32'">win-x86</TargetFrameworkOrRuntimeIdentifier>
<TargetFrameworkOrRuntimeIdentifier Condition="'$(Platform)'=='x64'">win-x64</TargetFrameworkOrRuntimeIdentifier>
<PropertyGroup Condition="'$(MSBuildProjectExtension)'=='.vcxproj' and '$(DestinationSubFolder)'==''">
<DestinationSubFolder Condition="'$(Platform)'=='AnyCPU' or '$(Platform)'=='x86' or '$(Platform)'=='Win32'">runtimes\win-x86\native\</DestinationSubFolder>
<DestinationSubFolder Condition="'$(Platform)'=='x64'">runtimes\win-x64\native\</DestinationSubFolder>
</PropertyGroup>
<!--
Instead of showing an error when $(TargetFrameworkOrRuntimeIdentifier) cannot be identified
Instead of showing an error when $(TargetFramework) or $(RuntimeIdentifier) cannot be identified
we simply do no further work
Include all the DLL's, EXE's and PDB's under lib\
Include all the DLL's, EXE's and PDB's under $(DestinationSubFolder), i.e., either under lib\$(TargetFramework) or runtimes\$(RuntimeIdentifier)\native
Include all reference assemblies under ref\
Include all content files under content\
......@@ -97,37 +101,37 @@ $(PreparePackageAssetsDependsOn):
The CreateItem tasks below is equivalent to this:
<ItemGroup Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true'">
<PackageAsset Include="$(OutDir)*.dll" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\lib\$(TargetFrameworkOrRuntimeIdentifier)"/>
<PackageAsset Include="$(OutDir)*.exe" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\lib\$(TargetFrameworkOrRuntimeIdentifier)"/>
<PackageAsset Include="$(OutDir)*.pdb" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\lib\$(TargetFrameworkOrRuntimeIdentifier)"/>
<PackageAsset Include="$(ReferenceAssemblyDir)*.dll" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\ref\$(TargetFrameworkOrRuntimeIdentifier)"/>
<ItemGroup Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true'">
<PackageAsset Include="$(OutDir)*.dll" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\$(DestinationSubFolder)"/>
<PackageAsset Include="$(OutDir)*.exe" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\$(DestinationSubFolder)"/>
<PackageAsset Include="$(OutDir)*.pdb" RelativePath="$(ArtifactsPackagingDir)$(PackageName)\$(DestinationSubFolder)"/>
<PackageAsset Include="$(ReferenceAssemblyDir)*.dll" RelativePath="$(ArtifactsPackagingDir)\$(DestinationSubFolder)"/>
</ItemGroup>
-->
<CreateItem Include="$(OutDir)*.dll"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="$(OutDir)*.exe"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'==''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="$(OutDir)*.pdb"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludePdbs)'!='true' and '@(PackagingAssemblyContent)'==''">
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludePdbs)'!='true' and '@(PackagingAssemblyContent)'==''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="$(ReferenceAssemblyDir)*.dll"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\$(TargetFrameworkOrRuntimeIdentifier)"
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludeRefAssemblies)'!='true'">
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\$(TargetFramework)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '$(ExcludeRefAssemblies)'!='true'">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
<CreateItem Include="$(OutDir)%(PackagingAssemblyContent.Identity)"
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)"
Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'!=''">
AdditionalMetadata="RelativePath=$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)"
Condition="'$(DestinationSubFolder)'!='' and '$(IsPackagingProject)'!='true' and '@(PackagingAssemblyContent)'!=''">
<Output ItemName="PackageAsset" TaskParameter="Include"/>
</CreateItem>
<!--
......@@ -144,10 +148,10 @@ $(PreparePackageAssetsDependsOn):
<PackageAssetCultures Include="$(XlfLanguages)" />
<PackageAsset Include="$(OutDir)%(PackageAssetCultures.Identity)\*.dll"
RelativePath="$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(LibFolder)\$(TargetFrameworkOrRuntimeIdentifier)\%(PackageAssetCultures.Identity)" />
RelativePath="$(ArtifactsPackagingDir)$(NormalizedPackageName)\$(DestinationSubFolder)\%(PackageAssetCultures.Identity)" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFrameworkOrRuntimeIdentifier)'!=''">
<ItemGroup Condition="'$(DestinationSubFolder)'!=''">
<!-- %(PackagingContent.SubFolder) not StartsWith 'root' -->
<PackageAsset Condition="'%(PackagingContent.SubFolder)'!='' And !$([System.String]::Copy(&quot;%(PackagingContent.SubFolder)&quot;).StartsWith(&quot;root&quot;))"
......@@ -275,6 +279,24 @@ $(PreparePackageAssetsDependsOn):
<PackagePath>$(LibFolder)</PackagePath>
</Content>
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtimes\**\*.dll"
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtimes\')" >
<Pack>true</Pack>
<PackagePath>runtimes</PackagePath>
</Content>
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtimes\**\*.exe"
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtimes\')" >
<Pack>true</Pack>
<PackagePath>runtimes</PackagePath>
</Content>
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtimes\**\*.pdb"
Condition="('$(CreateArchNeutralPackage)'!='true' Or '$(IncludeAssembliesInArchNeutralPackage)'== 'true') and Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\runtimes\')" >
<Pack>true</Pack>
<PackagePath>runtimes</PackagePath>
</Content>
<Content Include="$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\**\*.dll"
Condition="Exists('$(ArtifactsPackagingDir)$(NormalizedPackageName)\ref\')">
<Pack>true</Pack>
......
<Project>
<PropertyGroup>
<RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppVersion)'!='' And '$(NoTargets)'!='true' And $(TargetFramework.StartsWith('netcoreapp3.')) ">$(MicrosoftNETCoreAppVersion)</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion Condition="'$(MicrosoftNETCoreAppVersion)'!='' And '$(NoTargets)'!='true' And $(TargetFramework.StartsWith('netcoreapp3.'))">$(MicrosoftNETCoreAppVersion)</RuntimeFrameworkVersion>
</PropertyGroup>
<!-- workaround for package downgrade in Microsoft.NetCore.Platforms -->
......
......@@ -6,20 +6,26 @@
<ItemGroup>
<PackageReference Include="Microsoft.NETCore.Platforms"
Version="$(MicrosoftNETCorePlatformsVersion)"
Condition="'$(MSBuildProjectExtension)'!='.vcxproj' And '$(WpfTest)'!='true'"/>
Condition="'$(MSBuildProjectExtension)'!='.vcxproj'"/>
<AdditionalPackageReference Include="Microsoft.NETCore.Platforms"
Version="$(MicrosoftNETCorePlatformsVersion)"
Condition="'$(ManagedCxx)'=='true' And '$(WpfTest)'!='true'"/>
Condition="'$(ManagedCxx)'=='true'"/>
<FrameworkReference Update="Microsoft.NETCore.App"
Condition="'$(MicrosoftNETCoreAppVersion)'!='' And '$(NoTargets)'!='true' And $(TargetFramework.StartsWith('netcoreapp3.')) And '$(MSBuildProjectExtension)'!='.vcxproj' And '$(WpfTest)'!='true'">
Condition="'$(MicrosoftNETCoreAppVersion)'!='' And '$(NoTargets)'!='true' And $(TargetFramework.StartsWith('netcoreapp3.')) And '$(MSBuildProjectExtension)'!='.vcxproj'">
<TargetingPackVersion>$(MicrosoftNETCoreAppVersion)</TargetingPackVersion>
</FrameworkReference>
<!--
Workaround - this should be removed when our tests are converted from Microsoft.NET.Sdk.WindowsDesktop => Microsoft.NET.Sdk
project
-->
<KnownFrameworkReference Remove="Microsoft.AspNetCore.App" />
</ItemGroup>
<PropertyGroup>
<!-- If TargetFramework is not netcoreapp3.x, then reset RuntimeFrameworkVersion -->
<RuntimeFrameworkVersion Condition="!$(TargetFramework.StartsWith('netcoreapp3.')) And '$(WpfTest)'=='true'" />
<RuntimeFrameworkVersion Condition="!$(TargetFramework.StartsWith('netcoreapp3.'))" />
</PropertyGroup>
</Project>
......@@ -57,30 +57,34 @@
-->
<ItemGroup>
<Reference Include="$(PkgMicrosoft_NETCore_App)\ref\$(TargetFramework)\%(NetCoreReference.Identity).dll"
Condition="Exists('$(PkgMicrosoft_NETCore_App)\ref\$(TargetFramework)\%(NetCoreReference.Identity).dll')" />
Condition="Exists('$(PkgMicrosoft_NETCore_App)\ref\$(TargetFramework)\%(NetCoreReference.Identity).dll')" >
<NuGetPackageId>Microsoft.NetCore.App</NuGetPackageId>
</Reference>
</ItemGroup>
</Target>
<Target
Name="LimitNetCoreAppReferences"
AfterTargets="ResolveAssemblyReferences"
Returns="@(ReferencePath)"
Condition="'$(PkgMicrosoft_NETCore_App)'=='' And '@(NetCoreReference)'!='' and '@(ReferencePath)' != ''">
AfterTargets="ResolveTargetingPacks"
Returns="@(Reference)"
Condition="'$(PkgMicrosoft_NETCore_App)'=='' And '@(NetCoreReference)'!='' and '@(Reference)' != ''">
<!--
Example
<NetCoreReference Include="Microsoft.CSharp" />
-->
<!--
Save Microsoft.NETCore.App.Ref assemblies, and remove those from @(ReferencePath)
Save Microsoft.NETCore.App.Ref assemblies, and remove those from @(Reference)
-->
<ItemGroup>
<_netCoreAppSdkReference Remove="@(_netCoreAppSdkReference)" />
<_netCoreAppSdkReference Include="@(ReferencePath)"
Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.NETCore.App.Ref'" />
<_netCoreAppSdkReference Include="@(Reference)"
Condition="'%(Reference.NuGetPackageId)'=='Microsoft.NETCore.App.Ref'">
<OriginalPath>%(Reference.Identity)</OriginalPath>
</_netCoreAppSdkReference>
<ReferencePath Remove="@(_netCoreAppSdkReference)" />
<Reference Remove="@(_netCoreAppSdkReference)" />
</ItemGroup>
<ItemGroup>
......@@ -94,13 +98,13 @@
</FilterItem1ByItem2>
<ItemGroup>
<ReferencePath Include="@(_netCoreAppReferences->'%(OriginalItemSpec)')" />
<Reference Include="@(_netCoreAppReferences->'%(OriginalPath)')" />
</ItemGroup>
</Target>
<Target Name="ResolveMicrosoftWindowsDesktopAppReferences"
Returns="@(Reference)"
Condition="'$(PkgMicrosoft_WindowsDesktop_App)'!='' And '@(WindowsDesktopAppeference)'!='' and $(TargetFramework.StartsWith('netcoreapp3')) and '$(DoNotLimitWindowsDesktopAppReferences)'!='true'">
Condition="'$(PkgMicrosoft_WindowsDesktop_App)'!='' And '@(WindowsDesktopAppReference)'!='' and $(TargetFramework.StartsWith('netcoreapp3')) and '$(DoNotLimitWindowsDesktopAppReferences)'!='true'">
<!--
In your project, Add a references to assemblies from Microsoft.NETCore.App like this
<ItemGroup>
......@@ -110,28 +114,32 @@
-->
<ItemGroup>
<Reference Include="$(PkgMicrosoft_WindowsDesktop_App)\ref\$(TargetFramework)\%(NetCoreReference.Identity).dll"
Condition="Exists('$(PkgMicrosoft_WindowsDesktop_App)\ref\$(TargetFramework)\%(NetCoreReference.Identity).dll')" />
Condition="Exists('$(PkgMicrosoft_WindowsDesktop_App)\ref\$(TargetFramework)\%(NetCoreReference.Identity).dll')">
<NuGetPackageId>Microsoft.WindowsDesktop.App</NuGetPackageId>
</Reference>
</ItemGroup>
</Target>
<Target Name="LimitWindowsDesktopAppReferences"
AfterTargets="ResolveAssemblyReferences"
Returns="@(ReferencePath)"
Condition="'$(PkgMicrosoft_WindowsDesktop_App)'=='' And '@(WindowsDesktopReference)'!='' and '@(ReferencePath)' != ''">
AfterTargets="ResolveTargetingPacks"
Returns="@(Reference)"
Condition="'$(PkgMicrosoft_WindowsDesktop_App)'=='' And '@(WindowsDesktopReference)'!='' and '@(Reference)' != ''">
<!--
Example
<WindowsDesktopReference Include="PresentationCore" />
-->
<!--
Save Microsoft.WindowsDesktop.App.Ref assemblies, and remove those from @(ReferencePath)
Save Microsoft.WindowsDesktop.App.Ref assemblies, and remove those from @(Reference)
-->
<ItemGroup>
<_windowsDesktopAppSdkReference Remove="@(_windowsDesktopAppSdkReference)" />
<_windowsDesktopAppSdkReference Include="@(ReferencePath)"
Condition="'%(ReferencePath.NuGetPackageId)'=='Microsoft.WindowsDesktop.App.Ref'" />
<_windowsDesktopAppSdkReference Include="@(Reference)"
Condition="'%(Reference.NuGetPackageId)'=='Microsoft.WindowsDesktop.App.Ref'">
<OriginalPath>%(Reference.Identity)</OriginalPath>
</_windowsDesktopAppSdkReference>
<ReferencePath Remove="@(_windowsDesktopAppSdkReference)" />
<Reference Remove="@(_windowsDesktopAppSdkReference)" />
</ItemGroup>
<ItemGroup>
......@@ -145,7 +153,7 @@
</FilterItem1ByItem2>
<ItemGroup>
<ReferencePath Include="@(_windowsDesktopAppReferences->'%(OriginalItemSpec)')" />
<Reference Include="@(_windowsDesktopAppReferences->'%(OriginalPath)')" />
</ItemGroup>
</Target>
......@@ -166,7 +174,9 @@
-->
<ItemGroup>
<Reference Include="$(PkgMicrosoft_DotNet_Wpf_GitHub)\ref\$(TargetFramework)\%(MicrosoftDotNetWpfGitHubReference.Identity).dll"
Condition="Exists('$(PkgMicrosoft_DotNet_Wpf_GitHub)\ref\$(TargetFramework)\%(MicrosoftDotNetWpfGitHubReference.Identity).dll')"/>
Condition="Exists('$(PkgMicrosoft_DotNet_Wpf_GitHub)\ref\$(TargetFramework)\%(MicrosoftDotNetWpfGitHubReference.Identity).dll')">
<NuGetPackageId>Microsoft.DotNet.Wpf.GitHub</NuGetPackageId>
</Reference>
</ItemGroup>
</Target>
......@@ -186,7 +196,9 @@
Condition="'@(MicrosoftPrivateWinFormsReference)'!='' And $(TargetFramework.StartsWith('netcoreapp3'))">
<ItemGroup>
<Reference Include="$(PkgMicrosoft_Private_Winforms)\ref\$(TargetFramework)\%(MicrosoftPrivateWinFormsReference.Identity).dll"
Condition="Exists('$(PkgMicrosoft_Private_Winforms)\ref\$(TargetFramework)\%(MicrosoftPrivateWinFormsReference.Identity).dll')"/>
Condition="Exists('$(PkgMicrosoft_Private_Winforms)\ref\$(TargetFramework)\%(MicrosoftPrivateWinFormsReference.Identity).dll')">
<NuGetPackageId>Microsoft.Private.Winforms</NuGetPackageId>
</Reference>
</ItemGroup>
</Target>
</Project>
......@@ -2,24 +2,29 @@
<PropertyGroup>
<ExternalShippingProjects>
System.Xaml;
PresentationBuildTasks
</ExternalShippingProjects>
<InternalShippingProjects>
PresentationBuildTasks;
PresentationCore;
DirectWriteForwarder;
PresentationCore-CommonResources;
PresentationFramework;
ReachFramework;
UIAutomationClient;
UIAutomationClientSideProviders;
UIAutomationProvider;
UIAutomationTypes;
WindowsBase;
System.Windows.Input.Manipulations;
PresentationFramework-SystemCore;
PresentationFramework-SystemData;
PresentationFramework-SystemDrawing;
PresentationFramework-SystemXml;
PresentationFramework-SystemXmlLinq;
</ExternalShippingProjects>
<InternalShippingProjects>
PresentationUI;
ReachFramework;
System.Printing;
System.Windows.Controls.Ribbon;
System.Windows.Input.Manipulations;
System.Windows.Presentation;
PresentationFramework.Aero;
PresentationFramework.Aero2;
......@@ -27,11 +32,6 @@
PresentationFramework.Classic;
PresentationFramework.Luna;
PresentationFramework.Royale;
UIAutomationClient;
UIAutomationClientSideProviders;
UIAutomationProvider;
UIAutomationTypes;
WindowsBase;
WindowsFormsIntegration;
PenImc;
PresentationNative;
......
......@@ -4,5 +4,7 @@
<ExcludeRefAssemblies Condition="'$(PackageName)'=='$(WindowsDesktopSdkPackageName)'">true</ExcludeRefAssemblies>
<ExcludePdbs Condition="'$(PackageName)'=='$(WindowsDesktopSdkPackageName)'">true</ExcludePdbs>
<IncludeAssembliesInArchNeutralPackage Condition="'$(PackageName)'=='$(WindowsDesktopSdkPackageName)'">true</IncludeAssembliesInArchNeutralPackage>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
<PublishWindowsPdb Condition="'$(IsPackagingProject)'=='true' Or '$(IsRedistProject)'=='true'">false</PublishWindowsPdb>
</PropertyGroup>
</Project>
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<!--
Arcade requires us to set this property in order for it to appropriately update
GenerateSource in our EmbeddedResource items. Without this, no code generation
will take place for any of our resx files.
See GenerateResxSource.targets in Arcade.
-->
<GenerateResxSource>true</GenerateResxSource>
</PropertyGroup>
<ItemDefinitionGroup>
<EmbeddedResource>
<GenerateSource>true</GenerateSource>
......
<Project>
<PropertyGroup Condition="'$(WpfTest)'=='true' Or '$(IsTestProject)'=='true'">
<RuntimeIdentifier Condition="('$(Platform)'!='AnyCPU' and '$(Platform)'!='Win32') Or $(Platform.EndsWith('64'))">win-$(Platform)</RuntimeIdentifier>
<RuntimeIdentifier Condition="'$(Platform)'=='AnyCPU' or '$(Platform)'=='Win32' or '$(Platform)'=='x86'">win-x86</RuntimeIdentifier>
</PropertyGroup>
<!-- Arcade SDK defaults to AnyCpu ~= x64. In WPF, we will map AnyCpu => x86 instead -->
<PropertyGroup Condition="'$(IsTestProject)' == 'true' or '$(WpfTest)'=='true'">
<TestArchitectures Condition="'$(PlatformTarget)' == '' or '$(PlatformTarget)' == 'AnyCpu'">x86</TestArchitectures>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<IsSelfContained>true</IsSelfContained>
</PropertyGroup>
<ItemGroup Condition="'$(IsTestProject)' == 'true' or '$(WpfTest)'=='true'">
<!--
Only reference Microsoft.DotNet.Wpf.DncEng when building tests in dotnet/wpf
This references is not needed when building tests in dotnet-wpf-int
-->
<PackageReference Include="runtime.$(RuntimeIdentifier).$(MicrosoftDotNetWpfDncEngPackage)"
Condition="'$(RepositoryName)'=='wpf'"
Version="$(MicrosoftDotNetWpfDncEngVersion)">
<CopyLocal>true</CopyLocal>
<GeneratePathProperty>true</GeneratePathProperty>
</PackageReference>
<!--
PackageReference from individual WPF projects here
-->
<PackageReference Include="$(SystemIOPackagingPackage)" Version="$(SystemIOPackagingVersion)" CopyLocal="true" />
<PackageReference Include="Microsoft.Win32.Registry" Version="$(MicrosoftWin32RegistryPackageVersion)" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="$(SystemConfigurationConfigurationManagerPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Diagnostics.EventLog" Version="$(SystemDiagnosticsEventLogPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Security.Cryptography.Xml" Version="$(SystemSecurityCryptographyXmlPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Security.Permissions" Version="$(SystemSecurityPermissionsPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Windows.Extensions" Version="$(SystemWindowsExtensionsPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Security.AccessControl" Version="$(SystemSecurityAccessControlPackageVersion)" CopyLocal="true" />
<PackageReference Include="System.Security.Principal.Windows" Version="$(SystemSecurityPrincipalWindowsPackageVersion)" CopyLocal="true" />
<!-- These exist to ensure that dependencies (esp. native ones) are binplaced with tests correctly -->
<None Condition="'$(RuntimeIdentifier)'=='win-x64'"
Include="$(Pkgruntime_win-x64_Microsoft_DotNet_Wpf_DncEng)\runtimes\$(RuntimeIdentifier)\native\*.dll"
CopyToOutputDirectory="PreserveNewest"/>
<None Condition="'$(RuntimeIdentifier)'=='win-x86'"
Include="$(Pkgruntime_win-x86_Microsoft_DotNet_Wpf_DncEng)\runtimes\$(RuntimeIdentifier)\native\*.dll"
CopyToOutputDirectory="PreserveNewest"/>
<_wpfProjectsNotWindowsBase Include="@(WpfProjectPath)" Exclude="WindowsBase" />
<_wpfProjectsWindowsBase Include="@(WpfProjectPath)" Exclude="@(_wpfProjectsWindowsBase)" />
<!--
Do not include WindowsBase. There is a bug in the SDK that will prevent proper deps.json generation when WindowsBase.csproj
and Microsoft.NetCore.App/WindowsBase.dll clash. Part of the problem is due to https://github.com/dotnet/sdk/issues/2674.
Directly referencing DLL's works correctly and generates good deps.json. So instead of reference WindowsBase.csproj, just
obtain the raw path to WindowsBase.dll and add it to @(Reference). This is safe to do since
WindowsBase will be built as a transitive reference via PresentationCore, PresentationFramework etc.
Also make sure that Microsoft.NetCore.App/WindowsBase.dll is removed from @(Reference).
-->
<ProjectReference Include="@(_wpfProjectsNotWindowsBase->'%(ProjectPath)')" >
<Private>True</Private>
<OutputItemType>_wpfProjectReferenceLocallyBuildAssemblies</OutputItemType>
</ProjectReference>
<ProjectReference Include="@(_wpfProjectsWindowsBase->'%(ProjectPath)')" >
<Private>True</Private>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>_windowsBaseAssemblyLocallyBuiltPath</OutputItemType>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition="'$(WpfTest)'=='true' or '$(IsTestProject)'=='true'">
<ResolveAssemblyReferencesDependsOn>
AddWindowsBaseToReferences;
$(ResolveAssemblyReferencesDependsOn)
</ResolveAssemblyReferencesDependsOn>
</PropertyGroup>
<Target Name="AddWindowsBaseToReferences">
<ItemGroup>
<Reference Include="%(_windowsBaseAssemblyLocallyBuiltPath.FullPath)" />
</ItemGroup>
</Target>
<Target Name="RemoveWindowsBaseNetCoreAppReference"
AfterTargets="ResolveTargetingPacks"
Returns="@(Reference)"
Condition="'$(WpfTest)'=='true' or '$(IsTestProject)'=='true'">
<ItemGroup>
<Reference Remove="@(Reference)" Condition="'%(FileName)'=='WindowsBase' and '%(Reference.ResolvedFrom)'=='TargetingPack'" />
</ItemGroup>
</Target>
<!--
This target ensures that Microsoft.DotNet.Wpf.DncEng would not inadvertently over-supply references that
are already satisfied by ProjectReference's from within this repo. This should almost never happen, except
when $(MicrosoftDotNetWpfDncEngVersion) is set to something really old (something that was built <= 05/22/2019)
-->
<Target
Name="LimitMicrosoftDotNetDncEngReferences"
AfterTargets="ResolveTargetingPacks"
Returns="@(Reference)"
Condition="'$(WpfTest)'=='true' or '$(IsTestProject)'=='true'">
<ItemGroup>
<_microsoftDotNetDncEngRefs Remove="@(_microsoftDotNetDncEngRefs)" />
<_microsoftDotNetDncEngRefs Include="@(Reference)"
Condition="'%(Reference.NuGetPackageId)'=='runtime.$(RuntimeIdentifier).Microsoft.DotNet.Wpf.DncEng'">
<OriginalPath>%(Reference.Identity)</OriginalPath>
</_microsoftDotNetDncEngRefs>
</ItemGroup>
<ItemGroup>
<_microsoftDotNetDncEngReferences Remove="@(_microsoftDotNetDncEngReferences)" />
</ItemGroup>
<FilterItem1ByItem2 Item1="@(_microsoftDotNetDncEngRefs->'%(FileName)')"
Item2="@(_wpfProjectReferenceLocallyBuildAssemblies->'%(FileName)')"
Metadata2="Identity"
PreserveItem1Metadata="true">
<Output ItemName="_microsoftDotNetDncEngReferencesToAvoid" TaskParameter="Result" />
</FilterItem1ByItem2>
<ItemGroup>
<Reference Remove="@(_microsoftDotNetDncEngReferencesToAvoid->'%(OriginalPath)')"/>
</ItemGroup>
</Target>
</Project>
......@@ -89,11 +89,20 @@
</PropertyGroup>
<PropertyGroup>
<UsePrivateFrontEnd Condition="'$(UsePrivateFrontEnd)'==''">true</UsePrivateFrontEnd>
<!--
If there is ever need to use a private C++ compiler front-end, use the logic in the commented section below,
and update global.json with the corresponding version of msvcurt-c1xx
There is also a corresponding section (also commented out) in Wpf.Cpp.targets.
msvcurt-c1xx should reference a blob hosted in azure storage that contains
msvcurt[d]_netcore.lib and c1xx.dll
-->
<!-- <UsePrivateFrontEnd Condition="'$(UsePrivateFrontEnd)'==''">true</UsePrivateFrontEnd> -->
<!-- Also update in global.json -->
<MsvcurtC1xxVersion>0.0.0.4</MsvcurtC1xxVersion>
<MsvcurtC1xxToolsPath>$(RepoRoot).tools\native\bin\msvcurt-c1xx\$(MsvcurtC1xxVersion)\$(Architecture)\</MsvcurtC1xxToolsPath>
<MsvcurtNetCoreLib>$(MsvcurtC1xxToolsPath)msvcurt$(LibSuffix)_netcore.lib</MsvcurtNetCoreLib>
<!--<MsvcurtC1xxVersion>0.0.0.4</MsvcurtC1xxVersion>-->
<!--<MsvcurtC1xxToolsPath>$(RepoRoot).tools\native\bin\msvcurt-c1xx\$(MsvcurtC1xxVersion)\$(Architecture)\</MsvcurtC1xxToolsPath>-->
<!--<MsvcurtNetCoreLib>$(MsvcurtC1xxToolsPath)msvcurt$(LibSuffix)_netcore.lib</MsvcurtNetCoreLib>-->
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(UsePrivateFrontEnd)'=='true' And '$(ManagedCxx)'=='true' and '$(ExplicitCrts)'=='true'">
......@@ -244,12 +253,6 @@
<!-- WPF builds have historically used StdCall by default for all x86 native C++ builds -->
<CallingConvention Condition="('$(ManagedCxx)'=='false') And ('$(Architecture)'=='x86')">StdCall</CallingConvention>
<AdditionalIncludeDirectories Condition="Exists('$(WpfSharedDir)inc\')">%(AdditionalIncludeDirectories);$(WpfSharedDir)inc\</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="Exists('$(WpfCommonDir)inc\')">%(AdditionalIncludeDirectories);$(WpfCommonDir)inc\</AdditionalIncludeDirectories>
<ForcedIncludeFiles>ddbanned.h</ForcedIncludeFiles>
<!-- See https://developercommunity.visualstudio.com/content/problem/297504/all-cppwinrt-code-fails-to-build-from-abi-and-to-a.html -->
<!--<AdditionalOptions>/Zc:twoPhase- %(AdditionalOptions)</AdditionalOptions>-->
<!--<ConformanceMode>false</ConformanceMode>-->
......
......@@ -5,6 +5,10 @@
</PropertyGroup>
<!--
See comment about UsePrivateFrontEnd in Wpf.Cpp.props
-->
<!--
<PropertyGroup>
<FrontEndPath Condition="'$(VCToolArchitecture)'=='Native32Bit'">$(MsvcurtC1xxToolsPath)HostX86\c1xx.dll</FrontEndPath>
<FrontEndPath Condition="'$(VCToolArchitecture)'=='Native64Bit'">$(MsvcurtC1xxToolsPath)HostX64\c1xx.dll</FrontEndPath>
......@@ -17,11 +21,14 @@
<AdditionalOptions>%(AdditionalOptions) /fe:"$(FrontEndPath)"</AdditionalOptions>
</Link>
</ItemDefinitionGroup>
-->
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(NativeVersionFileDirectory)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="Exists('$(WpfSharedDir)inc\')">%(AdditionalIncludeDirectories);$(WpfSharedDir)inc\</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="Exists('$(WpfCommonDir)inc\')">%(AdditionalIncludeDirectories);$(WpfCommonDir)inc\</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(NativeVersionFileDirectory);$(WpfTracingDir)native\</AdditionalIncludeDirectories>
<ForcedIncludeFiles>$(WpfSharedDir)inc\ddbanned.h</ForcedIncludeFiles>
</ClCompile>
<ResourceCompile>
<AdditionalIncludeDirectories>%(AdditionalIncludeDirectories);$(NativeVersionFileDirectory)</AdditionalIncludeDirectories>
......@@ -208,7 +215,7 @@ using namespace System::Runtime::Versioning;
</PropertyGroup>
<ItemGroup>
<CppClrSupportProject Include="Project">
<CppClrSupportProject Include="ProjectHeader">
<!--
In the CDATA section that follows,
%40 ~= @
......@@ -223,12 +230,27 @@ using namespace System::Runtime::Versioning;
<TargetFramework>netcoreapp3.0</TargetFramework>
<Platforms>AnyCPU%3Bx64</Platforms>
</PropertyGroup>
]]>
</Text>
</CppClrSupportProject>
<!--
We need a reference to Microsoft.DotNet.Wpf.GitHub when building from dotnet-wpf-int.
When building from dotnet/wpf, this refernece is not needed.
-->
<CppClrSupportProject Include="MicrosoftDotNetWpfGitHubPackageReference" Condition="'$(RepoLocation)'=='Internal'">
<Text>
<![CDATA[
<ItemGroup>
<PackageReference Include="$(MicrosoftDotNetWpfGitHubPackage)" Version="$(MicrosoftDotNetWpfGitHubVersion)" />
</ItemGroup>
<!-- Ensure that LimitMicrosoftDotNetWpfGitHubReferences target doesn't run -->
]]>
</Text>
</CppClrSupportProject>
<CppClrSupportProject Include="ProjectBody">
<Text>
<![CDATA[
<!-- Ensure that LimitMicrosoftDotNetWpfGitHubReferences target doesn't run -->
<PropertyGroup>
<DoNotLimitMicrosoftDotNetWpfGitHubReferences>true</DoNotLimitMicrosoftDotNetWpfGitHubReferences>
</PropertyGroup>
......@@ -279,9 +301,11 @@ using namespace System::Runtime::Versioning;
<MakeDir Condition="!Exists('$(IntermediateOutputPath)CppCliSupport\')"
Directories="$(IntermediateOutputPath)CppCliSupport\" />
<Delete Files="$(CppCliHelperProject)" Condition="Exists('$(CppCliHelperProject)')" />
<WriteLinesToFile Lines="%(CppClrSupportProject.Text)"
File="$(CppCliHelperProject)"
Overwrite="true"/>
Overwrite="false"/>
<!--
Do not build - just ask ResolveReferences + IdentifyNetCoreReferences for the information
......
......@@ -11,7 +11,9 @@
<WpfProjectPath Include="System.Xaml" ProjectPath="$(WpfSourceDir)System.Xaml\System.Xaml.csproj" />
<WpfProjectPath Include="WindowsBase" ProjectPath="$(WpfSourceDir)WindowsBase\WindowsBase.csproj" />
<WpfProjectPath Include="PresentationCore-CommonResources" ProjectPath="$(WpfSourceDir)PresentationCore-CommonResources\PresentationCore-CommonResources.csproj" />
<WpfProjectPath Include="DirectWriteForwarder" ProjectPath="$(WpfSourceDir)DirectWriteForwarder\DirectWriteForwarder.vcxproj" />
<WpfProjectPath Include="DirectWriteForwarder" ProjectPath="$(WpfSourceDir)DirectWriteForwarder\DirectWriteForwarder.vcxproj">
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
</WpfProjectPath>
<WpfProjectPath Include="System.Windows.Input.Manipulations" ProjectPath="$(WpfSourceDir)System.Windows.Input.Manipulations\System.Windows.Input.Manipulations.csproj" />
<WpfProjectPath Include="WindowsFormsIntegration" ProjectPath="$(WpfSourceDir)WindowsFormsIntegration\WindowsFormsIntegration.csproj" />
......@@ -19,7 +21,9 @@
<WpfProjectPath Include="PresentationFramework" ProjectPath="$(WpfSourceDir)PresentationFramework\PresentationFramework.csproj" />
<WpfProjectPath Include="PresentationUI" ProjectPath="$(WpfSourceDir)PresentationUI\PresentationUI.csproj" />
<WpfProjectPath Include="ReachFramework" ProjectPath="$(WpfSourceDir)ReachFramework\ReachFramework.csproj" />
<WpfProjectPath Include="System.Printing" ProjectPath="$(WpfSourceDir)System.Printing\System.Printing.csproj" />
<WpfProjectPath Include="System.Printing" ProjectPath="$(WpfSourceDir)System.Printing\System.Printing.csproj">
<UndefineProperties>TargetFramework;TargetFrameworks</UndefineProperties>
</WpfProjectPath>
<WpfProjectPath Include="System.Windows.Controls.Ribbon" ProjectPath="$(WpfSourceDir)System.Windows.Controls.Ribbon\System.Windows.Controls.Ribbon.csproj" />
<WpfProjectPath Include="System.Windows.Presentation" ProjectPath="$(WpfSourceDir)System.Windows.Presentation\System.Windows.Presentation.csproj" />
......
# Source for this file was taken from https://github.com/microsoft/azure-pipelines-task-lib/blob/11c9439d4af17e6475d9fe058e6b2e03914d17e6/powershell/VstsTaskSdk/LoggingCommandFunctions.ps1
# NOTE: You should not be calling these method directly as they are likely to change. Instead you should be calling the Write-Pipeline* functions defined in tools.ps1
$script:loggingCommandPrefix = '##vso['
$script:loggingCommandEscapeMappings = @( # TODO: WHAT ABOUT "="? WHAT ABOUT "%"?
New-Object psobject -Property @{ Token = ';' ; Replacement = '%3B' }
New-Object psobject -Property @{ Token = "`r" ; Replacement = '%0D' }
New-Object psobject -Property @{ Token = "`n" ; Replacement = '%0A' }
New-Object psobject -Property @{ Token = "]" ; Replacement = '%5D' }
)
# TODO: BUG: Escape % ???
# TODO: Add test to verify don't need to escape "=".
<########################################
# Private functions.
########################################>
function Format-LoggingCommandData {
[CmdletBinding()]
param([string]$Value, [switch]$Reverse)
if (!$Value) {
return ''
}
if (!$Reverse) {
foreach ($mapping in $script:loggingCommandEscapeMappings) {
$Value = $Value.Replace($mapping.Token, $mapping.Replacement)
}
} else {
for ($i = $script:loggingCommandEscapeMappings.Length - 1 ; $i -ge 0 ; $i--) {
$mapping = $script:loggingCommandEscapeMappings[$i]
$Value = $Value.Replace($mapping.Replacement, $mapping.Token)
}
}
return $Value
}
function Format-LoggingCommand {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Area,
[Parameter(Mandatory = $true)]
[string]$Event,
[string]$Data,
[hashtable]$Properties)
# Append the preamble.
[System.Text.StringBuilder]$sb = New-Object -TypeName System.Text.StringBuilder
$null = $sb.Append($script:loggingCommandPrefix).Append($Area).Append('.').Append($Event)
# Append the properties.
if ($Properties) {
$first = $true
foreach ($key in $Properties.Keys) {
[string]$value = Format-LoggingCommandData $Properties[$key]
if ($value) {
if ($first) {
$null = $sb.Append(' ')
$first = $false
} else {
$null = $sb.Append(';')
}
$null = $sb.Append("$key=$value")
}
}
}
# Append the tail and output the value.
$Data = Format-LoggingCommandData $Data
$sb.Append(']').Append($Data).ToString()
}
function Write-LoggingCommand {
[CmdletBinding(DefaultParameterSetName = 'Parameters')]
param(
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Area,
[Parameter(Mandatory = $true, ParameterSetName = 'Parameters')]
[string]$Event,
[Parameter(ParameterSetName = 'Parameters')]
[string]$Data,
[Parameter(ParameterSetName = 'Parameters')]
[hashtable]$Properties,
[Parameter(Mandatory = $true, ParameterSetName = 'Object')]
$Command,
[switch]$AsOutput)
if ($PSCmdlet.ParameterSetName -eq 'Object') {
Write-LoggingCommand -Area $Command.Area -Event $Command.Event -Data $Command.Data -Properties $Command.Properties -AsOutput:$AsOutput
return
}
$command = Format-LoggingCommand -Area $Area -Event $Event -Data $Data -Properties $Properties
if ($AsOutput) {
$command
} else {
Write-Host $command
}
}
function Write-LogIssue {
[CmdletBinding()]
param(
[ValidateSet('warning', 'error')]
[Parameter(Mandatory = $true)]
[string]$Type,
[string]$Message,
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
$command = Format-LoggingCommand -Area 'task' -Event 'logissue' -Data $Message -Properties @{
'type' = $Type
'code' = $ErrCode
'sourcepath' = $SourcePath
'linenumber' = $LineNumber
'columnnumber' = $ColumnNumber
}
if ($AsOutput) {
return $command
}
if ($Type -eq 'error') {
$foregroundColor = $host.PrivateData.ErrorForegroundColor
$backgroundColor = $host.PrivateData.ErrorBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Red
$backgroundColor = [System.ConsoleColor]::Black
}
} else {
$foregroundColor = $host.PrivateData.WarningForegroundColor
$backgroundColor = $host.PrivateData.WarningBackgroundColor
if ($foregroundColor -isnot [System.ConsoleColor] -or $backgroundColor -isnot [System.ConsoleColor]) {
$foregroundColor = [System.ConsoleColor]::Yellow
$backgroundColor = [System.ConsoleColor]::Black
}
}
Write-Host $command -ForegroundColor $foregroundColor -BackgroundColor $backgroundColor
}
\ No newline at end of file
......@@ -53,6 +53,8 @@
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'TOOLSET'">https://dotnetfeed.blob.core.windows.net/dotnet-toolset/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'WINDOWSDESKTOP'">https://dotnetfeed.blob.core.windows.net/dotnet-windowsdesktop/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'NUGETCLIENT'">https://dotnetfeed.blob.core.windows.net/nuget-nugetclient/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETENTITYFRAMEWORK6'">https://dotnetfeed.blob.core.windows.net/aspnet-entityframework6/index.json</TargetStaticFeed>
<TargetStaticFeed Condition="'$(ArtifactsCategory.ToUpper())' == 'ASPNETBLAZOR'">https://dotnetfeed.blob.core.windows.net/aspnet-blazor/index.json</TargetStaticFeed>
</PropertyGroup>
<Error
......
param(
[Parameter(Mandatory=$true)][string] $InputPath, # Full path to directory where Symbols.NuGet packages to be checked are stored
[Parameter(Mandatory=$true)][string] $ExtractPath, # Full path to directory where the packages will be extracted during validation
[Parameter(Mandatory=$true)][string] $SourceLinkToolPath, # Full path to directory where dotnet SourceLink CLI was installed
[Parameter(Mandatory=$true)][string] $GHRepoName, # GitHub name of the repo including the Org. E.g., dotnet/arcade
[Parameter(Mandatory=$true)][string] $GHCommit # GitHub commit SHA used to build the packages
)
# Cache/HashMap (File -> Exist flag) used to consult whether a file exist
# in the repository at a specific commit point. This is populated by inserting
# all files present in the repo at a specific commit point.
$global:RepoFiles = @{}
$ValidatePackage = {
param(
[string] $PackagePath # Full path to a Symbols.NuGet package
)
# Ensure input file exist
if (!(Test-Path $PackagePath)) {
throw "Input file does not exist: $PackagePath"
}
# Extensions for which we'll look for SourceLink information
# For now we'll only care about Portable & Embedded PDBs
$RelevantExtensions = @(".dll", ".exe", ".pdb")
Write-Host -NoNewLine "Validating" ([System.IO.Path]::GetFileName($PackagePath)) "... "
$PackageId = [System.IO.Path]::GetFileNameWithoutExtension($PackagePath)
$ExtractPath = Join-Path -Path $using:ExtractPath -ChildPath $PackageId
$FailedFiles = 0
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Directory]::CreateDirectory($ExtractPath);
$zip = [System.IO.Compression.ZipFile]::OpenRead($PackagePath)
$zip.Entries |
Where-Object {$RelevantExtensions -contains [System.IO.Path]::GetExtension($_.Name)} |
ForEach-Object {
$FileName = $_.FullName
$Extension = [System.IO.Path]::GetExtension($_.Name)
$FakeName = -Join((New-Guid), $Extension)
$TargetFile = Join-Path -Path $ExtractPath -ChildPath $FakeName
# We ignore resource DLLs
if ($FileName.EndsWith(".resources.dll")) {
return
}
[System.IO.Compression.ZipFileExtensions]::ExtractToFile($_, $TargetFile, $true)
$ValidateFile = {
param(
[string] $FullPath, # Full path to the module that has to be checked
[string] $RealPath,
[ref] $FailedFiles
)
# Makes easier to reference `sourcelink cli`
Push-Location $using:SourceLinkToolPath
$SourceLinkInfos = .\sourcelink.exe print-urls $FullPath | Out-String
if ($LASTEXITCODE -eq 0 -and -not ([string]::IsNullOrEmpty($SourceLinkInfos))) {
$NumFailedLinks = 0
# We only care about Http addresses
$Matches = (Select-String '(http[s]?)(:\/\/)([^\s,]+)' -Input $SourceLinkInfos -AllMatches).Matches
if ($Matches.Count -ne 0) {
$Matches.Value |
ForEach-Object {
$Link = $_
$CommitUrl = -Join("https://raw.githubusercontent.com/", $using:GHRepoName, "/", $using:GHCommit, "/")
$FilePath = $Link.Replace($CommitUrl, "")
$Status = 200
$Cache = $using:RepoFiles
if ( !($Cache.ContainsKey($FilePath)) ) {
try {
$Uri = $Link -as [System.URI]
# Only GitHub links are valid
if ($Uri.AbsoluteURI -ne $null -and $Uri.Host -match "github") {
$Status = (Invoke-WebRequest -Uri $Link -UseBasicParsing -Method HEAD -TimeoutSec 5).StatusCode
}
else {
$Status = 0
}
}
catch {
$Status = 0
}
}
if ($Status -ne 200) {
if ($NumFailedLinks -eq 0) {
if ($FailedFiles.Value -eq 0) {
Write-Host
}
Write-Host "`tFile $RealPath has broken links:"
}
Write-Host "`t`tFailed to retrieve $Link"
$NumFailedLinks++
}
}
}
if ($NumFailedLinks -ne 0) {
$FailedFiles.value++
$global:LASTEXITCODE = 1
}
}
Pop-Location
}
&$ValidateFile $TargetFile $FileName ([ref]$FailedFiles)
}
$zip.Dispose()
if ($FailedFiles -eq 0) {
Write-Host "Passed."
}
}
function ValidateSourceLinkLinks {
if (!($GHRepoName -Match "^[^\s\/]+/[^\s\/]+$")) {
Write-Host "GHRepoName should be in the format <org>/<repo>"
$global:LASTEXITCODE = 1
return
}
if (!($GHCommit -Match "^[0-9a-fA-F]{40}$")) {
Write-Host "GHCommit should be a 40 chars hexadecimal string"
$global:LASTEXITCODE = 1
return
}
$RepoTreeURL = -Join("https://api.github.com/repos/", $GHRepoName, "/git/trees/", $GHCommit, "?recursive=1")
$CodeExtensions = @(".cs", ".vb", ".fs", ".fsi", ".fsx", ".fsscript")
try {
# Retrieve the list of files in the repo at that particular commit point and store them in the RepoFiles hash
$Data = Invoke-WebRequest $RepoTreeURL | ConvertFrom-Json | Select-Object -ExpandProperty tree
foreach ($file in $Data) {
$Extension = [System.IO.Path]::GetExtension($file.path)
if ($CodeExtensions.Contains($Extension)) {
$RepoFiles[$file.path] = 1
}
}
}
catch {
Write-Host "Problems downloading the list of files from the repo. Url used: $RepoTreeURL"
$global:LASTEXITCODE = 1
return
}
if (Test-Path $ExtractPath) {
Remove-Item $ExtractPath -Force -Recurse -ErrorAction SilentlyContinue
}
# Process each NuGet package in parallel
$Jobs = @()
Get-ChildItem "$InputPath\*.symbols.nupkg" |
ForEach-Object {
$Jobs += Start-Job -ScriptBlock $ValidatePackage -ArgumentList $_.FullName
}
foreach ($Job in $Jobs) {
Wait-Job -Id $Job.Id | Receive-Job
}
}
Measure-Command { ValidateSourceLinkLinks }
[CmdletBinding(PositionalBinding=$false)]
Param(
[string][Alias('c')]$configuration = "Debug",
[string]$platform = $null,
[string] $projects,
[string][Alias('v')]$verbosity = "minimal",
[string] $msbuildEngine = $null,
......@@ -29,6 +30,7 @@ Param(
function Print-Usage() {
Write-Host "Common settings:"
Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
Write-Host " -platform <value> Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild"
Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
Write-Host " -binaryLog Output binary log (short: -bl)"
Write-Host " -help Print help and exit"
......@@ -77,6 +79,7 @@ function Build {
InitializeCustomToolset
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" }
$platformArg = if ($platform) { "/p:Platform=$platform" } else { "" }
if ($projects) {
# Re-assign properties to a new variable because PowerShell doesn't let us append properties directly for unclear reasons.
......@@ -88,6 +91,7 @@ function Build {
MSBuild $toolsetBuildProj `
$bl `
$platformArg `
/p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
/p:Restore=$restore `
......@@ -122,12 +126,15 @@ try {
. $configureToolsetScript
}
if (($restore) -and ($null -eq $env:DisableNativeToolsetInstalls)) {
InitializeNativeTools
}
Build
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
Write-PipelineTaskError -Message $_
ExitWithExitCode 1
}
......
......@@ -35,7 +35,7 @@ usage()
echo " --nodeReuse <value> Sets nodereuse msbuild parameter ('true' or 'false')"
echo " --warnAsError <value> Sets warnaserror msbuild parameter ('true' or 'false')"
echo ""
echo "Command line arguments starting with '/p:' are passed through to MSBuild."
echo "Command line arguments not listed above are passed thru to msbuild."
echo "Arguments can also be passed in with a single hyphen."
}
......@@ -66,6 +66,7 @@ ci=false
warn_as_error=true
node_reuse=true
binary_log=false
pipelines_log=false
projects=''
configuration='Debug'
......@@ -92,6 +93,9 @@ while [[ $# > 0 ]]; do
-binarylog|-bl)
binary_log=true
;;
-pipelineslog|-pl)
pipelines_log=true
;;
-restore|-r)
restore=true
;;
......@@ -137,22 +141,8 @@ while [[ $# > 0 ]]; do
node_reuse=$2
shift
;;
-p:*|/p:*)
properties="$properties $1"
;;
-m:*|/m:*)
properties="$properties $1"
;;
-bl:*|/bl:*)
properties="$properties $1"
;;
-dl:*|/dl:*)
properties="$properties $1"
;;
*)
echo "Invalid argument: $1"
usage
exit 1
properties="$properties $1"
;;
esac
......@@ -160,6 +150,7 @@ while [[ $# > 0 ]]; do
done
if [[ "$ci" == true ]]; then
pipelines_log=true
binary_log=true
node_reuse=false
fi
......@@ -218,4 +209,8 @@ if [[ -n "${useInstalledDotNetCli:-}" ]]; then
use_installed_dotnet_cli="$useInstalledDotNetCli"
fi
if [[ "$restore" == true && -z ${DisableNativeToolsetInstalls:-} ]]; then
InitializeNativeTools
fi
Build
deb http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse
\ No newline at end of file
deb http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse
\ No newline at end of file
deb http://deb.debian.org/debian buster main
deb-src http://deb.debian.org/debian buster main
deb http://deb.debian.org/debian-security/ buster/updates main
deb-src http://deb.debian.org/debian-security/ buster/updates main
deb http://deb.debian.org/debian buster-updates main
deb-src http://deb.debian.org/debian buster-updates main
deb http://deb.debian.org/debian buster-backports main contrib non-free
deb-src http://deb.debian.org/debian buster-backports main contrib non-free
deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main
deb http://deb.debian.org/debian stretch-backports main contrib non-free
deb-src http://deb.debian.org/debian stretch-backports main contrib non-free
deb http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ vivid-security main restricted universe multiverse
\ No newline at end of file
deb http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-updates main restricted universe
deb http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-backports main restricted
deb http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse
deb-src http://ports.ubuntu.com/ubuntu-ports/ wily-security main restricted universe multiverse
\ No newline at end of file
......@@ -2,21 +2,21 @@
usage()
{
echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount]"
echo "Usage: $0 [BuildArch] [LinuxCodeName] [lldbx.y] [--skipunmount] --rootfsdir <directory>]"
echo "BuildArch can be: arm(default), armel, arm64, x86"
echo "LinuxCodeName - optional, Code name for Linux, can be: trusty(default), vivid, wily, xenial, zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen."
echo "lldbx.y - optional, LLDB version, can be: lldb3.6(default), lldb3.8, lldb3.9, lldb4.0, no-lldb. Ignored for alpine"
echo "LinuxCodeName - optional, Code name for Linux, can be: trusty, xenial(default), zesty, bionic, alpine. If BuildArch is armel, LinuxCodeName is jessie(default) or tizen."
echo "lldbx.y - optional, LLDB version, can be: lldb3.9(default), lldb4.0, lldb5.0, lldb6.0 no-lldb. Ignored for alpine"
echo "--skipunmount - optional, will skip the unmount of rootfs folder."
exit 1
}
__LinuxCodeName=trusty
__LinuxCodeName=xenial
__CrossDir=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )
__InitialDir=$PWD
__BuildArch=arm
__UbuntuArch=armhf
__UbuntuRepo="http://ports.ubuntu.com/"
__LLDB_Package="lldb-3.6-dev"
__LLDB_Package="liblldb-3.9-dev"
__SkipUnmount=0
# base development support
......@@ -53,8 +53,12 @@ __AlpinePackages+=" openssl-dev"
__AlpinePackages+=" zlib-dev"
__UnprocessedBuildArgs=
for i in "$@" ; do
lowerI="$(echo $i | awk '{print tolower($0)}')"
while :; do
if [ $# -le 0 ]; then
break
fi
lowerI="$(echo $1 | awk '{print tolower($0)}')"
case $lowerI in
-?|-h|--help)
usage
......@@ -95,38 +99,49 @@ for i in "$@" ; do
lldb4.0)
__LLDB_Package="liblldb-4.0-dev"
;;
lldb5.0)
__LLDB_Package="liblldb-5.0-dev"
;;
lldb6.0)
__LLDB_Package="liblldb-6.0-dev"
;;
no-lldb)
unset __LLDB_Package
;;
vivid)
trusty) # Ubuntu 14.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=vivid
__LinuxCodeName=trusty
fi
;;
wily)
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=wily
fi
;;
xenial)
xenial) # Ubuntu 16.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=xenial
fi
;;
zesty)
zesty) # Ubuntu 17.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=zesty
fi
;;
bionic)
bionic) # Ubuntu 18.04
if [ "$__LinuxCodeName" != "jessie" ]; then
__LinuxCodeName=bionic
fi
;;
jessie)
jessie) # Debian 8
__LinuxCodeName=jessie
__UbuntuRepo="http://ftp.debian.org/debian/"
;;
stretch) # Debian 9
__LinuxCodeName=stretch
__UbuntuRepo="http://ftp.debian.org/debian/"
__LLDB_Package="liblldb-6.0-dev"
;;
buster) # Debian 10
__LinuxCodeName=buster
__UbuntuRepo="http://ftp.debian.org/debian/"
__LLDB_Package="liblldb-6.0-dev"
;;
tizen)
if [ "$__BuildArch" != "armel" ]; then
echo "Tizen is available only for armel."
......@@ -144,10 +159,16 @@ for i in "$@" ; do
--skipunmount)
__SkipUnmount=1
;;
--rootfsdir|-rootfsdir)
shift
__RootfsDir=$1
;;
*)
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $i"
__UnprocessedBuildArgs="$__UnprocessedBuildArgs $1"
;;
esac
shift
done
if [ "$__BuildArch" == "armel" ]; then
......@@ -155,12 +176,14 @@ if [ "$__BuildArch" == "armel" ]; then
fi
__UbuntuPackages+=" ${__LLDB_Package:-}"
__RootfsDir="$__CrossDir/rootfs/$__BuildArch"
if [[ -n "$ROOTFS_DIR" ]]; then
if [ -z "$__RootfsDir" ] && [ ! -z "$ROOTFS_DIR" ]; then
__RootfsDir=$ROOTFS_DIR
fi
if [ -z "$__RootfsDir" ]; then
__RootfsDir="$__CrossDir/rootfs/$__BuildArch"
fi
if [ -d "$__RootfsDir" ]; then
if [ $__SkipUnmount == 0 ]; then
umount $__RootfsDir/*
......
deb http://archive.ubuntu.com/ubuntu/ vivid main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ vivid main restricted universe
deb http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ vivid-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ vivid-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ vivid-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ vivid-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ vivid-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ wily main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ wily main restricted universe
deb http://archive.ubuntu.com/ubuntu/ wily-updates main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ wily-updates main restricted universe
deb http://archive.ubuntu.com/ubuntu/ wily-backports main restricted
deb-src http://archive.ubuntu.com/ubuntu/ wily-backports main restricted
deb http://archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ wily-security main restricted universe multiverse
param (
$darcVersion = $null
$darcVersion = $null,
$versionEndpoint = "https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
)
$verbosity = "m"
......@@ -16,13 +17,13 @@ function InstallDarcCli ($darcVersion) {
Invoke-Expression "& `"$dotnet`" tool uninstall $darcCliPackageName -g"
}
# Until we can anonymously query the BAR API for the latest arcade-services
# build applied to the PROD channel, this is hardcoded.
# If the user didn't explicitly specify the darc version,
# query the Maestro API for the correct version of darc to install.
if (-not $darcVersion) {
$darcVersion = '1.1.0-beta.19205.4'
$darcVersion = $(Invoke-WebRequest -Uri $versionEndpoint -UseBasicParsing).Content
}
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json'
$arcadeServicesSource = 'https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json'
Write-Host "Installing Darc CLI version $darcVersion..."
Write-Host "You may need to restart your command window if this is the first dotnet tool you have installed."
......
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
darcVersion="1.1.0-beta.19205.4"
darcVersion=''
versionEndpoint="https://maestro-prod.westus2.cloudapp.azure.com/api/assets/darc-version?api-version=2019-01-16"
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
......@@ -10,6 +11,10 @@ while [[ $# > 0 ]]; do
darcVersion=$2
shift
;;
--versionendpoint)
versionEndpoint=$2
shift
;;
*)
echo "Invalid argument: $1"
usage
......@@ -33,6 +38,10 @@ verbosity=m
. "$scriptroot/tools.sh"
if [ -z "$darcVersion" ]; then
darcVersion=$(curl -X GET "$versionEndpoint" -H "accept: text/plain")
fi
function InstallDarcCli {
local darc_cli_package_name="microsoft.dotnet.darc"
......@@ -45,9 +54,9 @@ function InstallDarcCli {
echo $($dotnet_root/dotnet tool uninstall $darc_cli_package_name -g)
fi
local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-arcade/index.json"
local arcadeServicesSource="https://dotnetfeed.blob.core.windows.net/dotnet-core/index.json"
echo "Installing Darc CLI version $toolset_version..."
echo "Installing Darc CLI version $darcVersion..."
echo "You may need to restart your command shell if this is the first dotnet tool you have installed."
echo $($dotnet_root/dotnet tool install $darc_cli_package_name --version $darcVersion --add-source "$arcadeServicesSource" -v $verbosity -g)
}
......
@echo off
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0dotnet-install.ps1""" %*"
\ No newline at end of file
[CmdletBinding(PositionalBinding=$false)]
Param(
[string] $verbosity = "minimal",
[string] $architecture = "",
[string] $version = "Latest",
[string] $runtime = "dotnet"
)
. $PSScriptRoot\tools.ps1
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
$installdir = $dotnetRoot
try {
if ($architecture -and $architecture.Trim() -eq "x86") {
$installdir = Join-Path $installdir "x86"
}
InstallDotNet $installdir $version $architecture $runtime $true
}
catch {
Write-Host $_
Write-Host $_.Exception
Write-Host $_.ScriptStackTrace
ExitWithExitCode 1
}
ExitWithExitCode 0
#!/usr/bin/env bash
source="${BASH_SOURCE[0]}"
# resolve $source until the file is no longer a symlink
while [[ -h "$source" ]]; do
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
source="$(readlink "$source")"
# if $source was a relative symlink, we need to resolve it relative to the path where the
# symlink file was located
[[ $source != /* ]] && source="$scriptroot/$source"
done
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )"
version='Latest'
architecture=''
runtime='dotnet'
while [[ $# > 0 ]]; do
opt="$(echo "$1" | awk '{print tolower($0)}')"
case "$opt" in
-version|-v)
shift
version="$1"
;;
-architecture|-a)
shift
architecture="$1"
;;
-runtime|-r)
shift
runtime="$1"
;;
*)
echo "Invalid argument: $1"
usage
exit 1
;;
esac
shift
done
. "$scriptroot/tools.sh"
dotnetRoot="$repo_root/.dotnet"
InstallDotNet $dotnetRoot $version "$architecture" $runtime true || {
local exit_code=$?
echo "dotnet-install.sh failed (exit code '$exit_code')." >&2
ExitWithExitCode $exit_code
}
ExitWithExitCode 0
......@@ -41,9 +41,13 @@ Param (
[switch] $Force = $False,
[int] $DownloadRetries = 5,
[int] $RetryWaitTimeInSeconds = 30,
[string] $GlobalJsonFile = "$PSScriptRoot\..\..\global.json"
[string] $GlobalJsonFile
)
if (!$GlobalJsonFile) {
$GlobalJsonFile = Join-Path (Get-Item $PSScriptRoot).Parent.Parent.FullName "global.json"
}
Set-StrictMode -version 2.0
$ErrorActionPreference="Stop"
......
......@@ -9,7 +9,7 @@ clean=false
force=false
download_retries=5
retry_wait_time_seconds=30
global_json_file="${scriptroot}/../../global.json"
global_json_file="$(dirname "$(dirname "${scriptroot}")")/global.json"
declare -A native_assets
. $scriptroot/native/common-library.sh
......@@ -71,6 +71,7 @@ function ReadGlobalJsonNativeTools {
local native_tools_list=$(echo $native_tools_section | awk -F"[{}]" '{print $2}')
native_tools_list=${native_tools_list//[\" ]/}
native_tools_list=${native_tools_list//,/$'\n'}
native_tools_list="$(echo -e "${native_tools_list}" | tr -d '[:space:]')"
local old_IFS=$IFS
while read -r line; do
......@@ -116,8 +117,6 @@ else
installer_command+=" --clean"
fi
echo "Installing $tool version $tool_version"
echo "Executing '$installer_command'"
$installer_command
if [[ $? != 0 ]]; then
......@@ -127,19 +126,16 @@ else
done
fi
if [[ ! -z $clean ]]; then
if [[ $clean = true ]]; then
exit 0
fi
if [[ -d $install_bin ]]; then
echo "Native tools are available from $install_bin"
if [[ !-z BUILD_BUILDNUMBER ]]; then
echo "##vso[task.prependpath]$install_bin"
fi
echo "##vso[task.prependpath]$install_bin"
else
echo "Native tools install directory does not exist, installation failed" >&2
exit 1
fi
exit 0
......@@ -43,9 +43,12 @@ parameters:
# Optional: enable sending telemetry
enableTelemetry: false
# Optional: define the helix repo for telemeetry (example: 'dotnet/arcade')
# Optional: define the helix repo for telemetry (example: 'dotnet/arcade')
helixRepo: ''
# Optional: define the helix type for telemetry (example: 'build/product/')
helixType: ''
# Required: name of the job
name: ''
......@@ -87,6 +90,9 @@ jobs:
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
variables:
- ${{ if eq(parameters.enableTelemetry, 'true') }}:
- name: DOTNET_CLI_TELEMETRY_PROFILE
value: '$(Build.Repository.Uri)'
- ${{ each variable in parameters.variables }}:
# handle name-value variable syntax
# example:
......@@ -122,6 +128,8 @@ jobs:
displayName: 'Send Helix Start Telemetry'
inputs:
helixRepo: ${{ parameters.helixRepo }}
${{ if ne(parameters.helixType, '') }}:
helixType: ${{ parameters.helixType }}
buildConfig: $(_BuildConfig)
runAsPublic: ${{ parameters.runAsPublic }}
continueOnError: ${{ parameters.continueOnError }}
......
parameters:
HelixSource: 'pr/dotnet-github-anon-kaonashi-bot'
HelixType: ̓'tests/default'
HelixBuild: $(Build.BuildNumber)
HelixTargetQueues: ''
HelixAccessToken: ''
HelixPreCommands: ''
HelixPostCommands: ''
WorkItemDirectory: ''
WorkItemCommand: ''
CorrelationPayloadDirectory: ''
XUnitProjects: ''
XUnitTargetFramework: ''
XUnitRunnerVersion: ''
IncludeDotNetCli: false
DotNetCliPackageType: ''
DotNetCliVersion: ''
EnableXUnitReporter: false
WaitForWorkItemCompletion: true
condition: succeeded()
continueOnError: false
steps:
- task: DotNetCoreCLI@2
inputs:
command: custom
projects: eng/common/helixpublish.proj
custom: msbuild
arguments: '/bl:$(Build.SourcesDirectory)/artifacts/log/$(_BuildConfig)/SendToHelix.binlog'
displayName: Send job to Helix
env:
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
HelixPostCommands: ${{ parameters.HelixPostCommands }}
WorkItemDirectory: ${{ parameters.WorkItemDirectory }}
WorkItemCommand: ${{ parameters.WorkItemCommand }}
CorrelationPayloadDirectory: ${{ parameters.CorrelationPayloadDirectory }}
XUnitProjects: ${{ parameters.XUnitProjects }}
XUnitRuntimeTargetFramework: ${{ parameters.XUnitTargetFramework }}
XUnitRunnerVersion: ${{ parameters.XUnitRunnerVersion }}
IncludeDotNetCli: ${{ parameters.IncludeDotNetCli }}
DotNetCliPackageType: ${{ parameters.DotNetCliPackageType }}
DotNetCliVersion: ${{ parameters.DotNetCliVersion }}
EnableXUnitReporter: ${{ parameters.EnableXUnitReporter }}
WaitForWorkItemCompletion: ${{ parameters.WaitForWorkItemCompletion }}
condition: ${{ parameters.condition }}
continueOnError: ${{ parameters.continueOnError }}
......@@ -5,6 +5,7 @@ parameters:
HelixBuild: $(Build.BuildNumber) # required -- the build number Helix will use to identify this -- automatically set to the AzDO build number
HelixTargetQueues: '' # required -- semicolon delimited list of Helix queues to test on; see https://helix.dot.net/ for a list of queues
HelixAccessToken: '' # required -- access token to make Helix API requests; should be provided by the appropriate variable group
HelixConfiguration: '' # optional -- additional property attached to a job
HelixPreCommands: '' # optional -- commands to run before Helix work item execution
HelixPostCommands: '' # optional -- commands to run after Helix work item execution
WorkItemDirectory: '' # optional -- a payload directory to zip up and send to Helix; requires WorkItemCommand; incompatible with XUnitProjects
......@@ -23,7 +24,7 @@ parameters:
WaitForWorkItemCompletion: true # optional -- true will make the task wait until work items have been completed and fail the build if work items fail. False is "fire and forget."
IsExternal: false # [DEPRECATED] -- doesn't do anything, jobs are external if HelixAccessToken is empty and Creator is set
Creator: '' # optional -- if the build is external, use this to specify who is sending the job
DisplayNamePrefix: 'Send job to Helix' # optional -- rename the beginning of the displayName of the steps in AzDO
DisplayNamePrefix: 'Run Tests' # optional -- rename the beginning of the displayName of the steps in AzDO
condition: succeeded() # optional -- condition for step to execute; defaults to succeeded()
continueOnError: false # optional -- determines whether to continue the build if the step errors; defaults to false
......@@ -35,6 +36,7 @@ steps:
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixConfiguration: ${{ parameters.HelixConfiguration }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
......@@ -64,6 +66,7 @@ steps:
HelixSource: ${{ parameters.HelixSource }}
HelixType: ${{ parameters.HelixType }}
HelixBuild: ${{ parameters.HelixBuild }}
HelixConfiguration: ${{ parameters.HelixConfiguration }}
HelixTargetQueues: ${{ parameters.HelixTargetQueues }}
HelixAccessToken: ${{ parameters.HelixAccessToken }}
HelixPreCommands: ${{ parameters.HelixPreCommands }}
......
......@@ -11,6 +11,12 @@
# Binary log must be enabled on CI.
[bool]$binaryLog = if (Test-Path variable:binaryLog) { $binaryLog } else { $ci }
# Set to true to use the pipelines logger which will enable Azure logging output.
# https://github.com/Microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md
# This flag is meant as a temporary opt-opt for the feature while validate it across
# our consumers. It will be deleted in the future.
[bool]$pipelinesLog = if (Test-Path variable:pipelinesLog) { $pipelinesLog } else { $ci }
# Turns on machine preparation/clean up code that changes the machine state (e.g. kills build processes).
[bool]$prepareMachine = if (Test-Path variable:prepareMachine) { $prepareMachine } else { $false }
......@@ -86,6 +92,68 @@ function Exec-Process([string]$command, [string]$commandArgs) {
}
}
function Write-PipelineTaskError {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Message,
[Parameter(Mandatory = $false)]
[string]$Type = 'error',
[string]$ErrCode,
[string]$SourcePath,
[string]$LineNumber,
[string]$ColumnNumber,
[switch]$AsOutput)
if(!$ci) {
if($Type -eq 'error') {
Write-Error $Message
return
}
elseif ($Type -eq 'warning') {
Write-Warning $Message
return
}
}
if(($Type -ne 'error') -and ($Type -ne 'warning')) {
Write-Host $Message
return
}
if(-not $PSBoundParameters.ContainsKey('Type')) {
$PSBoundParameters.Add('Type', 'error')
}
Write-LogIssue @PSBoundParameters
}
function Write-PipelineSetVariable {
[CmdletBinding()]
param(
[Parameter(Mandatory = $true)]
[string]$Name,
[string]$Value,
[switch]$Secret,
[switch]$AsOutput)
if($ci) {
Write-LoggingCommand -Area 'task' -Event 'setvariable' -Data $Value -Properties @{
'variable' = $Name
'issecret' = $Secret
} -AsOutput:$AsOutput
}
}
function Write-PipelinePrependPath {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]$Path,
[switch]$AsOutput)
if($ci) {
Write-LoggingCommand -Area 'task' -Event 'prependpath' -Data $Path -AsOutput:$AsOutput
}
}
function InitializeDotNetCli([bool]$install) {
if (Test-Path variable:global:_DotNetInstallDir) {
return $global:_DotNetInstallDir
......@@ -108,7 +176,7 @@ function InitializeDotNetCli([bool]$install) {
}
# Find the first path on %PATH% that contains the dotnet.exe
if ($useInstalledDotNetCli -and ($env:DOTNET_INSTALL_DIR -eq $null)) {
if ($useInstalledDotNetCli -and (-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -eq $null)) {
$dotnetCmd = Get-Command "dotnet.exe" -ErrorAction SilentlyContinue
if ($dotnetCmd -ne $null) {
$env:DOTNET_INSTALL_DIR = Split-Path $dotnetCmd.Path -Parent
......@@ -119,7 +187,7 @@ function InitializeDotNetCli([bool]$install) {
# Use dotnet installation specified in DOTNET_INSTALL_DIR if it contains the required SDK version,
# otherwise install the dotnet CLI and SDK to repo local .dotnet directory to avoid potential permission issues.
if (($env:DOTNET_INSTALL_DIR -ne $null) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) {
if ((-not $globalJsonHasRuntimes) -and ($env:DOTNET_INSTALL_DIR -ne $null) -and (Test-Path(Join-Path $env:DOTNET_INSTALL_DIR "sdk\$dotnetSdkVersion"))) {
$dotnetRoot = $env:DOTNET_INSTALL_DIR
} else {
$dotnetRoot = Join-Path $RepoRoot ".dotnet"
......@@ -128,7 +196,7 @@ function InitializeDotNetCli([bool]$install) {
if ($install) {
InstallDotNetSdk $dotnetRoot $dotnetSdkVersion
} else {
Write-Host "Unable to find dotnet with SDK version '$dotnetSdkVersion'" -ForegroundColor Red
Write-PipelineTaskError "Unable to find dotnet with SDK version '$dotnetSdkVersion'"
ExitWithExitCode 1
}
}
......@@ -141,18 +209,16 @@ function InitializeDotNetCli([bool]$install) {
# It also ensures that VS msbuild will use the downloaded sdk targets.
$env:PATH = "$dotnetRoot;$env:PATH"
if ($ci) {
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
Write-Host "##vso[task.prependpath]$dotnetRoot"
Write-Host "##vso[task.setvariable variable=DOTNET_MULTILEVEL_LOOKUP]0"
Write-Host "##vso[task.setvariable variable=DOTNET_SKIP_FIRST_TIME_EXPERIENCE]1"
}
# Make Sure that our bootstrapped dotnet cli is avaliable in future steps of the Azure Pipelines build
Write-PipelinePrependPath -Path $dotnetRoot
Write-PipelineSetVariable -Name 'DOTNET_MULTILEVEL_LOOKUP' -Value '0'
Write-PipelineSetVariable -Name 'DOTNET_SKIP_FIRST_TIME_EXPERIENCE' -Value '1'
return $global:_DotNetInstallDir = $dotnetRoot
}
function GetDotNetInstallScript([string] $dotnetRoot) {
$installScript = "$dotnetRoot\dotnet-install.ps1"
$installScript = Join-Path $dotnetRoot "dotnet-install.ps1"
if (!(Test-Path $installScript)) {
Create-Directory $dotnetRoot
Invoke-WebRequest "https://dot.net/v1/dotnet-install.ps1" -OutFile $installScript
......@@ -162,11 +228,23 @@ function GetDotNetInstallScript([string] $dotnetRoot) {
}
function InstallDotNetSdk([string] $dotnetRoot, [string] $version, [string] $architecture = "") {
InstallDotNet $dotnetRoot $version $architecture
}
function InstallDotNet([string] $dotnetRoot, [string] $version, [string] $architecture = "", [string] $runtime = "", [bool] $skipNonVersionedFiles = $false) { $installScript = GetDotNetInstallScript $dotnetRoot
$installScript = GetDotNetInstallScript $dotnetRoot
$archArg = if ($architecture) { $architecture } else { "<auto>" }
& $installScript -Version $version -InstallDir $dotnetRoot -Architecture $archArg
$installParameters = @{
Version = $version
InstallDir = $dotnetRoot
}
if ($architecture) { $installParameters.Architecture = $architecture }
if ($runtime) { $installParameters.Runtime = $runtime }
if ($skipNonVersionedFiles) { $installParameters.SkipNonVersionedFiles = $skipNonVersionedFiles }
& $installScript @installParameters
if ($lastExitCode -ne 0) {
Write-Host "Failed to install dotnet cli (exit code '$lastExitCode')." -ForegroundColor Red
Write-PipelineTaskError -Message "Failed to install dotnet cli (exit code '$lastExitCode')."
ExitWithExitCode $lastExitCode
}
}
......@@ -195,7 +273,11 @@ function InitializeVisualStudioMSBuild([bool]$install, [object]$vsRequirements =
if ($env:VSINSTALLDIR -ne $null) {
$msbuildCmd = Get-Command "msbuild.exe" -ErrorAction SilentlyContinue
if ($msbuildCmd -ne $null) {
if ($msbuildCmd.Version -ge $vsMinVersion) {
# Workaround for https://github.com/dotnet/roslyn/issues/35793
# Due to this issue $msbuildCmd.Version returns 0.0.0.0 for msbuild.exe 16.2+
$msbuildVersion = [Version]::new((Get-Item $msbuildCmd.Path).VersionInfo.ProductVersion.Split(@('-', '+'))[0])
if ($msbuildVersion -ge $vsMinVersion) {
return $global:_MSBuildExe = $msbuildCmd.Path
}
......@@ -336,22 +418,22 @@ function InitializeBuildTool() {
if ($msbuildEngine -eq "dotnet") {
if (!$dotnetRoot) {
Write-Host "/global.json must specify 'tools.dotnet'." -ForegroundColor Red
Write-PipelineTaskError "/global.json must specify 'tools.dotnet'."
ExitWithExitCode 1
}
$buildTool = @{ Path = Join-Path $dotnetRoot "dotnet.exe"; Command = "msbuild" }
$buildTool = @{ Path = Join-Path $dotnetRoot "dotnet.exe"; Command = "msbuild"; Tool = "dotnet"; Framework = "netcoreapp2.1" }
} elseif ($msbuildEngine -eq "vs") {
try {
$msbuildPath = InitializeVisualStudioMSBuild -install:$restore
} catch {
Write-Host $_ -ForegroundColor Red
Write-PipelineTaskError $_
ExitWithExitCode 1
}
$buildTool = @{ Path = $msbuildPath; Command = "" }
$buildTool = @{ Path = $msbuildPath; Command = ""; Tool = "vs"; Framework = "net472" }
} else {
Write-Host "Unexpected value of -msbuildEngine: '$msbuildEngine'." -ForegroundColor Red
Write-PipelineTaskError "Unexpected value of -msbuildEngine: '$msbuildEngine'."
ExitWithExitCode 1
}
......@@ -368,7 +450,7 @@ function GetDefaultMSBuildEngine() {
return "dotnet"
}
Write-Host "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'." -ForegroundColor Red
Write-PipelineTaskError "-msbuildEngine must be specified, or /global.json must specify 'tools.dotnet' or 'tools.vs'."
ExitWithExitCode 1
}
......@@ -391,6 +473,16 @@ function GetSdkTaskProject([string]$taskName) {
return Join-Path (Split-Path (InitializeToolset) -Parent) "SdkTasks\$taskName.proj"
}
function InitializeNativeTools() {
if (Get-Member -InputObject $GlobalJson -Name "native-tools") {
$nativeArgs=""
if ($ci) {
$nativeArgs = "-InstallDirectory $ToolsDir"
}
Invoke-Expression "& `"$PSScriptRoot/init-tools-native.ps1`" $nativeArgs"
}
}
function InitializeToolset() {
if (Test-Path variable:global:_ToolsetBuildProj) {
return $global:_ToolsetBuildProj
......@@ -409,7 +501,7 @@ function InitializeToolset() {
}
if (-not $restore) {
Write-Host "Toolset version $toolsetVersion has not been restored." -ForegroundColor Red
Write-PipelineTaskError "Toolset version $toolsetVersion has not been restored."
ExitWithExitCode 1
}
......@@ -419,7 +511,8 @@ function InitializeToolset() {
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "ToolsetRestore.binlog") } else { "" }
'<Project Sdk="Microsoft.DotNet.Arcade.Sdk"/>' | Set-Content $proj
MSBuild $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile
MSBuild-Core $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$toolsetLocationFile
$path = Get-Content $toolsetLocationFile -TotalCount 1
if (!(Test-Path $path)) {
......@@ -449,6 +542,23 @@ function Stop-Processes() {
# Terminates the script if the build fails.
#
function MSBuild() {
if ($pipelinesLog) {
$buildTool = InitializeBuildTool
$toolsetBuildProject = InitializeToolset
$path = Split-Path -parent $toolsetBuildProject
$path = Join-Path $path (Join-Path $buildTool.Framework "Microsoft.DotNet.Arcade.Sdk.dll")
$args += "/logger:$path"
}
MSBuild-Core @args
}
#
# Executes msbuild (or 'dotnet msbuild') with arguments passed to the function.
# The arguments are automatically quoted.
# Terminates the script if the build fails.
#
function MSBuild-Core() {
if ($ci) {
if (!$binaryLog) {
throw "Binary log must be enabled in CI build."
......@@ -476,7 +586,7 @@ function MSBuild() {
$exitCode = Exec-Process $buildTool.Path $cmdArgs
if ($exitCode -ne 0) {
Write-Host "Build failed." -ForegroundColor Red
Write-PipelineTaskError "Build failed."
$buildLog = GetMSBuildBinaryLogCommandLineArgument $args
if ($buildLog -ne $null) {
......@@ -504,6 +614,8 @@ function GetMSBuildBinaryLogCommandLineArgument($arguments) {
return $null
}
. $PSScriptRoot\LoggingCommandFunctions.ps1
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..\..")
$EngRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$ArtifactsDir = Join-Path $RepoRoot "artifacts"
......@@ -512,16 +624,15 @@ $ToolsDir = Join-Path $RepoRoot ".tools"
$LogDir = Join-Path (Join-Path $ArtifactsDir "log") $configuration
$TempDir = Join-Path (Join-Path $ArtifactsDir "tmp") $configuration
$GlobalJson = Get-Content -Raw -Path (Join-Path $RepoRoot "global.json") | ConvertFrom-Json
# true if global.json contains a "runtimes" section
$globalJsonHasRuntimes = if ($GlobalJson.tools.PSObject.Properties.Name -Match 'runtimes') { $true } else { $false }
Create-Directory $ToolsetDir
Create-Directory $TempDir
Create-Directory $LogDir
if ($ci) {
Write-Host "##vso[task.setvariable variable=Artifacts]$ArtifactsDir"
Write-Host "##vso[task.setvariable variable=Artifacts.Toolset]$ToolsetDir"
Write-Host "##vso[task.setvariable variable=Artifacts.Log]$LogDir"
$env:TEMP = $TempDir
$env:TMP = $TempDir
}
Write-PipelineSetVariable -Name 'Artifacts' -Value $ArtifactsDir
Write-PipelineSetVariable -Name 'Artifacts.Toolset' -Value $ToolsetDir
Write-PipelineSetVariable -Name 'Artifacts.Log' -Value $LogDir
Write-PipelineSetVariable -Name 'TEMP' -Value $TempDir
Write-PipelineSetVariable -Name 'TMP' -Value $TempDir
此差异已折叠。
......@@ -8,6 +8,14 @@ if (($properties -eq $null) -or (-not ($properties -icontains '/nowarn:D9035')))
$properties = @('/nowarn:D9035') + $properties
}
# This repo treats Solution/Project platform 'Any CPU' as ~= 'x86', and
# defaults to 'Any CPU'/x86.
if (($properties -eq $null) -or (-not ($properties -ilike '/p:Platform=*'))) {
if (-not $platform) {
$platform='x86'
}
}
# Make sure that Nuget restore doesn't hit the cache when running CI builds
# See https://github.com/NuGet/Home/issues/3116
if ($ci) {
......@@ -18,3 +26,4 @@ if ($ci) {
# Always generate binary logs
$binaryLog = $true
$DoNotAbortNativeToolsInstallationOnFailure = $true
# Copy wpf binaries from local build to desired location. The location can either be the version number (for copying to shared installation)
# or the location of the project file if copying binaries to the output of a locally built application.
Param(
[string]$destination,
[string]$arch="x86",
[switch]$release,
[switch]$local,
[switch]$help
)
function Print-Usage()
{
Write-Host "Usage: copy-wpf.ps1 -destination <value> [-arch <value>] [-release] [-local]"
Write-Host " This script helps developers deploy wpf assemblies to the proper location for easy testing. See "
Write-Host " developer-guide.md for more information on how to use this script."
Write-Host ""
Write-Host "Common parameters:"
Write-Host " -destination <value> Location of .csproj or .vbproj of application to test against. Ignored"
Write-Host " if the -local parameter is used."
Write-Host " -arch <value> Architecture of binaries to copy. Can be either x64 or x86. Default is x86."
Write-Host " -release Copy release binaries. Default is to copy Debug binaries"
Write-Host " -local Copy binaries over the local dotnet installation in the .dotnet folder"
Write-Host " -help Print help and exit"
Write-Host ""
}
$RepoRoot = Resolve-Path (Join-Path $PSScriptRoot "..")
$Config = if ($release) { "Release" } else { "Debug" }
function CopyBinariesToLocation($location)
{
$locallyBuiltBinaryLocationBase = Join-Path $RepoRoot "artifacts\packaging"
CopyNativeBinariesToLocation $location $locallyBuiltBinaryLocationBase
CopyManagedBinariesToLocation $location $locallyBuiltBinaryLocationBase
}
function CopyNativeBinariesToLocation($location, $localBinLocation)
{
# Layout of where the native binaries looks something like this:
# x86 - artifacts\packaging\Debug\Microsoft.DotNet.Wpf.GitHub\lib\win-x86
# x64 - artifacts\packaging\Debug\x64\Microsoft.DotNet.Wpf.GitHub\lib\win-x64
$PackageName = "Microsoft.DotNet.Wpf.GitHub"
$BinaryLocationInPackage = "win-$arch"
CopyPackagedBinaries $location $localBinLocation $PackageName $BinaryLocationInPackage
}
function CopyManagedBinariesToLocation($location, $localBinLocation)
{
# Layout of where the managed binaries looks something like this:
# x86 - artifacts\packaging\Debug\Microsoft.DotNet.Wpf.GitHub\lib\netcoreapp3.0
# x64 - artifacts\packaging\Debug\x64\Microsoft.DotNet.Wpf.GitHub\lib\netcoreapp3.0
$PackageName = "Microsoft.DotNet.Wpf.GitHub"
$BinaryLocationInPackage = "netcoreapp3.0"
CopyPackagedBinaries $location $localBinLocation $PackageName $BinaryLocationInPackage
}
function CopyPackagedBinaries($location, $localBinLocation, $packageName, $binaryLocationInPackage)
{
$ArchFolder = if ($arch -eq "x86") { "" } else { "x64" }
$BinLocation = [System.IO.Path]::Combine($localBinLocation, $Config, $ArchFolder, $packageName, "lib", $binaryLocationInPackage, "*")
Copy-Item -path $BinLocation -include "*.dll","*.pdb" -Destination $location
}
if ($help -or ([string]::IsNullOrEmpty($destination) -and !$local))
{
Print-Usage
}
elseif($local)
{
$destination = Join-Path $RepoRoot ".dotnet"
Write-Host "Copying binaries to local installation"
$location = Resolve-Path (Join-Path $destination "shared\Microsoft.WindowsDesktop.App\*")
if(![System.IO.Directory]::Exists($location))
{
Write-Host "Location unavailable: " $location -ForegroundColor Red
return
}
CopyBinariesToLocation $location
}
else
{
$runtimeIdentifer = "win-$arch"
$location = [System.IO.Path]::Combine($destination, "bin\Debug\netcoreapp3.0", $runtimeIdentifer, "publish")
if(![System.IO.Directory]::Exists($location))
{
Write-Host "Location unavailable: " $location -ForegroundColor Red
return
}
Write-Host "Copying binaries to app published directory"
CopyBinariesToLocation $location
}
......@@ -2,4 +2,35 @@
# This file should be kept in sync across https://www.github.com/dotnet/wpf and dotnet-wpf-int repos.
#
function InitializeWpfCustomToolset() {
if (Test-Path variable:global:_WpfToolsetBuildProj) {
return $global:_WpfToolsetBuildProj
}
$nugetCache = GetNuGetPackageCachePath
$msbuild_sdks = $GlobalJson.'msbuild-sdks'
if ('Microsoft.DotNet.Arcade.Wpf.Sdk' -in $msbuild_sdks.PSobject.Properties.Name) {
$wpfToolsetVersion = $GlobalJson.'msbuild-sdks'.'Microsoft.DotNet.Arcade.Wpf.Sdk'
$wpfToolsetLocationFile = Join-Path $ToolsetDir "$wpfToolsetVersion.txt"
if (Test-Path $wpfToolsetLocationFile) {
$path = Get-Content $wpfToolsetLocationFile -TotalCount 1
if (Test-Path $path) {
return $global:_WpfToolsetBuildProj = $path
}
}
if (-not $restore) {
Write-Host "Wpf Toolset version $toolsetVersion has not been restored." -ForegroundColor Red
ExitWithExitCode 1
}
$proj = Join-Path $ToolsetDir "wpfRestore.proj"
$bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "WpfToolsetRestore.binlog") } else { "" }
'<Project Sdk="Microsoft.DotNet.Arcade.Wpf.Sdk"/>' | Set-Content $proj
MSBuild $proj $bl /t:__WriteToolsetLocation /clp:ErrorsOnly`;NoSummary /p:__ToolsetLocationOutputFile=$wpfToolsetLocationFile
$path = Get-Content $wpfToolsetLocationFile -TotalCount 1
if (!(Test-Path $path)) {
throw "Invalid toolset path: $path"
}
return $global:_WpfToolsetBuildProj = $path
}
}
InitializeWpfCustomToolset
. $PsScriptRoot\common\init-tools-native.ps1 -InstallDirectory $PSScriptRoot\..\.tools\native -GlobalJsonFile $PSScriptRoot\..\global.json
\ No newline at end of file
{
"tools": {
"dotnet": "3.0.100-preview4-011204",
"dotnet": "3.0.100-preview5-011568",
"runtimes": {
"dotnet": [
"2.1.7",
"$(MicrosoftNETCoreAppVersion)"
]
},
"vs": {
"version": "16.0"
"version": "16.1"
}
},
"sdk": {
"version": "3.0.100-preview4-011204"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19220.1"
"Microsoft.DotNet.Arcade.Sdk": "1.0.0-beta.19302.2"
},
"native-tools": {
"strawberry-perl": "5.28.1.1-1",
"msvcurt-c1xx": "0.0.0.4"
"strawberry-perl": "5.28.1.1-1"
}
}
......@@ -23,9 +23,18 @@
<ItemGroup>
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\Sdk\*" SubFolder="root\Sdk" />
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\*" SubFolder="root\tools" />
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\AvTrace\*" SubFolder="root\tools\AvTrace" />
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\CodeGen\*" SubFolder="root\tools\CodeGen" />
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\CodeGen\AvTrace\*" SubFolder="root\tools\CodeGen\AvTrace" />
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\WppConfig\*" SubFolder="root\tools\WppConfig" />
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\WppConfig\rev1\*" SubFolder="root\tools\WppConfig\rev1" />
<PackagingContent Include="$(RepoRoot)eng\WpfArcadeSdk\tools\CodeAnalysis\*" SubFolder="root\tools\CodeAnalysis" />
</ItemGroup>
<!--
Pack $(WpfSharedDir) and $(WpfCommonDir) sources for use by dotnet-wpf-int
-->
<ItemGroup>
<PackagingContent Include="$(WpfSharedDir)**\*" SubFolder="root\Src\Shared\%(RecursiveDir)" />
<PackagingContent Include="$(WpfCommonDir)**\*" SubFolder="root\Src\Common\%(RecursiveDir)" />
</ItemGroup>
</Project>
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册