* tools and version update

* update pipeline

* Upgraded to .NET 5.0

* Fixed serialization and tests

Co-authored-by: clemensv <clemensv@microsoft.com>
This commit is contained in:
Vlad Kolesnikov 2021-04-26 10:51:50 -07:00 коммит произвёл GitHub
Родитель 56b7f3b047
Коммит b0f2f79759
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
39 изменённых файлов: 446 добавлений и 94 удалений

Просмотреть файл

@ -1,7 +1,7 @@
<Project>
<PropertyGroup>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">$(MicrosoftNETCoreApp30PackageVersion)</RuntimeFrameworkVersion>
<NETStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netcoreapp3.0' ">$(NETStandardLibrary21PackageVersion)</NETStandardImplicitPackageVersion>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp5.0' ">$(MicrosoftNETCoreAppPackageVersion)</RuntimeFrameworkVersion>
<NETStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netcoreapp5.0' ">$(NETStandardLibrary21PackageVersion)</NETStandardImplicitPackageVersion>
<!-- aspnet/BuildTools#662 Don't police what version of NetCoreApp we use -->
<NETCoreAppMaximumVersion>99.9</NETCoreAppMaximumVersion>
</PropertyGroup>
@ -9,3 +9,4 @@
<CallTarget Targets="VSTest" Condition="'$(IsTestProject)' == 'true'" />
</Target>
</Project>

Просмотреть файл

@ -1,10 +1,10 @@
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 as publish
FROM mcr.microsoft.com/dotnet/core/sdk:5.0 as publish
COPY . /azure-relay-bridge/
WORKDIR /azure-relay-bridge/src/azbridge
RUN dotnet publish azbridge.csproj -c Release -f netcoreapp3.0 -p:SelfContained=false -p:PublishTrimmed=false -o /app
RUN dotnet publish azbridge.csproj -c Release -f netcoreapp5.0 -p:SelfContained=false -r ubuntu-x64 -p:PublishTrimmed=false -o /app
FROM mcr.microsoft.com/dotnet/core/runtime:3.0
FROM mcr.microsoft.com/dotnet/core/runtime:5.0
RUN apt-get update
WORKDIR /app
COPY --from=publish /app .

Просмотреть файл

@ -5,7 +5,7 @@
"azbridge": {
"Exclusions": {
"DOC_MISSING": {
"lib/netcoreapp3.0/azbridge.dll": "no public API"
"lib/netcoreapp5.0/azbridge.dll": "no public API"
}
}
}

Просмотреть файл

