Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@
<PrivateAssets>All</PrivateAssets>
</PackageReference>

<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.6.0" Condition=" '$(IsPackage)' != 'true' ">
<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-beta0012" Condition=" '$(MSBuildRuntimeType)' != 'Core' AND Exists('$(MSBuildThisFileDirectory)\.git') ">
<PackageReference Include="GitVersionTask" Version="4.0.0" Condition=" '$(MSBuildRuntimeType)' != 'Core' AND Exists('$(MSBuildThisFileDirectory)\.git') ">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
</ItemGroup>
Expand Down
3 changes: 2 additions & 1 deletion GitVersion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ branches:
regex: master
tag: alpha
prevent-increment-of-merged-branch-version: true
dev:
develop:
regex: dev(elop)?(ment)?$
tag: unstable
source-branches: ['master']
pull-request:
regex: (pull|pull\-requests|pr)[/-]
mode: ContinuousDelivery
Expand Down
1 change: 0 additions & 1 deletion PortabilityTools.VisualStudio.Imports.targets
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
-->
<Target Name="AddToVsixSources" AfterTargets="GetVsixSourceItems">
<ItemGroup>
<VSIXSourceItem Include="$(OutputPath)\ApiPort.VisualStudio.2017.dll" />
<VSIXSourceItem Include="$(OutputPath)\ApiPort.VisualStudio.Common.dll" />
<VSIXSourceItem Include="$(OutputPath)\ApiPort.VisualStudio.dll" />
<VSIXSourceItem Include="$(OutputPath)\Autofac.dll" />
Expand Down
929 changes: 9 additions & 920 deletions PortabilityTools.sln

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Download and build for yourself:
* 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.
```
alias apiport="dotnet {dotnet-apiport-folder}/bin/Debug/ApiPort/netcoreapp2.0/ApiPort.dll"
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`

Expand Down
154 changes: 80 additions & 74 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,122 +8,128 @@ export NUGET_HTTP_CACHE_PATH=~/.local/share/NuGet/v3-cache

Configuration=Debug

RootDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
RootDir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
DotNetSDKPath=$RootDir"/.tools/dotnet/"$DotNetSDKVersion
DotNetExe=$DotNetSDKPath"/dotnet"

TestResults=$RootDir"/TestResults"

usage() { echo "Usage: build.sh [-c|--configuration <Debug|Release>]"; }
usage() {
echo "Usage: build.sh [-c|--configuration <Debug|Release>] [--downloadCatalog]"
}

