Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Merge pull request #875 from microsoft/dev
Browse files Browse the repository at this point in the history
Integration from Dev to master with some bug fixes and a bunch of infrastructure work
  • Loading branch information
Lxiamail authored Apr 29, 2020
2 parents 0461749 + 3943c47 commit 4718660
Show file tree
Hide file tree
Showing 36 changed files with 822 additions and 330 deletions.
39 changes: 39 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Contributing

This project has adopted the [Microsoft Open Source Code of
Conduct](https://opensource.microsoft.com/codeofconduct/).
For more information see the [Code of Conduct
FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or
contact [[email protected]](mailto:[email protected])
with any additional questions or comments.

For our general contributing guidelines please see [our dotnet/runtime contributing guide](https://github.com/dotnet/runtime/blob/master/CONTRIBUTING.md).

## Best practices

* Use Windows PowerShell or [PowerShell Core][pwsh] (including on Linux/OSX) to run .ps1 scripts.
Some scripts set environment variables to help you, but they are only retained if you use PowerShell as your shell.

## Prerequisites

All dependencies can be installed by running the `init.ps1` script at the root of the repository
using Windows PowerShell or [PowerShell Core][pwsh] (on any OS).

The only prerequisite for building, testing, and deploying from this repository
is the [.NET SDK](https://get.dot.net/).
You should install the version specified in `global.json` or a later version within
the same major.minor.Bxx "hundreds" band.
For example if 2.2.300 is specified, you may install 2.2.300, 2.2.301, or 2.2.310
while the 2.2.400 version would not be considered compatible by .NET SDK.
See [.NET Core Versioning](https://docs.microsoft.com/en-us/dotnet/core/versions/) for more information.

The development experience is best with [Visual Studio][VisualStudio].

## Building

This repository can be built on Windows, Linux, and OSX.

Building, testing, and packing this repository can be done by using the standard dotnet CLI commands (e.g. `dotnet build`, `dotnet test`, `dotnet pack`, etc.).

[pwsh]: https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell?view=powershell-6
[VisualStudio]: https://docs.microsoft.com/dotnet/core/install/sdk?pivots=os-windows#install-with-visual-studio
8 changes: 7 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<RawBinariesDropDirectory Condition=" '$(RawBinariesDropDirectory)' == '' ">$(OutputDrop)\raw\binaries</RawBinariesDropDirectory>
<RawSymbolsDropDirectory Condition=" '$(RawSymbolsDropDirectory)' == '' ">$(OutputDrop)\raw\symbols</RawSymbolsDropDirectory>
<OutputPath>$(OutputDrop)\$(MSBuildProjectName)\</OutputPath>
<DocumentationFile>$(OutputPath)$(MSBuildProjectName).xml</DocumentationFile>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<BaseIntermediateOutputPath>$(OutputFullPath)obj\$(MSBuildProjectName)\</BaseIntermediateOutputPath>
</PropertyGroup>

Expand Down Expand Up @@ -57,6 +57,12 @@
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)\LICENSE.txt" Pack="true" PackagePath=""/>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Nerdbank.GitVersioning">
<Version>3.0.28</Version>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<!-- Some of the project types do not have a pack target. This creates a default empty pack target that will be overridden in supported project types -->
<Target Name="Pack">
Expand Down
12 changes: 0 additions & 12 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,9 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>

<!-- Enforcing the same compiler toolset to be used on desktop builds.
https://github.com/dotnet/roslyn-analyzers/issues/1533#issuecomment-358733030 -->
<PackageReference Include="Microsoft.Net.Compilers" Version="2.10.0" Condition="'$(OS)' == 'Windows_NT'">
<PrivateAssets>All</PrivateAssets>
</PackageReference>

<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.2" Condition=" '$(IsPackage)' != 'true' ">
<PrivateAssets>All</PrivateAssets>
</PackageReference>

<!-- GitVersionTask is not compiled against .NET Core, so importing the targets will
result in a failure because it will try to resolve Microsoft.Build.Utilities v4.0 -->
<PackageReference Include="GitVersionTask" Version="4.0.0" Condition=" '$(MSBuildRuntimeType)' != 'Core' AND Exists('$(MSBuildThisFileDirectory)\.git') ">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>

<!-- Work around an issue where portable PDB is not supported yet in Api scan tool.
Expand Down
19 changes: 0 additions & 19 deletions GitVersion.yml

This file was deleted.

3 changes: 1 addition & 2 deletions NuGet.config
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- Don't use any sources set by the system (workaround for microbuild issue) -->
<clear />
<add key="nuget" value="https://www.nuget.org/api/v2/" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="corefx lab" value="https://dotnet.myget.org/F/dotnet-corefxlab/api/v3/index.json" />
</packageSources>
</configuration>
9 changes: 4 additions & 5 deletions PortabilityTools.sln
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.28307.168
# Visual Studio Version 16
VisualStudioVersion = 16.0.29926.136
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C991F5FC-04B5-420C-98A0-80974AA946F7}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
azure-pipelines.yml = azure-pipelines.yml
build.cmd = build.cmd
build.ps1 = build.ps1
build.sh = build.sh
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
GitVersion.yml = GitVersion.yml
global.json = global.json
init.ps1 = init.ps1
LICENSE = LICENSE
netci.groovy = netci.groovy
NuGet.config = NuGet.config
PortabilityTools.VisualStudio.Imports.targets = PortabilityTools.VisualStudio.Imports.targets
README.md = README.md
rules.ruleset = rules.ruleset
stylecop.json = stylecop.json
version.json = version.json
EndProjectSection
ProjectSection(FolderGlobals) = preProject
global_1json__JSONSchema = http://json.schemastore.org/global
Expand Down
46 changes: 21 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,46 @@
This repository contains the source code for .NET Portability Analyzer tools and
dependencies.

|Branch|Build Status|
|---|---|
|master|[![][BuildStatus-Master]][myget]|
|dev|[![][BuildStatus-Dev]][myget]|
|Branch|Build Status
|---|---
|master|[![Build Status](https://devdiv.visualstudio.com/DevDiv/_apis/build/status/CoreFxTools/dotnet-apiport-yaml?branchName=master)](https://devdiv.visualstudio.com/DevDiv/_build/latest?definitionId=12912&branchName=master)
|dev|[![Build Status](https://devdiv.visualstudio.com/DevDiv/_apis/build/status/CoreFxTools/dotnet-apiport-yaml?branchName=dev)](https://devdiv.visualstudio.com/DevDiv/_build/latest?definitionId=12912&branchName=dev)

For a quick introduction, check out [this video on Channel 9][Channel 9 Video]:

[<img src="https://sec.ch9.ms/ch9/031c/f3d7672b-dd71-4a18-a8b4-37573c08031c/DotNetPortabilityAnalyzer_960.jpg" width="480" />][Channel 9 Video]

## Using this Repository
There is a Visual Studio extension available for VS 2017 and VS 2019: [.NET Portability Analyzer](https://marketplace.visualstudio.com/items?itemName=ConnieYau.NETPortabilityAnalyzer)

### Windows
There is a Visual Studio extension available for VS2017: [.NET Portability Analyzer](https://marketplace.visualstudio.com/items?itemName=ConnieYau.NETPortabilityAnalyzer)
## Using this Repository

Download and build for yourself:
1. Install [Visual Studio 2017 with .NET Core Workload][Visual Studio 2017]
2. Building:
* Visual Studio: `PortabilityTools.sln`
* Powershell: `.\build.ps1 -Configuration Debug -Platform AnyCPU`
See our [contributing guide](CONTRIBUTING.md) for instructions to
build and run from the source code in this repo.

### Linux/Mac
Sample usage to run the analysis from the command line:

1. Install [.NET Core SDK](https://www.microsoft.com/net/core)
2. Execute: `build.sh`
3. Go to: `bin/Debug/ApiPort/netcoreapp2.1`
4. Run ApiPort by executing: `dotnet ApiPort.dll`
* Example: `dotnet ApiPort.dll listTargets`
* Example: `dotnet ApiPort.dll analyze -f Foo.dll -r HTML`
5. For convenience, create an alias command adding the following to your `~/.bash_profile`. Replace `{dotnet-apiport-folder}` with the path where you cloned the repo.
```ps1
./init.ps1
dotnet build src/ApiPort/ApiPort/ApiPort.csproj
dotnet bin/Debug/ApiPort/netcoreapp2.1/ApiPort.dll -- listTargets
dotnet bin/Debug/ApiPort/netcoreapp2.1/ApiPort.dll -- analyze -f Foo.dll -r HTML
```

If using bash for your shell, for convenience you may create an alias command adding the following to your `~/.bash_profile`. Replace `{dotnet-apiport-folder}` with the path where you cloned the repo.

```bash
alias apiport="dotnet {dotnet-apiport-folder}/bin/Debug/ApiPort/netcoreapp2.1/ApiPort.dll"
```
This will alow you to use apiport globally from the command line: `apiport analyze -f Foo.dll -r HTML`

This will allow you to use apiport globally from the command line: `apiport analyze -f Foo.dll -r HTML`

## Documentation

* [Introduction](docs/HowTo)
* [Platform Portability](docs/HowTo/PlatformPortability.md)
* [Breaking Changes](docs/HowTo/BreakingChanges.md)
* [.NET Portability Analyzer (Console application)](docs/Console)
* [.NET Core application](docs/Console/README.md#using-net-core-application)
* [.NET Core application](docs/Console/README.md#using-net-core-application)
* [.NET Portability Analyzer (Visual Studio extension)](docs/VSExtension)

## Projects
Expand Down Expand Up @@ -93,8 +92,6 @@ For an overview of all the .NET related projects, have a look at the

This project is licensed under the [MIT license](LICENSE).

[BuildStatus-Master]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/484/badge
[BuildStatus-Dev]: https://devdiv.visualstudio.com/_apis/public/build/definitions/0bdbc590-a062-4c3f-b0f6-9383f67865ee/7913/badge
[Channel 9 Video]: https://channel9.msdn.com/Blogs/Seth-Juarez/A-Brief-Look-at-the-NET-Portability-Analyzer
[Contributing Guide]: https://github.com/dotnet/corefx/wiki/Contributing
[Developer Guide]: https://github.com/dotnet/corefx/wiki/Developer-Guide
Expand All @@ -105,5 +102,4 @@ This project is licensed under the [MIT license](LICENSE).
[PR-Open]: https://github.com/Microsoft/dotnet-apiport/pulls?q=is%3Aopen+is%3Apr
[myget]: https://dotnet.myget.org/gallery/dotnet-apiport
[System.Reflection.Metadata]: https://github.com/dotnet/corefx/tree/master/src/System.Reflection.Metadata
[Visual Studio 2017]: https://www.microsoft.com/net/core#windowsvs2017
[VSIX Gallery]: http://vsixgallery.com/extension/55d15546-28ca-40dc-af23-dfa503e9c5fe
Loading

0 comments on commit 4718660

Please sign in to comment.