@ -176,9 +176,9 @@ The package install will put the tool into `/usr/share/azbridge`.
### Other distributions and platforms
You can also install the tool from respective platform *.tar.gz archive. For Linux,
you need to [explicitly install Linux prerequisites for .NET Core](https://docs.microsoft.com/en-us/dotnet/core/linux-prerequisites?tabs=netcore2x)
you need to [explicitly install Linux prerequisites for .NET 5.0](https://docs.microsoft.com/en-us/dotnet/core/install/linux)
for your respective distribution. For macOS, you need to [install prerequisites from
this list](https://docs.microsoft.com/en-us/dotnet/core/macos-prerequisites?tabs=netcore2x).
this list](https://docs.microsoft.com/en-us/dotnet/core/install/macos).
## Building the code
@ -189,12 +189,12 @@ the full .NET Framework and the installer can only be built on Windows. You will
need the "Build Tools for Visual Studio 2017", and ideally a local install of
Visual Studio 2017 with desktop C# support.
All other versions are built with the .NET Core 3.0 SDK. The DEB and
All other versions are built with the .NET 5.0 SDK. The DEB and
RPM packages are only created when building on a Unix (i.e. Linux or macOS) host.
dotb
The ideal build environment is a Windows 10/Windows Server 2016 host with Docker for
Windows installed. The `package-all.cmd` script will first build and package all Windows
targets, and then launch a docker-based build with the official Microsoft .NET Core 3.0
targets, and then launch a docker-based build with the official Microsoft .NET Core 5.0
SDK image for the remaining targets. The `package.sh` script will only build and package
the Unix targets, the `package.cmd` script only Windows targets.

Просмотреть файл

@ -3,11 +3,12 @@
trigger:
- master
pr:
- master
variables:
BuildVersion.MajorMinor: 0.3
BuildVersion.MajorMinor: 0.4
BuildVersion.Revision: $[counter(variables['Version.MajorMinor'], 0)]
BuildVersion: $(BuildVersion.MajorMinor).$(BuildVersion.Revision)
@ -32,7 +33,7 @@ jobs:
command: 'test'
arguments: '/p:WindowsOnly=true'
- publish: $(System.DefaultWorkingDirectory)\artifacts\build\net462
- publish: $(System.DefaultWorkingDirectory)\artifacts\build\net48
artifact: WindowsBuild
- job: LinuxBuild
@ -50,7 +51,7 @@ jobs:
- task: DotNetCoreCLI@2
inputs:
command: 'test'
arguments: '/p:RuntimeIdentifier=ubuntu-x64 /p:Configuration=Debug'
arguments: '/p:RuntimeIdentifier=ubuntu-x64 /p:Configuration=Debug /p:TargetFramework=netcoreapp5.0'
- publish: $(System.DefaultWorkingDirectory)/artifacts/build/netcoreapp3.0
- publish: $(System.DefaultWorkingDirectory)/artifacts/build/netcoreapp5.0
artifact: XBuild

Просмотреть файл

@ -3,38 +3,35 @@
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Label="Package Versions">
<PackagingTargetsPackageVersion>0.1.129</PackagingTargetsPackageVersion>
<PackagingTargetsPackageVersion>0.1.189</PackagingTargetsPackageVersion>
<WixPackageVersion>3.11.2</WixPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.1</MicrosoftExtensionsLoggingConsolePackageVersion>
<MicrosoftDiagnosticsTracingEventSourcePackageVersion>1.1.28</MicrosoftDiagnosticsTracingEventSourcePackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.48</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<MicrosoftNETCoreApp30PackageVersion>3.0.0</MicrosoftNETCoreApp30PackageVersion>
<MicrosoftNetHttpHeadersPackageVersion>3.0.0</MicrosoftNetHttpHeadersPackageVersion>
<MicrosoftNETTestSdkPackageVersion>16.4.0</MicrosoftNETTestSdkPackageVersion>
<MicrosoftDiagnosticsTracingTraceEventPackageVersion>2.0.66</MicrosoftDiagnosticsTracingTraceEventPackageVersion>
<MicrosoftNETCoreAppPackageVersion>5.0.0</MicrosoftNETCoreAppPackageVersion>
<MicrosoftNetHttpHeadersPackageVersion>2.2.8</MicrosoftNetHttpHeadersPackageVersion>
<MicrosoftNETTestSdkPackageVersion>16.9.4</MicrosoftNETTestSdkPackageVersion>
<NETStandardLibrary21PackageVersion>2.1.0</NETStandardLibrary21PackageVersion>
<SystemNetHttpWinHttpHandlerPackageVersion>4.6.0</SystemNetHttpWinHttpHandlerPackageVersion>
<SystemNetNetworkInformationPackageVersion>4.3.0</SystemNetNetworkInformationPackageVersion>
<SystemThreadingTasksDataflowPackageVersion>4.8.0</SystemThreadingTasksDataflowPackageVersion>
<SystemThreadingTasksDataflowPackageVersion>5.0.0</SystemThreadingTasksDataflowPackageVersion>
<SystemConsolePackageVersion>4.3.1</SystemConsolePackageVersion>
<SystemIOPackageVersion>4.3.0</SystemIOPackageVersion>
<SystemConfigurationPackageVersion>4.3.0</SystemConfigurationPackageVersion>
<SystemMemoryPackageVersion>4.5.3</SystemMemoryPackageVersion>
<SystemMemoryPackageVersion>4.5.4</SystemMemoryPackageVersion>
<SystemDiagnosticsTracingPackageVersion>4.3.0</SystemDiagnosticsTracingPackageVersion>
<SystemDiagnosticsDiagnosticSourcePackageVersion>4.6.0</SystemDiagnosticsDiagnosticSourcePackageVersion>
<SystemNetHttpPackageVersion>4.3.4</SystemNetHttpPackageVersion>
<SystemNetNameResolutionPackageVersion>4.3.0</SystemNetNameResolutionPackageVersion>
<YamlDotNetSignedPackageVersion>6.0.0</YamlDotNetSignedPackageVersion>
<YamlDotNetPackageVersion>11.1.0</YamlDotNetPackageVersion>
<MicrosoftExtensionsLoggingPackageVersion>3.0.0</MicrosoftExtensionsLoggingPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>3.0.0</MicrosoftExtensionsLoggingConsolePackageVersion>
<XunitPackageVersion>2.4.1</XunitPackageVersion>
<NuGetVersioningVersion>5.3.1</NuGetVersioningVersion>
<DotnetXunitPackageVersion>2.4.1</DotnetXunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.1</XunitRunnerVisualStudioPackageVersion>
<XunitRunnerMsBuildPackageVersion>2.4.0</XunitRunnerMsBuildPackageVersion>
<NewtonsoftJsonPackageVersion>12.0.3</NewtonsoftJsonPackageVersion>
<MicrosoftAzureRelayPackageVersion>2.0.1</MicrosoftAzureRelayPackageVersion>
<McMasterExtensionsCommandLineUtilsPackageVersion>2.4.4</McMasterExtensionsCommandLineUtilsPackageVersion>
<SerilogExtensionsLoggingFilePackageVersion>1.1.0</SerilogExtensionsLoggingFilePackageVersion>
<NuGetVersioningVersion>5.9.0</NuGetVersioningVersion>
<DotnetXunitPackageVersion>2.3.1</DotnetXunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.3</XunitRunnerVisualStudioPackageVersion>
<XunitRunnerMsBuildPackageVersion>2.4.1</XunitRunnerMsBuildPackageVersion>
<NewtonsoftJsonPackageVersion>13.0.1</NewtonsoftJsonPackageVersion>
<MicrosoftAzureRelayPackageVersion>2.0.15596</MicrosoftAzureRelayPackageVersion>
<McMasterExtensionsCommandLineUtilsPackageVersion>3.1.0</McMasterExtensionsCommandLineUtilsPackageVersion>
<SerilogExtensionsLoggingFilePackageVersion>2.0.0</SerilogExtensionsLoggingFilePackageVersion>
</PropertyGroup>
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />
</Project>

Просмотреть файл

@ -2,15 +2,15 @@
<PropertyGroup>
<WindowsOnly>false</WindowsOnly>
<WindowsFrameworks Condition="'$(OS)'=='Windows_NT'">net462;</WindowsFrameworks>
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp3.0</CoreFrameworks>
<WindowsFrameworks Condition="'$(OS)'=='Windows_NT'">net48;</WindowsFrameworks>
<CoreFrameworks Condition="'$(WindowsOnly)'!='true'">netcoreapp5.0</CoreFrameworks>
<TargetFrameworks>$(WindowsFrameworks)$(CoreFrameworks)</TargetFrameworks>
<WindowsRuntimeIdentifiers Condition="'$(OS)'=='Windows_NT'">win7-x64;win7-x86;win10-x64;win10-x86;</WindowsRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.9-x64;debian.10-x64;ubuntu.18.04-x64;opensuse.15.0-x64;fedora.30-x64</UnixRuntimeIdentifiers>
<UnixRuntimeIdentifiers Condition="'$(WindowsOnly)'=='false'">osx-x64;debian.9-x64;debian.10-x64;ubuntu.18.04-x64;ubuntu.18.04-arm64;ubuntu.20.04-x64;ubuntu.20.04-arm64;opensuse.15.0-x64;fedora.30-x64</UnixRuntimeIdentifiers>
<RuntimeIdentifiers>$(WindowsRuntimeIdentifiers)$(UnixRuntimeIdentifiers)</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp30PackageVersion)" />
<DotNetCoreRuntime Include="$(MicrosoftNETCoreAppPackageVersion)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,22 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

Просмотреть файл

@ -0,0 +1,21 @@
apiVersion: v2
name: foodportal2
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
version: 0.1.0
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application.
appVersion: 1.16.0

Просмотреть файл

@ -0,0 +1,21 @@
1. Get the application URL by running these commands:
{{- if .Values.ingress.enabled }}
{{- range $host := .Values.ingress.hosts }}
{{- range .paths }}
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ . }}
{{- end }}
{{- end }}
{{- else if contains "NodePort" .Values.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "foodportal2.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "foodportal2.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "foodportal2.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
echo http://$SERVICE_IP:{{ .Values.service.port }}
{{- else if contains "ClusterIP" .Values.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "foodportal2.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
echo "Visit http://127.0.0.1:8080 to use your application"
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:80
{{- end }}

Просмотреть файл

@ -0,0 +1,63 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "foodportal2.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "foodportal2.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "foodportal2.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Common labels
*/}}
{{- define "foodportal2.labels" -}}
helm.sh/chart: {{ include "foodportal2.chart" . }}
{{ include "foodportal2.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{/*
Selector labels
*/}}
{{- define "foodportal2.selectorLabels" -}}
app.kubernetes.io/name: {{ include "foodportal2.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "foodportal2.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "foodportal2.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}

Просмотреть файл

@ -0,0 +1,55 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "foodportal2.fullname" . }}
labels:
{{- include "foodportal2.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
selector:
matchLabels:
{{- include "foodportal2.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "foodportal2.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "foodportal2.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 80
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}

Просмотреть файл

@ -0,0 +1,41 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "foodportal2.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
apiVersion: networking.k8s.io/v1beta1
{{- else -}}
apiVersion: extensions/v1beta1
{{- end }}
kind: Ingress
metadata:
name: {{ $fullName }}
labels:
{{- include "foodportal2.labels" . | nindent 4 }}
{{- with .Values.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.ingress.tls }}
tls:
{{- range .Values.ingress.tls }}
- hosts:
{{- range .hosts }}
- {{ . | quote }}
{{- end }}
secretName: {{ .secretName }}
{{- end }}
{{- end }}
rules:
{{- range .Values.ingress.hosts }}
- host: {{ .host | quote }}
http:
paths:
{{- range .paths }}
- path: {{ . }}
backend:
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
{{- end }}
{{- end }}
{{- end }}

Просмотреть файл

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "foodportal2.fullname" . }}
labels:
{{- include "foodportal2.labels" . | nindent 4 }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.service.port }}
targetPort: http
protocol: TCP
name: http
selector:
{{- include "foodportal2.selectorLabels" . | nindent 4 }}

Просмотреть файл

@ -0,0 +1,8 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "foodportal2.serviceAccountName" . }}
labels:
{{ include "foodportal2.labels" . | nindent 4 }}
{{- end -}}