prebuild() {
$DotNetExe restore
downloadCatalog() {
local isForce=$1
local catalog=$RootDir"/.data/catalog.bin"
local data=$(dirname $catalog)

local catalog=$RootDir"/.data/catalog.bin"
local data=$(dirname $catalog)
if [[ ! -e $data ]]; then
mkdir $data
fi

if [[ ! -e $data ]]; then
mkdir $data
fi
if [[ $isForce == "true" && -e $catalog ]]; then
echo "Deleting existing catalog"
rm $catalog
fi

if [[ ! -e $catalog ]]; then
echo "Downloading catalog.bin..."
curl --output $catalog "https://portability.blob.core.windows.net/catalog/catalog.bin"
fi
if [[ ! -e $catalog ]]; then
echo "Downloading catalog.bin..."
curl --output $catalog "https://portability.blob.core.windows.net/catalog/catalog.bin"
fi
}

installSDK() {
if [[ -e $DotNetExe ]]; then
echo $DotNetExe" exists. Skipping install..."
return 0
fi
if [[ -e $DotNetExe ]]; then
echo $DotNetExe" exists. Skipping install..."
return 0
fi

local DotNetToolsPath=$(dirname $DotNetSDKPath)
local DotNetToolsPath=$(dirname $DotNetSDKPath)

if [ ! -d $DotNetToolsPath ]; then
mkdir -p $DotNetToolsPath
fi
if [ ! -d $DotNetToolsPath ]; then
mkdir -p $DotNetToolsPath
fi

curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current --install-dir $DotNetSDKPath
curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel Current --install-dir $DotNetSDKPath
}

build() {
echo "Building ApiPort... Configuration: ["$Configuration"]"
echo "Building ApiPort... Configuration: ["$Configuration"]"

pushd src/ApiPort/ApiPort > /dev/null
$DotNetExe build ApiPort.csproj -f netcoreapp2.0 -c $Configuration
$DotNetExe build ApiPort.Offline.csproj -f netcoreapp2.0 -c $Configuration
popd > /dev/null
pushd src/ApiPort/ApiPort >/dev/null
$DotNetExe build ApiPort.csproj -f netcoreapp2.1 -c $Configuration
$DotNetExe build ApiPort.Offline.csproj -f netcoreapp2.1 -c $Configuration
popd >/dev/null
}

runTest() {
ls $1/*.csproj | while read file
do
if awk -F: '/<TargetFramework>netcoreapp[1-9]\.[0-9]<\/TargetFramework>/ { found = 1 } END { if (found == 1) { exit 0 } else { exit 1 } }' $file; then
echo "Testing "$file
$DotNetExe test $file -c $Configuration --logger trx
else
# Can remove this when: https://github.com/dotnet/sdk/issues/335 is resolved
echo "Skipping "$file
echo "--- Desktop .NET Framework testing is not currently supported on Unix."
fi
done

if [ ! -d $TestResults ]; then
mkdir $TestResults
fi

find $RootDir/tests/ -type f -name "*.trx" | while read line
do
mv $line $TestResults/
done
ls $1/*.csproj | while read file; do
if awk -F: '/<TargetFramework>netcoreapp[1-9]\.[0-9]<\/TargetFramework>/ { found = 1 } END { if (found == 1) { exit 0 } else { exit 1 } }' $file; then
echo "Testing "$file
$DotNetExe test $file -c $Configuration --logger trx
else
# Can remove this when: https://github.com/dotnet/sdk/issues/335 is resolved
echo "Skipping "$file
echo "--- Desktop .NET Framework testing is not currently supported on Unix."
fi
done

if [ ! -d $TestResults ]; then
mkdir $TestResults
fi

find $RootDir/tests/ -type f -name "*.trx" | while read line; do
mv $line $TestResults/
done
}

while [[ $# -gt 0 ]]
do
option="$(echo $1 | awk '{print tolower($0)}')"
case "$option" in
"-?" | "--help" )
usage
exit 1
;;
"-c" | "--configuration")
Configuration="$2"
shift 2
;;
*)
echo "Unknown option: "$option
usage
exit 1
;;
esac
while [[ $# -gt 0 ]]; do
option="$(echo $1 | awk '{print tolower($0)}')"
case "$option" in
"-?" | "--help")
usage
exit 1
;;
"-c" | "--configuration")
Configuration="$2"
shift 2
;;
"--downloadcatalog")
downloadCatalog "true"
exit 0
;;
*)
echo "Unknown option: "$option
usage
exit 1
;;
esac
done

# Enable insensitive case-matching
shopt -s nocasematch

if [[ "$Configuration" != "Debug" && "$Configuration" != "Release" ]]; then
echo "ERROR: Supported configuration types are Debug or Release. Invalid configuration: "$Configuration
usage
exit 3
echo "ERROR: Supported configuration types are Debug or Release. Invalid configuration: "$Configuration
usage
exit 3
fi

shopt -u nocasematch

installSDK

if [[ ! -e $DotNetExe ]]; then
echo "ERROR: It should have been installed from build/dotnet-install.sh"
exit 2
echo "ERROR: It should have been installed from build/dotnet-install.sh"
exit 2
fi

prebuild
downloadCatalog

build

find tests/ -type d -name "*\.Tests" | while read file
do
runTest $file
find tests/ -type d -name "*\.Tests" | while read file; do
runTest $file
done

echo "Finished!"
54 changes: 0 additions & 54 deletions netci.groovy

This file was deleted.

1 change: 1 addition & 0 deletions rules.ruleset
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<Rule Id="CA2007" Action="None" />
<Rule Id="CA2211" Action="None" />
<Rule Id="CA2227" Action="None" />
<Rule Id="CA2237" Action="None" />
</Rules>
<Rules AnalyzerId="Microsoft.CodeQuality.CSharp.Analyzers" RuleNamespace="Microsoft.CodeQuality.CSharp.Analyzers">
<Rule Id="CA1032" Action="None" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

<PropertyGroup>
<TargetFramework>net46</TargetFramework>
<RootNamespace>ApiPortVS.VS2017</RootNamespace>
<RootNamespace>ApiPortVS</RootNamespace>
<DefineConstants>$(DefineConstants);VS2017</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Autofac" Version="4.6.2" />
<PackageReference Include="Microsoft.VisualStudio.ComponentModelHost" Version="15.4.27004">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,24 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Composition;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;

using static Microsoft.Fx.Portability.Utils.FormattableStringHelper;

namespace ApiPortVS.VS2017
namespace ApiPortVS
{
public class ProjectBuilder2017 : DefaultProjectBuilder
[Export(typeof(IProjectBuilder))]
public class ProjectBuilder : DefaultProjectBuilder
{
public ProjectBuilder2017(
IVsSolutionBuildManager2 buildManager,
IProjectMapper projectMapper)
: base(buildManager, projectMapper)
{ }
[ImportingConstructor]
public ProjectBuilder(IBuildServices buildServices, IProjectMapper projectMapper)
: base(buildServices.BuildManager, projectMapper)
{
}

/// <summary>
/// Tries to fetch output items if it uses Common Project System then
Expand Down
30 changes: 0 additions & 30 deletions src/ApiPort/ApiPort.VisualStudio.2017/ServiceProvider2017.cs

This file was deleted.

Loading