Просмотреть файл

@ -0,0 +1,15 @@
apiVersion: v1
kind: Pod
metadata:
name: "{{ include "foodportal2.fullname" . }}-test-connection"
labels:
{{ include "foodportal2.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test-success
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['{{ include "foodportal2.fullname" . }}:{{ .Values.service.port }}']
restartPolicy: Never

Просмотреть файл

@ -0,0 +1,66 @@
# Default values for foodportal2.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
replicaCount: 1
image:
repository: nginx
pullPolicy: IfNotPresent
imagePullSecrets: []
nameOverride: ""
fullnameOverride: ""
serviceAccount:
# Specifies whether a service account should be created
create: true
# The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
podSecurityContext: {}
# fsGroup: 2000
securityContext: {}
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
service:
type: ClusterIP
port: 80
ingress:
enabled: false
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: "true"
hosts:
- host: chart-example.local
paths: []
tls: []
# - secretName: chart-example-tls
# hosts:
# - chart-example.local
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
# requests:
# cpu: 100m
# memory: 128Mi
nodeSelector: {}
tolerations: []
affinity: {}

Просмотреть файл

@ -6,21 +6,30 @@ if not errorlevel 0 (
SET _DOCKER_BUILD="false"
)
echo *** Sanity check Windows
dotnet restore
dotnet test %*
dotnet msbuild /t:restore /p:WindowsOnly=true
dotnet test -f net48 %*
if not errorlevel 0 exit /b 1
echo *** Building and packaging Windows Targets
if %_DOCKER_BUILD% == "true" (
echo *** Windows only
msbuild /t:clean,restore,package /p:WindowsOnly=true;Configuration=Release %*
dotnet msbuild /t:clean,restore,package /p:WindowsOnly=true;Configuration=Release;RuntimeIdentifier=win10-x64 %*
) else (
echo *** All platforms
msbuild /t:clean,restore,package /p:WindowsOnly=false;Configuration=Release %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=true /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=win10-x64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=osx-x64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=debian.9-x64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=debian.10-x64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.18.04-x64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.18.04-arm64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.20.04-x64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.20.04-arm64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=opensuse.15.0-x64 %*
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=fedora.30-x64 %*
)
if not errorlevel 0 exit /b 1
if %_DOCKER_BUILD% == "true" (
echo *** Building and packaging Unix/Linux Targets
docker run --rm -v %cd%:/build mcr.microsoft.com/dotnet/core/sdk:3.0-buster /build/package.sh /p:TargetFramework=netcoreapp3.0 %*
docker run --rm -v %cd%:/build mcr.microsoft.com/dotnet/core/sdk:5.0 /build/package.sh %*
)

Просмотреть файл

@ -3,5 +3,14 @@ pushd "${0%/*}" > /dev/null
if [ ! -z $APPVEYOR_BUILD_VERSION ]; then _VersionProp="/p:VersionPrefix=$APPVEYOR_BUILD_VERSION"; fi
if [ ! -z $BUILDVERSION ]; then _VersionProp="/p:VersionPrefix=$BUILDVERSION"; fi
dotnet restore
dotnet msbuild /t:Package /p:Configuration=Release /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=osx-x64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=debian.9-x64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=debian.10-x64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.18.04-x64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.18.04-arm64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.20.04-x64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=ubuntu.20.04-arm64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=opensuse.15.0-x64 $_BuildProp $_VersionProp $@
dotnet msbuild /t:Package /p:Configuration=Release /p:WindowsOnly=false /p:TargetFramework=netcoreapp5.0 /p:RuntimeIdentifier=fedora.30-x64 $_BuildProp $_VersionProp $@
popd

Просмотреть файл

@ -14,7 +14,7 @@ namespace Microsoft.Azure.Relay.Bridge.Configuration
public class CommandLineSettings
{
#if NET462
#if NET48
[Option(CommandOptionType.NoValue, LongName = "svcinstall", ShortName = "I", Description = "Install as Windows Service")]
public bool? ServiceInstall { get; set; }
[Option(CommandOptionType.NoValue, LongName = "svcuninstall", ShortName = "U", Description = "Uninstall Windows Service")]
@ -56,7 +56,7 @@ namespace Microsoft.Azure.Relay.Bridge.Configuration
public static void Run(string[] args, Func<CommandLineSettings, int> callback)
{
CommandLineApplication<CommandLineSettings> app = new CommandLineApplication<CommandLineSettings>(throwOnUnexpectedArg: true);
CommandLineApplication<CommandLineSettings> app = new CommandLineApplication<CommandLineSettings>();
app.ModelFactory = () => new CommandLineSettings();
app.Conventions.UseDefaultConventions().SetAppNameFromEntryAssembly();
app.Parse(args);

Просмотреть файл

@ -1018,12 +1018,13 @@ namespace Microsoft.Azure.Relay.Bridge.Configuration
static IDeserializer yamlDeserializer =
new DeserializerBuilder()
.WithNamingConvention(new PascalCaseNamingConvention())
.WithNamingConvention(YamlDotNet.Serialization.NamingConventions.PascalCaseNamingConvention.Instance)
.Build();
static ISerializer yamlSerializer =
new SerializerBuilder()
.WithNamingConvention(new PascalCaseNamingConvention()).Build();
.ConfigureDefaultValuesHandling(DefaultValuesHandling.OmitDefaults)
.WithNamingConvention(YamlDotNet.Serialization.NamingConventions.PascalCaseNamingConvention.Instance).Build();
private bool disposedValue = false; // To detect redundant calls
private string bindAddress;

Просмотреть файл

@ -2,6 +2,7 @@
<PropertyGroup>
<DisableOutOfProcTaskHost>true</DisableOutOfProcTaskHost>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win10-x64</RuntimeIdentifier>
</PropertyGroup>
<PropertyGroup>
@ -21,13 +22,13 @@
<PackageReference Include="System.Memory" Version="$(SystemMemoryPackageVersion)" />
<PackageReference Include="System.Net.NameResolution" Version="$(SystemNetNameResolutionPackageVersion)" />
<PackageReference Include="System.Net.NetworkInformation" Version="$(SystemNetNetworkInformationPackageVersion)" />
<PackageReference Include="YamlDotNet.Signed" Version="$(YamlDotNetSignedPackageVersion)" />
<PackageReference Include="YamlDotNet" Version="$(YamlDotNetPackageVersion)" />
<PackageReference Include="System.Diagnostics.Tracing" Version="$(SystemDiagnosticsTracingPackageVersion)" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="$(SystemDiagnosticsDiagnosticSourcePackageVersion)" />
</ItemGroup>
<Choose>
<When Condition="'$(TargetFramework)' == 'net462'">
<When Condition="'$(TargetFramework)' == 'net48'">
<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.Tracing.EventSource" Version="$(MicrosoftDiagnosticsTracingEventSourcePackageVersion)" />
</ItemGroup>
@ -35,14 +36,14 @@
</Choose>
<Choose>
<When Condition="'$(TargetFramework)' == 'net462'">
<When Condition="'$(TargetFramework)' == 'net48'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);USE_MDT_EVENTSOURCE</DefineConstants>
</PropertyGroup>
</When>
</Choose>
<Target Name="IncludeEtwManifest" Condition="'$(TargetFramework)' == 'net462'">
<Target Name="IncludeEtwManifest" Condition="'$(TargetFramework)' == 'net48'">
<ItemGroup>
<TfmSpecificPackageFile Include="$(OutputPath)\*.etwManifest.dll" PackagePath="etw" />
<TfmSpecificPackageFile Include="$(OutputPath)\*.etwManifest.man" PackagePath="etw" />
@ -77,7 +78,7 @@
<Target Name="GetTargetPath" Returns="@(WixGetTargetPath)">
<ItemGroup>
<WixGetTargetPath Include="$(MSBuildProjectDirectory)\$(OutputPath)\net462\$(AssemblyName).dll" />
<WixGetTargetPath Include="$(MSBuildProjectDirectory)\$(OutputPath)\net48\$(AssemblyName).dll" />
</ItemGroup>
</Target>

Просмотреть файл

@ -1 +1 @@
msbuild /t:publish /p:AlreadyPublished=true /p:TargetFramework=net462 /p:Platform=x64 /p:Configuration=Debug /p:RuntimeIdentifier=win10-x64
msbuild /t:publish /p:AlreadyPublished=true /p:TargetFramework=net48 /p:Platform=x64 /p:Configuration=Debug /p:RuntimeIdentifier=win10-x64

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="WiX" version="3.11.2" targetFramework="net462" />
<package id="WiX" version="3.11.2" targetFramework="net48" />
</packages>

Просмотреть файл

@ -3,7 +3,7 @@
using System.Text;
#if NET462
#if NET48
namespace azbridge
{
using System.ComponentModel;

Просмотреть файл

@ -52,7 +52,7 @@ namespace azbridge
{
try
{
#if NET462
#if NET48
if (settings.ServiceInstall.HasValue && settings.ServiceInstall.Value)
{
ServiceLauncher.InstallService();

2
src/azbridge/RelayBridgeService.Designer.cs сгенерированный
Просмотреть файл

@ -1,6 +1,6 @@

#if NET462
#if NET48
namespace azbridge
{
partial class RelayBridgeService

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#if NET462
#if NET48
namespace azbridge
{
using System;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
#if NET462
#if NET48
namespace azbridge
{
using System;

Просмотреть файл

@ -5,6 +5,7 @@
<PublishTrimmed>true</PublishTrimmed>
<PublishSingleFile>false</PublishSingleFile>
<SelfContained>true</SelfContained>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win10-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
@ -29,8 +30,8 @@
<ItemGroup>
<LinuxFolder Include="/var/log/azbridge" Group="azbridge" Owner="azbridge" RemoveOnUninstall="true" Condition="! $(RuntimeIdentifier.StartsWith('win'))"/>
<LinuxFolder Include="/etc/azbridge" Group="azbridge" Owner="azbridge" RemoveOnUninstall="true" Condition="! $(RuntimeIdentifier.StartsWith('win'))"/>
<LinuxFolder Include="/var/log/azbridge" Group="azbridge" Owner="azbridge" RemoveOnUninstall="true" Condition="! $(RuntimeIdentifier.StartsWith('win'))" />
<LinuxFolder Include="/etc/azbridge" Group="azbridge" Owner="azbridge" RemoveOnUninstall="true" Condition="! $(RuntimeIdentifier.StartsWith('win'))" />
<Content Include="azbridge_config.svc.yml" CopyToPublishDirectory="PreserveNewest" Condition="! $(RuntimeIdentifier.StartsWith('win'))">
<LinuxPath>/etc/azbridge/azbridge_config.svc.yml</LinuxPath>
</Content>
@ -39,7 +40,7 @@
</Content>
<Content Include="azbridge.sh" CopyToPublishDirectory="PreserveNewest" Condition="! $(RuntimeIdentifier.StartsWith('win'))" RemoveOnUninstall="true">
<LinuxPath>/etc/profile.d/azbridge.sh</LinuxPath>
<LinuxFileMode Condition="!($(RuntimeIdentifier.StartsWith('rhel')) OR $(RuntimeIdentifier.StartsWith('fedora')) OR $(RuntimeIdentifier.StartsWith('opensuse')) OR $(RuntimeIdentifier.StartsWith('centos')))" >0555</LinuxFileMode>
<LinuxFileMode Condition="!($(RuntimeIdentifier.StartsWith('rhel')) OR $(RuntimeIdentifier.StartsWith('fedora')) OR $(RuntimeIdentifier.StartsWith('opensuse')) OR $(RuntimeIdentifier.StartsWith('centos')))">0555</LinuxFileMode>
</Content>
<Content Include="../tools/Powershell/add-hostname.ps1" CopyToPublishDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
<Content Include="../tools/Powershell/remove-hostname.ps1" CopyToPublishDirectory="PreserveNewest" Condition="$(RuntimeIdentifier.StartsWith('win'))" />
@ -52,7 +53,7 @@
</PropertyGroup>
<Choose>
<When Condition="'$(TargetFramework)' == 'net462'">
<When Condition="'$(TargetFramework)' == 'net48'">
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
@ -88,7 +89,7 @@
</PropertyGroup>
<Choose>
<When Condition="'$(TargetFramework)' == 'net462'">
<When Condition="'$(TargetFramework)' == 'net48'">
<ItemGroup>
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="$(MicrosoftDiagnosticsTracingTraceEventPackageVersion)" />
<PackageReference Include="Microsoft.Diagnostics.Tracing.EventSource" Version="$(MicrosoftDiagnosticsTracingEventSourcePackageVersion)" />
@ -98,7 +99,7 @@
</Choose>
<Choose>
<When Condition="'$(TargetFramework)' == 'net462'">
<When Condition="'$(TargetFramework)' == 'net48'">
<PropertyGroup>
<DefineConstants>$(DefineConstants);USE_MDT_EVENTSOURCE</DefineConstants>
</PropertyGroup>
@ -137,7 +138,7 @@
<ItemGroup Condition="$(RuntimeIdentifier.StartsWith('debian')) OR $(RuntimeIdentifier.StartsWith('ubuntu')) OR $(RuntimeIdentifier.StartsWith('linuxmint'))">
<!-- <DebDependency Include="lttng-ust" Version=""/> -->
<DebDependency Include="libcurl3 | libcurl4" Version=""/>
<DebDependency Include="libcurl3 | libcurl4" Version="" />
<DebDependency Include="libssl1.0.0 | libssl1.0.2 | libssl1.1" Version="" />
<DebDependency Include="libkrb5-3" Version="" />
<DebDependency Include="zlib1g" Version="" />
@ -176,34 +177,35 @@
<Target Name="GetTargetPath" Returns="@(WixGetTargetPath)">
<ItemGroup>
<WixGetTargetPath Include="$(MSBuildProjectDirectory)\$(OutputPath)\net462\$(AssemblyName).exe" />
<WixGetTargetPath Include="$(MSBuildProjectDirectory)\$(OutputPath)\net48\$(AssemblyName).exe" />
</ItemGroup>
</Target>
<Target Name="PackageZip" DependsOnTargets="CreateZip" Condition="$(RuntimeIdentifier.EndsWith($(PlatformTarget))) AND $(RuntimeIdentifier.StartsWith('win'))">
<Copy SourceFiles="$(ZipPath)" DestinationFolder="$(BuildDir)/$(TargetFramework)" />
</Target>
<Target Name="PackageTarball" DependsOnTargets="CreateTarball" Condition="('$(TargetFramework)' == 'netcoreapp3.0') AND $(UnixRuntimeIdentifiers.Contains($(RuntimeIdentifier)))">
<Target Name="PackageTarball" DependsOnTargets="CreateTarball" Condition="('$(TargetFramework)' == 'netcoreapp5.0') AND $(UnixRuntimeIdentifiers.Contains($(RuntimeIdentifier)))">
<Copy SourceFiles="$(TarballPath)" DestinationFolder="$(BuildDir)/$(TargetFramework)" />
</Target>
<Target Name="PackageDebian" DependsOnTargets="CreateDeb" Condition="'$(OS)' == 'Unix' AND ('$(TargetFramework)' == 'netcoreapp3.0') AND ($(RuntimeIdentifier.StartsWith('ubuntu')) OR $(RuntimeIdentifier.StartsWith('debian')) OR $(RuntimeIdentifier.StartsWith('linuxmint')))">
<Target Name="PackageDebian" DependsOnTargets="CreateDeb" Condition="'$(OS)' == 'Unix' AND ('$(TargetFramework)' == 'netcoreapp5.0') AND ($(RuntimeIdentifier.StartsWith('ubuntu')) OR $(RuntimeIdentifier.StartsWith('debian')) OR $(RuntimeIdentifier.StartsWith('linuxmint')))">
<Copy SourceFiles="$(DebPath)" DestinationFolder="$(BuildDir)/$(TargetFramework)" />
</Target>
<Target Name="PackageRpm" DependsOnTargets="CreateRpm" Condition="'$(OS)' == 'Unix' AND ('$(TargetFramework)' == 'netcoreapp3.0') AND ($(RuntimeIdentifier.StartsWith('rhel')) OR $(RuntimeIdentifier.StartsWith('centos')) OR $(RuntimeIdentifier.StartsWith('fedora')) OR $(RuntimeIdentifier.StartsWith('opensuse')) OR $(RuntimeIdentifier.StartsWith('ol')))">
<Target Name="PackageRpm" DependsOnTargets="CreateRpm" Condition="'$(OS)' == 'Unix' AND ('$(TargetFramework)' == 'netcoreapp5.0') AND ($(RuntimeIdentifier.StartsWith('rhel')) OR $(RuntimeIdentifier.StartsWith('centos')) OR $(RuntimeIdentifier.StartsWith('fedora')) OR $(RuntimeIdentifier.StartsWith('opensuse')) OR $(RuntimeIdentifier.StartsWith('ol')))">
<Copy SourceFiles="$(RpmPath)" DestinationFolder="$(BuildDir)/$(TargetFramework)" />
</Target>
<Target Name="PackageWindows" DependsOnTargets="Publish" Condition="'$(OS)' == 'Windows_NT' AND '$(TargetFramework)' == 'net462' AND $(RuntimeIdentifier.StartsWith('win')) AND $(RuntimeIdentifier.EndsWith($(PlatformTarget)))">
<Target Name="PackageWindows" DependsOnTargets="Publish" Condition="'$(OS)' == 'Windows_NT' AND '$(TargetFramework)' == 'net48' AND $(RuntimeIdentifier.StartsWith('win')) AND $(RuntimeIdentifier.EndsWith($(PlatformTarget)))">
<PropertyGroup>
<MsiDir>$(PublishDir)../msi</MsiDir>
<_OutputName>azbridge_installer.$(PackageVersion).$(RuntimeIdentifier)</_OutputName>
<VS160COMNTOOLS Condition="'$(VS160COMNTOOLS)'==''">C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\</VS160COMNTOOLS>
</PropertyGroup>
<Exec WorkingDirectory="../azbridge-installer" Command="restore.cmd" />
<!-- MUST USE 32-bit for WiX -->
<Error Condition="'$(MSBuildToolsPath32)'==''" Text="MSBuildToolsPath32 is not set. MSI installers MUST be built with msbuild.exe and not with dotnet msbuild" />
<Exec Command="&quot;$(MSBuildToolsPath32)\msbuild&quot; ../azbridge-installer/azbridge-installer.wixproj /t:Publish /p:TargetFramework=$(TargetFramework);RuntimeIdentifier=$(RuntimeIdentifier);BridgeProjectFile=$(MSBuildProjectFullPath);BridgePublishPath=$(MSBuildProjectDirectory)\$(PublishDir);OutputPath=$(MSBuildProjectDirectory)\$(MsiDir);OutputName=$(_OutputName);AlreadyPublished=true" />
<Error Condition="'$(VS160COMNTOOLS)'==''" Text="VS160COMNTOOLS is not set. MSI installers MUST be built with msbuild.exe and not with dotnet msbuild" />
<Exec Command="&quot;$(VS160COMNTOOLS)..\..\MSBuild\Current\Bin\msbuild&quot; ../azbridge-installer/azbridge-installer.wixproj /t:Publish /p:TargetFramework=$(TargetFramework);RuntimeIdentifier=$(RuntimeIdentifier);BridgeProjectFile=$(MSBuildProjectFullPath);BridgePublishPath=$(MSBuildProjectDirectory)\$(PublishDir);OutputPath=$(MSBuildProjectDirectory)\$(MsiDir);OutputName=$(_OutputName);AlreadyPublished=true" />
<Copy SourceFiles="$(MSBuildProjectDirectory)\$(MsiDir)\$(_OutputName).msi" DestinationFolder="$(BuildDir)/$(TargetFramework)" />
</Target>
<Target Name="PackageOSX" DependsOnTargets="Publish" Condition="'$(OS)' == 'Unix' AND ('$(TargetFramework)' == 'netcoreapp3.0') AND ($(RuntimeIdentifier.StartsWith('osx')))">
<Target Name="PackageOSX" DependsOnTargets="Publish" Condition="'$(OS)' == 'Unix' AND ('$(TargetFramework)' == 'netcoreapp5.0') AND ($(RuntimeIdentifier.StartsWith('osx')))">
</Target>
<Target Name="PublishPackages" DependsOnTargets="PackageDebian;PackageRpm;PackageWindows;PackageOSX;PackageZip;PackageTarball" Condition=" '$(RuntimeIdentifier)' != ''">
@ -217,7 +219,7 @@
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Package" Properties="TargetFramework=$(TargetFramework);RuntimeIdentifier=%(_PublishRuntimeIdentifier.Identity)" />
</Target>
<Target Name="PublishProjectForAllUnixRIDsIfTargetFrameworkSet" Condition=" '$(TargetFramework)' != '' and '$(TargetFramework)' != 'net462' and '$(RuntimeIdentifier)' == '' and ('$(OS)' == 'Unix' OR '$(WindowsOnly)'=='false')">
<Target Name="PublishProjectForAllUnixRIDsIfTargetFrameworkSet" Condition=" '$(TargetFramework)' != '' and '$(TargetFramework)' != 'net48' and '$(RuntimeIdentifier)' == '' and ('$(OS)' == 'Unix' OR '$(WindowsOnly)'=='false')">
<ItemGroup>
<_PublishRuntimeIdentifier Include="$(UnixRuntimeIdentifiers)" />
</ItemGroup>
@ -227,7 +229,7 @@
<ItemGroup>
<_PublishFramework Include="$(TargetFrameworks)" />
</ItemGroup>
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Package" Properties="TargetFramework=%(_PublishFramework.Identity);RuntimeIdentifier=$(RuntimeIdentifier)" Condition="!('$(OS)' == 'Unix' AND '%(_PublishFramework.Identity)'=='net462')" />
<MSBuild Projects="$(MSBuildProjectFile)" Targets="Package" Properties="TargetFramework=%(_PublishFramework.Identity);RuntimeIdentifier=$(RuntimeIdentifier)" Condition="!('$(OS)' == 'Unix' AND '%(_PublishFramework.Identity)'=='net48')" />
</Target>
<Target Name="Package" DependsOnTargets="PublishProjectIfFrameworkAndRIDSet;PublishProjectForAllFrameworksIfFrameworkUnset;PublishProjectForAllUnixRIDsIfTargetFrameworkSet;PublishProjectForAllWindowsRIDsIfTargetFrameworkSet" />
</Project>

Просмотреть файл

@ -14,7 +14,7 @@ if "%ImageName%"=="" set ImageName=ubuntu.18.04-x64
if "%ImageSuffix%"=="" set ImageSuffix=deb
if "%VersionSuffix%"=="" set VersionSuffix=preview
if "%VersionPrefix%"=="" set VersionPrefix=1.0.0
if "%TargetFramework%"=="" set TargetFramework=netcoreapp3.0
if "%TargetFramework%"=="" set TargetFramework=netcoreapp5.0
set PackageName=azbridge.%VersionPrefix%-%VersionSuffix%.%ImageName%.%ImageSuffix%
pushd "%~dp0"

Просмотреть файл

@ -12,7 +12,7 @@ if [ -z ${ImageName+x} ]; then ImageName='ubuntu.18.04-x64'; fi
if [ -z ${ImageSuffix+x} ]; then VersionSuffix='deb'; fi
if [ -z ${VersionSuffix+x} ]; then VersionSuffix='preview'; fi
if [ -z ${VersionPrefix+x} ]; then VersionPrefix='1.0.0'; fi
if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp3.0'; fi
if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp5.0'; fi
echo $@

Просмотреть файл

@ -14,7 +14,7 @@ if "%ImageName%"=="" set ImageName=ubuntu.18.04-x64
if "%ImageSuffix%"=="" set ImageSuffix=deb
if "%VersionSuffix%"=="" set VersionSuffix=preview
if "%VersionPrefix%"=="" set VersionPrefix=1.0.0
if "%TargetFramework%"=="" set TargetFramework=netcoreapp3.0
if "%TargetFramework%"=="" set TargetFramework=netcoreapp5.0
pushd "%~dp0"

Просмотреть файл

@ -12,7 +12,7 @@ if [ -z ${ImageName+x} ]; then ImageName='ubuntu.18.04-x64'; fi
if [ -z ${ImageSuffix+x} ]; then VersionSuffix='deb'; fi
if [ -z ${VersionSuffix+x} ]; then VersionSuffix='preview'; fi
if [ -z ${VersionPrefix+x} ]; then VersionPrefix='1.0.0'; fi
if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp3.0'; fi
if [ -z ${TargetFramework+x} ]; then TargetFramework='netcoreapp5.0'; fi
echo $@

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<DeveloperBuildTestTfms>netcoreapp3.0</DeveloperBuildTestTfms>
<DeveloperBuildTestTfms>netcoreapp5.0</DeveloperBuildTestTfms>
<StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">$(StandardTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
@ -11,6 +11,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
<PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
<PackageReference Condition="'$(OS)' == 'Windows_NT' AND '$(TargetFramework)' == 'net462'" Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" />
<PackageReference Condition="'$(OS)' == 'Windows_NT' AND '$(TargetFramework)' == 'net48'" Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -3,18 +3,22 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<Description>Azure Relay Bridge Tests</Description>
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">win10-x64</RuntimeIdentifier>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="$(McMasterExtensionsCommandLineUtilsPackageversion)" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="$(McMasterExtensionsCommandLineUtilsPackageVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpPackageVersion)" />
<PackageReference Include="System.Memory" Version="$(SystemMemoryPackageVersion)" />
<PackageReference Include="System.Net.NameResolution" Version="$(SystemNetNameResolutionPackageVersion)" />
<PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
<PackageReference Condition="'$(OS)' == 'Windows_NT' AND '$(TargetFramework)' == 'net462'" Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" />
<PackageReference Include="YamlDotNet.Signed" Version="$(YamlDotnetSignedPackageVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.3">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="YamlDotNet" Version="$(YamlDotNetPackageVersion)" />
<!--<DotNetCliToolReference Include="dotnet-xunit" Version="$(DotnetXunitPackageVersion)" />-->
</ItemGroup>

Просмотреть файл

@ -3,7 +3,7 @@ pushd "%~dp0"
set xunitrunner=xunit.console.exe
where %xunitrunner% 2>&1
if ERRORLEVEL 1 set xunitrunner=C:\Tools\xUnit20\xunit.console.exe
"%xunitrunner%" "test\unit\Microsoft.Azure.Relay.Bridge.Tests\bin\Debug\net462\Microsoft.Azure.Relay.Bridge.Tests.dll" -appveyor
"%xunitrunner%" "test\unit\Microsoft.Azure.Relay.Bridge.Tests\bin\Debug\net48\Microsoft.Azure.Relay.Bridge.Tests.dll" -appveyor
rem cd test\nginx
rem msbuild /t:clean,build,vstest

Просмотреть файл

@ -4,12 +4,12 @@ if [ ! -z $APPVEYOR_BUILD_VERSION ]; then _VersionProp="/p:VersionPrefix=$APPVEY
dotnet test --verbosity=normal /p:SelfContained=false
pushd test/mysql
dotnet clean --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:build --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet test --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet clean --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp5.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:build /p:Configuration=Debug /p:TargetFramework=netcoreapp5.0 $_BuildProp $_VersionProp $@
dotnet test --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp5.0 $_BuildProp $_VersionProp $@
popd
pushd test/nginx
dotnet clean --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:build --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet test --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp3.0 $_BuildProp $_VersionProp $@
dotnet clean --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp5.0 $_BuildProp $_VersionProp $@
dotnet msbuild /t:build /p:Configuration=Debug /p:TargetFramework=netcoreapp5.0 $_BuildProp $_VersionProp $@
dotnet test --verbosity=normal /p:Configuration=Debug /p:TargetFramework=netcoreapp5.0 $_BuildProp $_VersionProp $@
popd

Просмотреть файл

@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>0.2.9</VersionPrefix>
<VersionPrefix>0.3.0</VersionPrefix>
<VersionSuffix>rtm</VersionSuffix>
</PropertyGroup>
</Project>