This commit is contained in:
Clemens Vasters 2018-06-12 21:01:36 +02:00
Родитель ede6c4b313
Коммит 88a828a0d9
87 изменённых файлов: 1113 добавлений и 1865 удалений

17
.appveyor.yml Normal file
Просмотреть файл

@ -0,0 +1,17 @@
init:
- git config --global core.autocrlf true
branches:
only:
- dev
- /^release\/.*$/
- /^(.*\/)?ci-.*$/
build_script:
- ps: .\run.ps1 default-build
clone_depth: 1
environment:
global:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
DOTNET_CLI_TELEMETRY_OPTOUT: 1
test: 'off'
deploy: 'off'
os: Visual Studio 2017

51
.gitattributes поставляемый Normal file
Просмотреть файл

@ -0,0 +1,51 @@
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain
*.jpg binary
*.png binary
*.gif binary
*.cs text=auto diff=csharp
*.vb text=auto
*.resx text=auto
*.c text=auto
*.cpp text=auto
*.cxx text=auto
*.h text=auto
*.hxx text=auto
*.py text=auto
*.rb text=auto
*.java text=auto
*.html text=auto
*.htm text=auto
*.css text=auto
*.scss text=auto
*.sass text=auto
*.less text=auto
*.js text=auto
*.lisp text=auto
*.clj text=auto
*.sql text=auto
*.php text=auto
*.lua text=auto
*.m text=auto
*.asm text=auto
*.erl text=auto
*.fs text=auto
*.fsx text=auto
*.hs text=auto
*.csproj text=auto
*.vbproj text=auto
*.fsproj text=auto
*.dbproj text=auto
*.sln text=auto eol=crlf
*.sh eol=lf

231
.gitignore поставляемый
Просмотреть файл

@ -1,203 +1,34 @@
# Compiled object files
*.o
# Compiled static libraries
*.a
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# Cache/options
.vs/*
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
[Bb]in/
[Oo]bj/
[Oo]bjd/
!/build/release/
target/
/c/cmake
# Jenkins build files
/jenkins/jenkins-cli.jar
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
!packages/*/build/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
[Bb]in/
TestResults/
.nuget/
_ReSharper.*/
packages/
artifacts/
PublishProfiles/
*.user
*.suo
*.cache
*.docstates
_ReSharper.*
nuget.exe
*net45.csproj
*net451.csproj
*k10.csproj
*.psess
*.vsp
*.vspx
# eclipse java
.classpath
.project
*.prefs
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
# NuGet Packages Directory
packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#LightSwitch generated files
GeneratedArtifacts/
_Pvt_Extensions/
ModelManifest.xml
# =========================
# Windows detritus
# =========================
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac desktop service store files
.DS_Store
# Visual studio build artifacts
*.tlog
*.lastbuildstate
*.idb
*.exp
*.lib
*.dll
*.lock.json
#Windows CE build artifacts
Build.err
Build.wrn
Buildx86retail.dat
*.dat
#Linux build arfifacts
*.opp
#Tools EXE that doesn't end up in a typical build directory
**/common/tools/macro_utils_h_generator/macro_utils_h_generator.exe
#version file
**/build/**/version.txt
**/node_modules/
**/.vscode/
# Typescript installed definition files for modules
**/typings/
*.pidb
*.userprefs
*DS_Store
*.ncrunchsolution
*.*sdf
*.ipch
*.sln.ide
project.lock.json
/.vs
.vscode/
.build/
.testPublish/
global.json
*.g.targets
launchSettings.json

30
.travis.yml Normal file
Просмотреть файл

@ -0,0 +1,30 @@
language: csharp
sudo: false
dist: trusty
env:
global:
- DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
- DOTNET_CLI_TELEMETRY_OPTOUT: 1
matrix:
- secure: gvg/6MhNPOKJyk4JrOPsqi6jH9IQ5mSYQR+S+q/jHYNetsm9yZHKproqQEMegW/L99Y/WNpi7EzBfasCBfQsJrJq9/WYBrj0VmqstszcsWYbUpU9V8B0vQSAewSHq/FkxFjqMRtA7AZCYViddBloD3Sb9/FVy7yfFv7BRZFX5ukYnK2EU6foJaz/5r8A2efLZ5C/CdEEMsn/OcrtnYMu5tstWFy1JWS2Gk+vgzrwchVqncLI60AvwnRuPyMMbsyIY8cJidcKojr6gcGJ9S5ATtK0DfIoGV9+9CPLDtzVJJltYl1677zEoRL7RIz9Ly5Yydk17b5whES6Mh+GbPokhRxx8B/9Ag9I7TjAyMNVwTZ6AlQSYycG0m/FLZmKJvBa2RkzhALUuN/oXL/SLkU7isCzbk03wrWYY6/gv5T6249FNf5z5I8GNhm7eJGhz+A3FudRDkqCIGHV8rs3iiQLrXfHZCpyBlA8g+oHHmAPtmfpXmNALUD6Y6c4OCAaApjFj3UIN+LGtV/AMFGq0yvNXd14qo5h1doI27A5sIeOhRXntpOapPkgmlDWe048NNDUnLdRj0pUMebm0uqepK/M8etQ38HSTQpKFdrY6JVfaFiq/5Dd0S6M8rdYEdUh9E4lGZqzhr5WKTV8vkUtdsWIMvi2wY5q6DT//kSLxzmOjLA=
- secure: HquUNjKDznaeW2fLV1+Xv9pJlTu8zCrggC/Et+22emgdANv3CYczQ/M9vLzdOEyfkSjWKfKQngNX/YbSQPzIT+Gty6NFFXYDOrxtI7M4ceTEDw2BUmZtNk0wmidifoBUy27yn88iFxssxRsdNMYXhNqV5GJSWf+6y6v2CFlb/nws6HcGcelPeQJqSSMMplo4B+hbLbce2t12L+VV77A9rWt52DL4OtEAb012l6JofW0k3WwQsWo8/j/AbkkMmofPQowIY9Y+MnsifynRdv26PjOgGkCODS6jVWskKZJlfH+raH7rW6v87BpMVVfPPon6vQO6jVHQWhOQ1nPG4VUVuyAPIIZ7A15ZmiXZpMklMvBtiGv8n5lRCz4qQvgOa5WCZuWxFboFOiwcoCmdqgGk1SJx4Lf6ySBX3hSer3Kd9aZY9OoxuOd+dL5DAsxK8pr4mCZDZcYSFSD3N486Sbmp9/ZyU1qV4wda2yXIdtQtTYix5u5AoxdROUAitaayr2DNDnmzokDON54hNK6t7UPEGSww8g8cywWKQSwSK0p00tGQXtHdYFQCPwMJptAQ4YBh3CvOmyR5ZN1P5gjrdOig+SKc8pilCobOYsqM+LbKy9I5tFjX06GDFsS189ECH+OgNl0hzQgX1dAN3QHCifYIevrblVmmPnkk5j8wUlEfqQY=
mono: none
os:
- linux
- osx
osx_image: xcode8.2
addons:
apt:
packages:
- libunwind8
branches:
only:
- dev
- "/^release\\/.*$/"
- "/^(.*\\/)?ci-.*$/"
before_install:
- if test "$TRAVIS_OS_NAME" == "osx"; then brew update; brew install openssl; ln -s
/usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/; ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
/usr/local/lib/; fi
script:
- "./build.sh"

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

@ -1,3 +0,0 @@
using System;
[assembly: System.CLSCompliant(false)]

4
CONTRIBUTING.md Normal file
Просмотреть файл

@ -0,0 +1,4 @@
Contributing
======
Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo.

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

@ -1,130 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace ForwardingServiceCommon
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;
public class ConfigReader
{
public static Configuration ReadConfigurationFromEnvironmentVariable(string environmentVariableName)
{
// BUGBUG: For some reason, Environment.ExpandEnvironmentVariables does NOT expand the environment block...?
var envVars = Environment.GetEnvironmentVariables();
var bytes = Convert.FromBase64String((string)envVars[environmentVariableName]);
string envVar = Encoding.Unicode.GetString(bytes);
return ReadConfiguration(envVar);
}
public static List<ConfigurationBinding> ReadXmlBindings(string xml)
{
List<ConfigurationBinding> bindings = null;
using (XmlReader reader = XmlReader.Create(new StringReader(xml)))
{
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.Element)
{
if (reader.Name == "Bindings")
{
bindings = ReadBindings(reader);
}
}
}
}
return bindings;
}
public static List<ConfigurationBinding> ReadBindings(XmlReader reader)
{
List<ConfigurationBinding> bindings = new List<ConfigurationBinding>();
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "Bindings")
{
break;
}
if (reader.NodeType == XmlNodeType.Element && reader.Name == "Binding")
{
bindings.Add(ReadBinding(reader));
}
}
return bindings;
}
public static ConfigurationBinding ReadBinding(XmlReader reader)
{
ConfigurationBinding binding = new ConfigurationBinding();
while (reader.Read())
{
if (reader.NodeType == XmlNodeType.EndElement && reader.Name == "Binding")
{
break;
}
if (reader.NodeType == XmlNodeType.Element && reader.Name == "Port")
{
reader.Read();
if (reader.NodeType != XmlNodeType.Text)
{
throw new FormatException("Expected text in <port> tags");
}
else
{
binding.Port = int.Parse(reader.Value);
}
}
if (reader.NodeType == XmlNodeType.Element && reader.Name == "ConnectionString")
{
reader.Read();
if (reader.NodeType != XmlNodeType.Text)
{
throw new FormatException("Expected text in <ConnectionString> tags");
}
else
{
binding.ConnectionString = reader.Value;
}
}
if (reader.NodeType == XmlNodeType.Element && reader.Name == "IsV2")
{
reader.Read();
if (reader.NodeType != XmlNodeType.Text)
{
throw new FormatException("Expected text in <IsV2> tag");
}
else
{
binding.IsV2 = bool.Parse(reader.Value);
}
}
}
return binding;
}
public static Configuration ReadConfiguration(string data)
{
Configuration config = new Configuration();
config.Bindings = ReadXmlBindings(data);
return config;
}
}
}

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

@ -1,23 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace ForwardingServiceCommon
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class Configuration
{
public Configuration()
{
KeyValuePairs = new Dictionary<string, string>();
Bindings = new List<ConfigurationBinding>();
}
public Dictionary<string, string> KeyValuePairs { get; set; }
public List<ConfigurationBinding> Bindings { get; set; }
}
}

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

@ -1,19 +0,0 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace ForwardingServiceCommon
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
public class ConfigurationBinding
{
public string ConnectionString { get; set; }
public int Port { get; set; }
public bool IsV2 { get; set; }
}
}

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

@ -1,204 +0,0 @@

// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace Microsoft.Web.Hosting.Forwarding.Common
{
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
public class Logger
{
private const int MaxWriteBufferSize = 32000;
private bool useLogging;
private string logFileDirAndPrefix;
private int maxHourlyEntryOfType;
private StringBuilder writeBuffer;
private int currentHour;
private string currentLogFile;
private object @lock = new object();
private Dictionary<string, int> messageCount;
public Logger(bool useLogging, string logFileDirAndPrefix, int maxHourlyEntryOfType = 5)
{
this.useLogging = useLogging;
this.logFileDirAndPrefix = logFileDirAndPrefix;
this.maxHourlyEntryOfType = maxHourlyEntryOfType;
writeBuffer = new StringBuilder();
SetNewLogFile();
messageCount = new Dictionary<string, int>();
// Create a task that will periodically flush the file
Task.Factory.StartNew(() => FileHandlerTask());
}
public void LogMessage(string message)
{
if (!useLogging)
{
// Don't need logging;
return;
}
lock (@lock)
{
if (DateTime.UtcNow.Hour != currentHour)
{
// New hour, flush write buffer data, set a new log file.
FlushWriteBuffer();
SetNewLogFile();
}
// Check the size of the write buffer, to ensure we have room
if (writeBuffer.Length > MaxWriteBufferSize)
{
// Try flushing it.
if (!FlushWriteBuffer())
{
// This is an error condition. We can't write to the file and our buffer is full. We must drop the message.
return;
}
}
// Check if we need to throttle this message
bool needToThrottle = false;
int count;
if (messageCount.TryGetValue(message, out count))
{
if (count + 1 >= maxHourlyEntryOfType)
{
// We hit the limit. If the count is exactly the max, write a message stating that we hit the limit
if (count + 1 == maxHourlyEntryOfType)
{
writeBuffer.AppendLine(DateTime.UtcNow.ToString() + ": Received the limit on messages of \"" + message +
"\". This message will be throttled and within an hour the aggregate count will be stated.");
}
needToThrottle = true;
}
}
else
{
count = 0;
}
if (!needToThrottle)
{
// Write the message
WriteLogDirectToBuffer(message);
}
messageCount[message] = count + 1;
}
}
private void FileHandlerTask()
{
if (!useLogging)
{
// Don't need logging;
return;
}
/*This task is in charge of two things:
1 - Periodically flush the write buffer. Every two minutes.
2 - Every hour, collect and log aggregate logs
*/
DateTime startTime = DateTime.UtcNow;
while (true)
{
// Sleep for two minutes, then flush
Thread.Sleep(60 * 2 * 1000);
lock (@lock)
{
FlushWriteBuffer();
}
if ((DateTime.UtcNow - startTime).TotalMinutes > 60)
{
// Log and clear aggregate logs
// Go through each log in the message count
lock (@lock)
{
foreach (var log in messageCount)
{
if (log.Value >= maxHourlyEntryOfType)
{
// Log directly
WriteLogDirectToBuffer("Over the last hour, received " + log.Value + " messages with body: " + log.Key);
}
}
messageCount.Clear();
startTime = DateTime.UtcNow;
}
}
}
}
private void SetNewLogFile()
{
string currentDateHour = DateTime.UtcNow.ToString("yyyy-MM-dd-HH");
currentLogFile = logFileDirAndPrefix + "_" + currentDateHour + ".log";
currentHour = DateTime.UtcNow.Hour;
}
private void WriteLogDirectToBuffer(string message)
{
writeBuffer.AppendLine(DateTime.UtcNow.ToString() + ": " + message);
}
private bool FlushWriteBuffer()
{
if (writeBuffer.Length == 0)
{
// Don't need to flush anything
return true;
}
bool success = false;
// Try up to 5 times ignoring failures
for (int i = 0; i < 5; i++)
{
try
{
using (StreamWriter writer = new StreamWriter(currentLogFile, true))
{
writer.Write(writeBuffer.ToString());
}
writeBuffer.Clear();
success = true;
break;
}
catch (Exception)
{
// Sleep for a little, try again.
Thread.Sleep(200);
}
}
return success;
}
}
}

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

@ -1,74 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(EnvironmentConfig)" />
<Import Project="$(REPOROOT)\src\product\Microsoft.Build.AppFabric.Product.props" />
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<!-- Solves a VS problem locating FileTracker.dll, which is used by the MSBuild GenerateResource task -->
<ResGenTrackerFrameworkPath>$(MSBuildToolsPath_40)</ResGenTrackerFrameworkPath>
</PropertyGroup>
<PropertyGroup>
<CoverageDisabled>false</CoverageDisabled>
</PropertyGroup>
<PropertyGroup>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{24772607-58DF-4C1B-9AFB-9AE165954F62}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.Web.Hosting.Forwarding.Common</RootNamespace>
<AssemblyName>Microsoft.Web.Hosting.Forwarding.Common</AssemblyName>
<TargetDestination>Hosting</TargetDestination>
<AssemblyIdentityVersionName>websites</AssemblyIdentityVersionName>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;NET45;SERIALIZATION</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;NET45;SERIALIZATION</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<DefineConstants>TRACE;NET45;SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|amd64'">
<DefineConstants>TRACE;NET45;SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DefineConstants>TRACE;DEBUG;NET45;SERIALIZATION</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|amd64'">
<DefineConstants>TRACE;DEBUG;NET45;SERIALIZATION</DefineConstants>
</PropertyGroup>
<ItemGroup>
<Reference Include="System.Xml" />
</ItemGroup>
<!--
<ItemGroup>
<ProjectReference Include="..\..\Microsoft.Web.Hosting\Microsoft.Web.Hosting.razzle.csproj">
<Name>Microsoft.Web.Hosting</Name>
<Project>{5506CBDA-6586-431C-B5E4-8F30AAB44D11}</Project>
</ProjectReference>
</ItemGroup>
-->
<ItemGroup>
<Compile Include="ConfigReader.cs" />
<Compile Include="Configuration.cs" />
<Compile Include="ConfigurationBinding.cs" />
<Compile Include="Logger.cs" />
</ItemGroup>
<ItemGroup />
<!--Standard targets required for building in Razzle - do not remove.-->
<Import Project="$(CONFROOT)\.targets\Build.Common.targets" />
<Import Project="$(CONFROOT)\.targets\Microsoft.Build.ServiceBus.Babel.targets" />
<!--Import local targets file if present.-->
</Project>

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

@ -1,14 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft_Web_Hosting_Forwarding_Common_razzle_csproj", "Microsoft.Web.Hosting.Forwarding.Common.razzle.csproj", "{24772607-58DF-4C1B-9AFB-9AE165954F62}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
VSMSBuild|Any CPU = VSMSBuild|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{24772607-58DF-4C1B-9AFB-9AE165954F62}.VSMSBuild|Any CPU.ActiveCfg = Debug|Any CPU
{24772607-58DF-4C1B-9AFB-9AE165954F62}.VSMSBuild|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
EndGlobal

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

@ -1,3 +0,0 @@
BUILD_PASS1_CONSUMES= \
services\websites\src4\hosting\forwardingservice\common|PASS1 \

20
Directory.Build.props Normal file
Просмотреть файл

@ -0,0 +1,20 @@
<Project>
<!--<Import
Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />
!-->
<Import Project="version.props" />
<Import Project="build\dependencies.props" />
<Import Project="build\sources.props" />
<PropertyGroup>
<Product>Mirosoft Azure Relay Bridge</Product>
<RepositoryUrl>https://github.com/azure/azure-relay-bridge</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)build\Key.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition="'$(OS)' != 'Windows_NT'">true</PublicSign>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>

10
Directory.Build.targets Normal file
Просмотреть файл

@ -0,0 +1,10 @@
<Project>
<PropertyGroup>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.0' ">$(MicrosoftNETCoreApp20PackageVersion)</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.1' ">$(MicrosoftNETCoreApp21PackageVersion)</RuntimeFrameworkVersion>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp2.2' ">$(MicrosoftNETCoreApp22PackageVersion)</RuntimeFrameworkVersion>
<NETStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard2.0' ">$(NETStandardLibrary20PackageVersion)</NETStandardImplicitPackageVersion>
<!-- aspnet/BuildTools#662 Don't police what version of NetCoreApp we use -->
<NETCoreAppMaximumVersion>99.9</NETCoreAppMaximumVersion>
</PropertyGroup>
</Project>

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

@ -1,32 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<!--
Use supportedRuntime tags to explicitly specify the version(s) of the .NET Framework runtime that
the custom action should run on. If no versions are specified, the chosen version of the runtime
will be the "best" match to what Microsoft.Deployment.WindowsInstaller.dll was built against.
WARNING: leaving the version unspecified is dangerous as it introduces a risk of compatibility
problems with future versions of the .NET Framework runtime. It is highly recommended that you specify
only the version(s) of the .NET Framework runtime that you have tested against.
Note for .NET Framework v3.0 and v3.5, the runtime version is still v2.0.
In order to enable .NET Framework version 2.0 runtime activation policy, which is to load all assemblies
by using the latest supported runtime, @useLegacyV2RuntimeActivationPolicy="true".
For more information, see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx
-->
<supportedRuntime version="v4.0" />
<supportedRuntime version="v2.0.50727"/>
</startup>
<!--
Add additional configuration settings here. For more information on application config files,
see http://msdn.microsoft.com/en-us/library/kza1yk3a.aspx
-->
</configuration>

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

@ -1,167 +0,0 @@
// // Copyright (c) Microsoft. All rights reserved.
// // Licensed under the MIT license. See LICENSE file in the project root for full license information.
namespace HybridConnectionInstallHelper
{
using System;
using System.IO;
using Microsoft.Deployment.WindowsInstaller;
using Microsoft.Win32;
public class CustomActions
{
public const string HybridConnectionsRegistryPath = @"SOFTWARE\Microsoft\HybridConnectionManager";
public const string InstallDirKeyName = "installDir";
[CustomAction]
public static ActionResult CopyHybridConnectionConfigIfExists(Session session)
{
session.Log("Checking if previous config exists");
string previousInstallDir = PreviousInstallDirectory(session);
if (previousInstallDir == null)
{
session.Log("Could not find previous install, skipping");
return ActionResult.Success;
}
session.Log("Using previous install dir " + previousInstallDir);
if (!File.Exists(Path.Combine(previousInstallDir, "Microsoft.HybridConnectionManager.Listener.exe.config")))
{
session.Log("Previous config file does not exist, skipping.");
return ActionResult.Success;
}
string newInstallDir = session.CustomActionData["INSTALLDIR"];
session.Log("Using new install dir: " + newInstallDir);
if (!Directory.Exists(newInstallDir))
{
session.Log("New install directory does not exist yet, creating");
Directory.CreateDirectory(newInstallDir);
}
session.Log("Copying old config to new directory (with .old postfix)");
File.Copy(
Path.Combine(previousInstallDir, "Microsoft.HybridConnectionManager.Listener.exe.config"),
Path.Combine(newInstallDir, "Microsoft.HybridConnectionManager.Listener.exe.config.old"));
return ActionResult.Success;
}
[CustomAction]
public static ActionResult OverwriteConfigIfOldExists(Session session)
{
string newInstallDir = session.CustomActionData["INSTALLDIR"];
session.Log("Using new install dir: " + newInstallDir);
if (!File.Exists(Path.Combine(newInstallDir, "Microsoft.HybridConnectionManager.Listener.exe.config.old")))
{
session.Log("No old config exists, skipping.");
return ActionResult.Success;
}
session.Log("Copying and overwriting config");
File.Copy(
Path.Combine(newInstallDir, "Microsoft.HybridConnectionManager.Listener.exe.config.old"),
Path.Combine(newInstallDir, "Microsoft.HybridConnectionManager.Listener.exe.config"),
overwrite: true);
session.Log("Deleting old config");
File.Delete(Path.Combine(newInstallDir, "Microsoft.HybridConnectionManager.Listener.exe.config.old"));
return ActionResult.Success;
}
static string PreviousInstallDirectory(Session session)
{
// Enumerate registries
var hklm64 = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, RegistryView.Registry64);
using (RegistryKey registryKey = hklm64.OpenSubKey(HybridConnectionsRegistryPath))
{
if (registryKey == null)
{
session.Log("Can't find previous installs, exitting.");
return null;
}
string largestVersion = null;
int largestMajor = 0;
int largestMinor = 0;
int largestPatch = 0;
foreach (var key in registryKey.GetSubKeyNames())
{
// Split the key by '.', ensure there are three parts
var parts = key.Split('.');
if (parts.Length != 3)
{
session.Log("Skipping key " + key);
continue;
}
bool isLargestVersion = false;
int major, minor, patch;
if (!int.TryParse(parts[0], out major) || !int.TryParse(parts[1], out minor) || !int.TryParse(parts[2], out patch))
{
session.Log("Skipping key " + key);
continue;
}
if (major > largestMajor)
{
isLargestVersion = true;
}
else if (major == largestMajor && minor > largestMinor)
{
isLargestVersion = true;
}
else if (major == largestMajor && minor == largestMinor && patch > largestPatch)
{
isLargestVersion = true;
}
if (isLargestVersion)
{
largestMajor = major;
largestMinor = minor;
largestPatch = patch;
largestVersion = key;
}
}
if (largestVersion != null)
{
session.Log("Using latest version " + largestVersion);
// Return the install dir registry value.
using (var previousVersionRegistryKey = hklm64.OpenSubKey(string.Format(@"{0}\{1}", HybridConnectionsRegistryPath, largestVersion)))
{
if (previousVersionRegistryKey != null)
{
object obj = previousVersionRegistryKey.GetValue(InstallDirKeyName);
if (obj != null)
{
var installPath = (string)obj;
return installPath;
}
}
}
return null;
}
else
{
session.Log("No versions found.");
return null;
}
}
}
}
}

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

@ -1,51 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(EnvironmentConfig)" />
<Import Project="$(REPOROOT)\src\product\Microsoft.Build.AppFabric.Product.props" />
<PropertyGroup Condition="'$(BuildingInsideVisualStudio)' == 'true'">
<!-- Solves a VS problem locating FileTracker.dll, which is used by the MSBuild GenerateResource task -->
<ResGenTrackerFrameworkPath>$(MSBuildToolsPath_40)</ResGenTrackerFrameworkPath>
</PropertyGroup>
<PropertyGroup>
<CoverageDisabled>false</CoverageDisabled>
</PropertyGroup>
<PropertyGroup>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{5A86ACC1-2EE7-460E-8496-73A05DFFCC39}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>HybridConnectionInstallHelper</RootNamespace>
<AssemblyName>HybridConnectionInstallHelper</AssemblyName>
<InstallerPlatform>x86</InstallerPlatform>
</PropertyGroup>
<PropertyGroup>
<!--<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>-->
<FileAlignment>512</FileAlignment>
<TargetDestination>Hosting</TargetDestination>
<AssemblyIdentityVersionName>websites</AssemblyIdentityVersionName>
</PropertyGroup>
<!--<Import Condition=" '$(BuildingInsideVisualStudio)'!='true' AND Exists('$(MSBuildToolsPath)\Razzle.Settings.targets')" Project="$(MSBuildToolsPath)\Razzle.Settings.targets" />-->
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.Deployment.WindowsInstaller">
<HintPath>$(PkgWix_Corext)\Microsoft.Deployment.WindowsInstaller.dll</HintPath>
<Private>True</Private>
</Reference>
<Binplace Include="$(OBJECT_ROOT)\$(RelativePath)$(O)HybridConnectionInstallHelper.CA.dll">
<Destination>$(HostingDestination)</Destination>
<NoSymbols>True</NoSymbols>
</Binplace>
</ItemGroup>
<ItemGroup>
<Compile Include="CustomAction.cs" />
<Content Include="CustomAction.config" />
</ItemGroup>
<Import Project="$(CONFROOT)\.targets\Build.Common.targets" />
<Import Project="$(CONFROOT)\.targets\Microsoft.Build.ServiceBus.Babel.targets" />
<!-- <Import Project="$(MSBuildExtensionsPath32)\Override\wix.targets" /> -->
</Project>

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

@ -1,14 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HybridConnectionInstallHelper_csproj", "HybridConnectionInstallHelper.csproj", "{5A86ACC1-2EE7-460E-8496-73A05DFFCC39}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
VSMSBuild|Any CPU = VSMSBuild|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5A86ACC1-2EE7-460E-8496-73A05DFFCC39}.VSMSBuild|Any CPU.ActiveCfg = Debug|Any CPU
{5A86ACC1-2EE7-460E-8496-73A05DFFCC39}.VSMSBuild|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
EndGlobalSection
EndGlobal

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

@ -1,35 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("HybridConnectionInstallHelper")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("HybridConnectionInstallHelper")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5cf93f8a-e602-4082-a7df-f065b02f35cc")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

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

@ -1,17 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Razzle4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsAzure>True</IsAzure>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Razzle.Settings.targets" />
<PropertyGroup>
<MSBuildPasses>4</MSBuildPasses>
</PropertyGroup>
<ItemGroup>
<Binplace Include="$(OBJECT_ROOT)\$(RelativePath)..\InstallHelper\$(O)HybridConnectionInstallHelper.CA.dll">
<Destination>$(HostingDestination)</Destination>
<NoSymbols>True</NoSymbols>
</Binplace>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Razzle.Binplace.targets" />
</Project>

14
LICENSE.txt Normal file
Просмотреть файл

@ -0,0 +1,14 @@
Copyright (c) Microsoft Corporation
All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
CONDITIONS OF ANY KIND, either express or implied. See the License for the
specific language governing permissions and limitations under the License.

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

@ -1,24 +0,0 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.4" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="15.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
<PackageReference Include="xunit" Version="2.3.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1" />
<PackageReference Include="YamlDotNet.Signed" Version="4.3.1" />
<DotNetCliToolReference Include="dotnet-xunit" Version="2.3.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\azbridge\azbridge.csproj" />
<ProjectReference Include="..\Microsoft.Azure.Relay.Bridge\Microsoft.Azure.Relay.Bridge.csproj" />
</ItemGroup>
</Project>

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

@ -3,13 +3,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 15.0.26124.0
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Relay.Bridge", "Microsoft.Azure.Relay.Bridge\Microsoft.Azure.Relay.Bridge.csproj", "{864AE8D8-F770-499B-A9E2-46E07C8FD3D2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Relay.Bridge", "src\Microsoft.Azure.Relay.Bridge\Microsoft.Azure.Relay.Bridge.csproj", "{864AE8D8-F770-499B-A9E2-46E07C8FD3D2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "azbridge", "azbridge\azbridge.csproj", "{AC769774-B065-41E8-B0AB-D15ED6B8D6A8}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "azbridge", "src\azbridge\azbridge.csproj", "{AC769774-B065-41E8-B0AB-D15ED6B8D6A8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "azbridgesvc", "azbridgesvc\azbridgesvc.csproj", "{3F446578-A0EE-465A-B97D-96504CD789E1}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "azbridgesvc", "src\azbridgesvc\azbridgesvc.csproj", "{3F446578-A0EE-465A-B97D-96504CD789E1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Relay.Bridge.Test", "Microsoft.Azure.Relay.Bridge.Test\Microsoft.Azure.Relay.Bridge.Test.csproj", "{8D537DA4-409A-428E-926C-1009906AE5E2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Azure.Relay.Bridge.Tests", "test\Microsoft.Azure.Relay.Bridge.Tests\Microsoft.Azure.Relay.Bridge.Tests.csproj", "{8D537DA4-409A-428E-926C-1009906AE5E2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{81A22557-15D8-47E9-A19E-0335F16B25F3}"
ProjectSection(SolutionItems) = preProject

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

@ -1,105 +0,0 @@

namespace Microsoft.HybridConnectionManager.Test
{
using System;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.HybridConnectionManager.Configuration;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
public class HostirngTest
{
string CreateConfig()
{
string sendListenCxn = "";
string myFile = Path.GetTempFileName();
using (var myFileStream = File.OpenWrite(myFile))
{
using (var textWriter = new StreamWriter(myFileStream, Encoding.UTF8))
{
textWriter.Write(
@"{" +
" \"connections\" : {" +
" \"targets\" : [ " +
" { \"connectionString\":\"" + sendListenCxn + "\", \"hostName\":\"localhost\", \"port\": 11081 }," +
" ]," +
" \"listeners\" : [ " +
" { \"connectionString\":\"" + sendListenCxn + "\", \"hostName\":\"127.110.2.3\", \"port\": 11082 }" +
" ]," +
" }" +
"}");
}
}
return myFile;
}
[Fact]
public void RoundtripTest()
{
var configFileName = CreateConfig();
ConnectionConfig connectionConfig = null;
using (var reader = new StreamReader(configFileName, true))
{
var jr = new JsonTextReader(reader);
JObject config = JObject.Load(jr);
if (config.ContainsKey("connections"))
{
connectionConfig = config["connections"].ToObject<ConnectionConfig>();
}
}
Assert.Equal(3, connectionConfig.Listeners.Count);
Assert.Equal(3, connectionConfig.Targets.Count);
Assert.Equal("Endpoint=sb://test", connectionConfig.Listeners[0].ConnectionString);
Assert.Equal("test1.example.com", connectionConfig.Listeners[0].HostName);
Assert.Equal(81, connectionConfig.Listeners[0].Port);
Assert.Equal("Endpoint=sb://test", connectionConfig.Listeners[1].ConnectionString);
Assert.Equal("test2.example.com", connectionConfig.Listeners[1].HostName);
Assert.Equal(82, connectionConfig.Listeners[1].Port);
Assert.Equal("Endpoint=sb://test", connectionConfig.Listeners[2].ConnectionString);
Assert.Equal("test3.example.com", connectionConfig.Listeners[2].HostName);
Assert.Equal(83, connectionConfig.Listeners[2].Port);
Assert.Equal("Endpoint=sb://test", connectionConfig.Targets[0].ConnectionString);
Assert.Equal("test1.example.com", connectionConfig.Targets[0].HostName);
Assert.Equal(81, connectionConfig.Targets[0].Port);
Assert.Equal("Endpoint=sb://test", connectionConfig.Targets[1].ConnectionString);
Assert.Equal("test2.example.com", connectionConfig.Targets[1].HostName);
Assert.Equal(82, connectionConfig.Targets[1].Port);
Assert.Equal("Endpoint=sb://test", connectionConfig.Targets[2].ConnectionString);
Assert.Equal("test3.example.com", connectionConfig.Targets[2].HostName);
Assert.Equal(83, connectionConfig.Targets[2].Port);
File.Delete(configFileName);
}
[Fact]
public void ConfigSaveLoadFileTest()
{
var configFileName = CreateConfig();
ConnectionConfig connectionConfig = Host.LoadConfig(configFileName);
connectionConfig.Targets.Add(new ConnectionTarget
{
ConnectionString = "sb://foo",
HostName = "localhost",
Port = 8081
});
Host.SaveConfig(configFileName, connectionConfig);
ConnectionConfig connectionConfig2 = Host.LoadConfig(configFileName);
Assert.NotNull(connectionConfig2.Targets.FirstOrDefault(i => i.ConnectionString.Equals("sb://foo")));
}
}
}

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

@ -0,0 +1,7 @@
{
"Default": {
"rules": [
"DefaultCompositeRule"
]
}
}

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

@ -1,25 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Razzle4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsAzure>True</IsAzure>
</PropertyGroup>
<Import Project="$(MSBuildToolsPath)\Razzle.Settings.targets" />
<PropertyGroup>
<MSBuildPasses>4</MSBuildPasses>
</PropertyGroup>
<ItemGroup>
<Binplace Include="$(HostingPath)\HybridConnectivity\HybridConnectionManager\Powershell\Scripts\ConfigureHybridConnectionManager.ps1">
<Destination>$(HostingDestination)\HybridConnectionManager</Destination>
<NoSymbols>True</NoSymbols>
</Binplace>
<Binplace Include="$(HostingPath)\HybridConnectivity\HybridConnectionManager\Powershell\Scripts\HybridConnectionManager.psd1">
<Destination>$(HostingDestination)\HybridConnectionManager</Destination>
<NoSymbols>True</NoSymbols>
</Binplace>
<Binplace Include="$(HostingPath)\HybridConnectivity\HybridConnectionManager\Powershell\Scripts\Microsoft.HybridConnectionManager.Commands.dll-help.xml">
<Destination>$(HostingDestination)\HybridConnectionManager</Destination>
<NoSymbols>True</NoSymbols>
</Binplace>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Razzle.Binplace.targets" />
</Project>

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

@ -1,3 +0,0 @@
import-module $env:ProgramW6432'\Microsoft\HybridConnectionManager\HybridConnectionManager'
Set-HybridConnectionManagerConfiguration -ManagementPort 9352

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

@ -1,215 +0,0 @@
@{
GUID="{501C6A0E-DDDC-4B9B-A31E-0DBC473FB2F7}"
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation. All rights reserved."
ModuleVersion="1.0"
PowerShellVersion="3.0"
ClrVersion="4.0"
RootModule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zARBgNVBAgTCldh
# c2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBD
# b3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIw
# MTACEzMAAABNih/9My438QAAAAAAAE0wDQYJYIZIAWUDBAIBBQCgggEyMBoGCSqG
# SIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQg2rMx4bskgb/j
# w3zMOq1OeP78p9nI6CR6YRWhXvF6q18wgeIGCyqGSIb3DQEJEAIMMYHSMIHPMIHM
# MIGxBBRzKDUfkaXsUziJH7H6X5QSfufbRjCBmDCBgKR+MHwxCzAJBgNVBAYTAlVT
# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK
# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1l
# LVN0YW1wIFBDQSAyMDEwAhMzAAAATYof/TMuN/EAAAAAAABNMBYEFLTs/VkLQbLI
# WHEZG40HS3TeWHKoMA0GCSqGSIb3DQEBCwUABIIBAGhnmTq5piGO0Agp6yiMpvTl
# OkQKsguc2KveQu1F9iSeR6PoACtRQX84eS+ce0LSilJYjYAZ1X1IB7mbOBvNFPf3
# 2Zoo/QkUXLby+AOQblZpm79k5wzWQtBzwASTZhIbGkuJ9G1XWx/ufO6Vn//sS+HF
# VTbhqBZay9ho5HfhzW78s1xdax34jGf4WbpL3ags+9ivyvcU5zq5yMXe33xZgqbJ
# esN9yw3PtJsAbO//O0ktSpadt7Ox9/6z/KOP8tUXslc/WtSJcuhwWjx6d5S5Wcex
# EnyLNnOmcR2Y+TY/XFDcvwVrYAkEt2OeaSEyHMXbuwtdnt8W78I/uYcKelZpIF4=
# SIG # End signature block

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

@ -1,355 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<helpItems xmlns="http://msh" schema="maml">
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10"
xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Add-HybridConnection</command:name>
<maml:description>
<maml:para>You can use this cmdlet to create a new HybridConnection.</maml:para>
</maml:description>
<maml:copyright><maml:para />
</maml:copyright>
<command:verb>Add</command:verb>
<command:noun>HybridConnection</command:noun>
<dev:version />
</command:details>
<maml:description>
<maml:para>Add HybridConnection </maml:para>
</maml:description>
<command:syntax><command:syntaxItem>
<maml:name>Add-HybridConnection</maml:name>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description><maml:para>
This parameter provides a connectionString like
Endpoint=hc://contoso.hybrid.biztalk.windows.net/test;SharedAccessKeyName=defaultListener;SharedAccessKey=[key] .
</maml:para></maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
</command:syntaxItem></command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>This parameter adds the HybridConnection ConnectionString. </maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue></dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:returnValue>
</command:returnValues>
<command:terminatingErrors />
<command:nonTerminatingErrors />
<command:examples>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText></maml:linkText>
<maml:uri />
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10"
xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Update-HybridConnection</command:name>
<maml:description>
<maml:para>You can use this cmdlet to update an existing HybridConnection.</maml:para>
</maml:description>
<maml:copyright>
<maml:para />
</maml:copyright>
<command:verb>Update</command:verb>
<command:noun>HybridConnection</command:noun>
<dev:version />
</command:details>
<maml:description>
<maml:para>Update HybridConnection </maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Update-HybridConnection</maml:name>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>
This parameter provides a connectionString like
Endpoint=hc://contoso.hybrid.biztalk.windows.net/test;SharedAccessKeyName=defaultListener;SharedAccessKey=[key] .
</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>This parameter updates the HybridConnection ConnectionString. The Endpoint value must macth en existing HybridConnection. </maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue></dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:returnValue>
</command:returnValues>
<command:terminatingErrors />
<command:nonTerminatingErrors />
<command:examples>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText></maml:linkText>
<maml:uri />
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10"
xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Remove-HybridConnection</command:name>
<maml:description>
<maml:para>You can use this cmdlet to remove an existing HybridConnection.</maml:para>
</maml:description>
<maml:copyright>
<maml:para />
</maml:copyright>
<command:verb>Remove</command:verb>
<command:noun>HybridConnection</command:noun>
<dev:version />
</command:details>
<maml:description>
<maml:para>Remove HybridConnection </maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Remove-HybridConnection</maml:name>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>
This parameter provides a connectionString like
Endpoint=hc://contoso.hybrid.biztalk.windows.net/test;SharedAccessKeyName=defaultListener;SharedAccessKey=[key] .
</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>This parameter provides the connectionString of the HybridConnection that is to be removed. </maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue></dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:returnValue>
</command:returnValues>
<command:terminatingErrors />
<command:nonTerminatingErrors />
<command:examples>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText></maml:linkText>
<maml:uri />
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10"
xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp">
<command:details>
<command:name>Get-HybridConnection</command:name>
<maml:description>
<maml:para>You can use this cmdlet to list configuration information for all existing HybridConnections or a specific one</maml:para>
</maml:description>
<maml:copyright>
<maml:para />
</maml:copyright>
<command:verb>Get</command:verb>
<command:noun>HybridConnection</command:noun>
<dev:version />
</command:details>
<maml:description>
<maml:para>Get HybridConnection </maml:para>
</maml:description>
<command:syntax>
<command:syntaxItem>
<maml:name>Get-HybridConnection</maml:name>
<command:parameter required="optional" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>
This parameter provides a connectionString like Endpoint=hc://contoso.hybrid.biztalk.windows.net/test .
</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
</command:parameter>
</command:syntaxItem>
</command:syntax>
<command:parameters>
<command:parameter required="optional" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases="">
<maml:name>ConnectionString</maml:name>
<maml:description>
<maml:para>This parameter (if provided) retrieves configuration information for a specific HybridConnection. </maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
<maml:name>String</maml:name>
<maml:uri />
</dev:type>
<dev:defaultValue></dev:defaultValue>
</command:parameter>
</command:parameters>
<command:inputTypes>
<command:inputType>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:inputType>
</command:inputTypes>
<command:returnValues>
<command:returnValue>
<dev:type>
<maml:name></maml:name>
<maml:uri></maml:uri>
<maml:description>
<maml:para />
</maml:description>
</dev:type>
<maml:description></maml:description>
</command:returnValue>
</command:returnValues>
<command:terminatingErrors />
<command:nonTerminatingErrors />
<command:examples>
</command:examples>
<maml:relatedLinks>
<maml:navigationLink>
<maml:linkText></maml:linkText>
<maml:uri />
</maml:navigationLink>
</maml:relatedLinks>
</command:command>
</helpItems>

43
README.md Normal file
Просмотреть файл

@ -0,0 +1,43 @@
Azure Relay Bridge
=================
[![Build Status](https://travis-ci.org/clemensv/azure-relay-aspnetserver.svg?branch=relay)](https://travis-ci.org/clemensv/azure-relay-aspnetserver)
This repo contains a web server for ASP.NET Core based on Azure Relay Hybrid Connections HTTP.
The integration supports most ASP.NET scenarios, with a few exceptions. WebSocket support will
be added in the near future, for instance.
To use the extension, take the following steps:
1. Add the Microsoft.Azure.Relay.AspNetCore assembly to your project. The assembly must be built from
this sampe repo at the moment. An "official" Nuget package will be available in a little while.
2. [Create a Hybrid Connection](https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-hybrid-connections-http-requests-dotnet-get-started)
3. After you have created the Hybrid Connection, find its "Shared Access Policies" portal tab and
add a new rule "listen" with the Listen-permission checked.
4. Once the rule has been created, select it and copy its connection string.
The connection string contains all information to set up a listener. The samples in the
samples subfolder take the connection string as input.
The `.UserAzureRelay()` hosting extension is available via the `Microsoft.Azure.Relay.AspNetCore` namespace.
You MUST remove all IISExpress references in the launchSettings.json of any ASP.NET Core application you create
from a template. The IIS Express settings are incompatible with this extension.
```
using Microsoft.Azure.Relay.AspNetCore;
var host = new WebHostBuilder()
.ConfigureLogging(factory => factory.AddConsole())
.UseStartup<Startup>()
.UseAzureRelay(options =>
{
options.UrlPrefixes.Add(connectionString);
})
.Build();
host.Run();
```

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

@ -1,36 +0,0 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("mshcmsvc")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("mshcmsvc")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("3f446578-a0ee-465a-b97d-96504cd789e1")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

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

@ -1,101 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{3F446578-A0EE-465A-B97D-96504CD789E1}</ProjectGuid>
<OutputType>WinExe</OutputType>
<RootNamespace>mshcmsvc</RootNamespace>
<AssemblyName>mshcmsvc</AssemblyName>
<TargetFrameworkVersion>v4.6.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="McMaster.Extensions.CommandLineUtils, Version=2.2.4.0, Culture=neutral, PublicKeyToken=6f71cb76b82f055d, processorArchitecture=MSIL">
<HintPath>..\packages\McMaster.Extensions.CommandLineUtils.2.2.4\lib\net45\McMaster.Extensions.CommandLineUtils.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Extensions.CommandLineUtils, Version=1.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Extensions.CommandLineUtils.1.1.1\lib\net451\Microsoft.Extensions.CommandLineUtils.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Console, Version=4.0.1.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Console.4.3.1\lib\net46\System.Console.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.IO.4.3.0\lib\net462\System.IO.dll</HintPath>
</Reference>
<Reference Include="System.Reflection, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll</HintPath>
</Reference>
<Reference Include="System.Reflection.TypeExtensions, Version=4.1.2.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Reflection.TypeExtensions.4.4.0\lib\net461\System.Reflection.TypeExtensions.dll</HintPath>
</Reference>
<Reference Include="System.Runtime, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.Extensions, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll</HintPath>
</Reference>
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Installer\HybridConnectionServiceInstaller.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RelayBridgeService.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="RelayBridgeService.Designer.cs">
<DependentUpon>RelayBridgeService.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Azure.Relay.Bridge\Microsoft.Azure.Relay.Bridge.csproj">
<Project>{864ae8d8-f770-499b-a9e2-46e07c8fd3d2}</Project>
<Name>Microsoft.Azure.Relay.Bridge</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

2
build.cmd Normal file
Просмотреть файл

@ -0,0 +1,2 @@
@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' default-build %*; exit $LASTEXITCODE"

8
build.sh Normal file
Просмотреть файл

@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Call "sync" between "chmod" and execution to prevent "text file busy" error in Docker (aufs)
chmod +x "$DIR/run.sh"; sync
"$DIR/run.sh" default-build "$@"

Двоичные данные
build/Key.snk Normal file

Двоичный файл не отображается.

35
build/dependencies.props Normal file
Просмотреть файл

@ -0,0 +1,35 @@
<Project>
<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<PropertyGroup Label="Package Versions">
<InternalAspNetCoreSdkPackageVersion>2.1.0-rtm-15783</InternalAspNetCoreSdkPackageVersion>
<MicrosoftAspNetCoreAllPackageVersion>2.1.0-rtm-30721</MicrosoftAspNetCoreAllPackageVersion>
<MicrosoftAspNetCoreAuthenticationCorePackageVersion>2.1.0-rtm-30721</MicrosoftAspNetCoreAuthenticationCorePackageVersion>
<MicrosoftAspNetCoreHostingPackageVersion>2.1.0-rtm-30721</MicrosoftAspNetCoreHostingPackageVersion>
<MicrosoftAspNetCoreTestingPackageVersion>2.1.0-rtm-30721</MicrosoftAspNetCoreTestingPackageVersion>
<MicrosoftExtensionsLoggingConsolePackageVersion>2.1.0-rtm-30721</MicrosoftExtensionsLoggingConsolePackageVersion>
<MicrosoftNETCoreApp20PackageVersion>2.0.0</MicrosoftNETCoreApp20PackageVersion>
<MicrosoftNETCoreApp21PackageVersion>2.1.0-rtm-26502-02</MicrosoftNETCoreApp21PackageVersion>
<MicrosoftNetHttpHeadersPackageVersion>2.1.0-rtm-30721</MicrosoftNetHttpHeadersPackageVersion>
<MicrosoftNETTestSdkPackageVersion>15.6.1</MicrosoftNETTestSdkPackageVersion>
<NETStandardLibrary20PackageVersion>2.0.3</NETStandardLibrary20PackageVersion>
<SystemNetHttpWinHttpHandlerPackageVersion>4.5.0-rtm-26502-02</SystemNetHttpWinHttpHandlerPackageVersion>
<SystemThreadingTasksDataflowPackageVersion>4.8.0</SystemThreadingTasksDataflowPackageVersion>
<SystemConsolePackageVersion>4.3.1</SystemConsolePackageVersion>
<SystemIOPackageVersion>4.3.0</SystemIOPackageVersion>
<SystemConfigurationPackageVersion>4.3.0</SystemConfigurationPackageVersion>
<SystemDiagnosticsTracingPackageVersion>4.3.0</SystemDiagnosticsTracingPackageVersion>
<SystemNetHttpPackageVersion>4.3.1</SystemNetHttpPackageVersion>
<SystemNetNameResolutionPackageVersion>4.3.0</SystemNetNameResolutionPackageVersion>
<YamlDotNetSignedPackageVersion>4.3.1</YamlDotNetSignedPackageVersion>
<XunitPackageVersion>2.3.1</XunitPackageVersion>
<DotnetXunitPackageVersion>2.3.1</DotnetXunitPackageVersion>
<XunitRunnerVisualStudioPackageVersion>2.4.0-beta.1.build3945</XunitRunnerVisualStudioPackageVersion>
<NewtonsoftJsonPackageVersion>11.0.2</NewtonsoftJsonPackageVersion>
<MicrosoftAzureRelayPackageVersion>1.1.0-preview</MicrosoftAzureRelayPackageVersion>
<McMasterExtensionsCommandLineUtilsPackageVersion>2.2.4</McMasterExtensionsCommandLineUtilsPackageVersion>
</PropertyGroup>
<Import Project="$(DotNetPackageVersionPropsPath)" Condition=" '$(DotNetPackageVersionPropsPath)' != '' " />
</Project>

15
build/repo.props Normal file
Просмотреть файл

@ -0,0 +1,15 @@
<Project>
<Import Project="dependencies.props" />
<PropertyGroup>
<!-- These properties are use by the automation that updates dependencies.props -->
<LineupPackageId>Internal.AspNetCore.Universe.Lineup</LineupPackageId>
<LineupPackageRestoreSource>https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json</LineupPackageRestoreSource>
</PropertyGroup>
<ItemGroup>
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp20PackageVersion)" />
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp21PackageVersion)" />
<DotNetCoreRuntime Include="$(MicrosoftNETCoreApp22PackageVersion)" />
</ItemGroup>
</Project>

17
build/sources.props Normal file
Просмотреть файл

@ -0,0 +1,17 @@
<Project>
<Import Project="$(DotNetRestoreSourcePropsPath)" Condition="'$(DotNetRestoreSourcePropsPath)' != ''"/>
<PropertyGroup Label="RestoreSources">
<RestoreSources>$(DotNetRestoreSources)</RestoreSources>
<RestoreSources Condition="'$(DotNetBuildOffline)' != 'true' AND '$(AspNetUniverseBuildOffline)' != 'true' ">
$(RestoreSources);
https://dotnet.myget.org/F/dotnet-core/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-dev/api/v3/index.json;
https://dotnet.myget.org/F/aspnetcore-tools/api/v3/index.json;
</RestoreSources>
<RestoreSources Condition="'$(DotNetBuildOffline)' != 'true'">
$(RestoreSources);
https://api.nuget.org/v3/index.json;
</RestoreSources>
</PropertyGroup>
</Project>

2
korebuild-lock.txt Normal file
Просмотреть файл

@ -0,0 +1,2 @@
version:2.2.0-preview1-17089
commithash:cd9efd5b43df7cfab45517688eac2ca72313b009

4
korebuild.json Normal file
Просмотреть файл

@ -0,0 +1,4 @@
{
"$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json",
"channel": "dev"
}

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

@ -0,0 +1,42 @@
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<!-- Use baseline from package restored in external/harvestPackages. -->
<CoreFxBaseLinePackageName>Microsoft.Private.PackageBaseline</CoreFxBaseLinePackageName>
<!-- NuGet doesn't currently write out the versionless props/targets for this, so manually pull it in from packages folder -->
<CoreFxBaseLinePackageProps Condition="'$(CoreFxBaseLinePackageProps)' == ''">$(PackagesDir)$(CoreFxBaseLinePackageName)/$(CoreFxBaseLinePackageVersion)/build/$(CoreFxBaseLinePackageName).props</CoreFxBaseLinePackageProps>
<PackageIndexFile>$(MSBuildThisFileDirectory)\packageIndex.json</PackageIndexFile>
</PropertyGroup>
<ItemGroup>
<PackageIndex Include="$(PackageIndexFile)" />
</ItemGroup>
<!-- bring in common baseline -->
<Import Condition="Exists('$(CoreFxBaseLinePackageProps)')" Project="$(CoreFxBaseLinePackageProps)" />
<Target Name="EnsureCoreFxBaseLine" Condition="'$(MSBuildProjectExtension)' == '.pkgproj'" BeforeTargets="Build">
<Error Condition="!Exists('$(CoreFxBaseLinePackageProps)')"
Text="Error '$(CoreFxBaseLinePackageProps)' does not exist, ensure you have restored packages before building this project" />
</Target>
<!--
Below targets should moved to packaging.targets in BuildTools but keeping in corefx for convenience right now - (ported from CoreFx to WCF)
-->
<Target Name="BlockStable" Condition="'$(BlockStable)' == 'true'" AfterTargets="CalculatePackageVersion">
<!-- DO NOT ship this packages as stable -->
<Error Condition="!$(PackageVersion.Contains('-'))" Text="Package $(Id) should not be built stable" />
</Target>
<!-- Get the package version if it isn't marked as block stable -->
<Target Name="GetPackageIdentityIfStable"
Returns="@(_StablePackageIdentity)">
<ItemGroup Condition="'$(BlockStable)' != 'true'">
<_StablePackageIdentity Include="$(Id)">
<Version>$(PackageVersion)</Version>
</_StablePackageIdentity>
</ItemGroup>
</Target>
</Project>

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

@ -0,0 +1,143 @@
{
"Packages": {
"_Comments": {
"_StableVersions": [
"Released versions."
],
"_BaselineVersion": [
"Used to determine the minimum version used for all packages in the repo."
],
"_AssemblyVersionInPackageVersion": [
"Used to understand what version of a package to reference.",
"Then raise the package version of the reference so that its at least the baseline version."
]
},
"System.Private.ServiceModel": {
"StableVersions": [
"4.0.0",
"4.1.0",
"4.3.0",
"4.3.1"
],
"BaselineVersion": "4.6.0",
"InboxOn": {},
"AssemblyVersionInPackageVersion": {
"4.1.1.0": "4.3.0",
"4.1.1.1": "4.3.1",
"4.1.2.0": "4.4.0",
"4.5.0.0": "4.5.0",
"4.6.0.0": "4.6.0"
}
},
"System.ServiceModel.Duplex": {
"StableVersions": [
"4.0.0",
"4.0.1",
"4.3.0",
"4.3.1"
],
"BaselineVersion": "4.6.0",
"InboxOn": {
"uap10.0.16299": "4.1.1.0"
},
"AssemblyVersionInPackageVersion": {
"4.0.0.0": "4.0.0",
"4.0.1.0": "4.0.1",
"4.0.2.0": "4.3.1",
"4.1.0.0": "4.4.0",
"4.5.0.0": "4.5.0",
"4.6.0.0": "4.6.0"
}
},
"System.ServiceModel.Http": {
"StableVersions": [
"3.9.0",
"4.0.0",
"4.0.10",
"4.1.0",
"4.3.0",
"4.3.1"
],
"BaselineVersion": "4.6.0",
"InboxOn": {
"uap10.0.16299": "4.1.3.0"
},
"AssemblyVersionInPackageVersion": {
"3.9.0.0": "3.9.0",
"4.0.0.0": "4.0.0",
"4.0.10.0": "4.0.10",
"4.1.0.0": "4.1.0",
"4.1.1.0": "4.3.1",
"4.1.2.0": "4.4.0",
"4.5.0.0": "4.5.0",
"4.6.0.0": "4.6.0"
}
},
"System.ServiceModel.NetTcp": {
"StableVersions": [
"4.0.0",
"4.1.0",
"4.3.0",
"4.3.1"
],
"BaselineVersion": "4.6.0",
"InboxOn": {
"uap10.0.16299": "4.1.3.0"
},
"AssemblyVersionInPackageVersion": {
"4.0.0.0": "4.0.0",
"4.1.0.0": "4.1.0",
"4.1.1.0": "4.3.1",
"4.1.2.0": "4.4.0",
"4.5.0.0": "4.5.0",
"4.6.0.0": "4.6.0"
}
},
"System.ServiceModel.Primitives": {
"StableVersions": [
"3.9.0",
"4.0.0",
"4.1.0",
"4.3.0",
"4.3.1"
],
"BaselineVersion": "4.6.0",
"InboxOn": {
"uap10.0.16299": "4.2.1.0"
},
"AssemblyVersionInPackageVersion": {
"3.9.0.0": "3.9.0",
"4.0.0.0": "4.0.0",
"4.1.0.0": "4.1.0",
"4.1.1.0": "4.3.1",
"4.2.0.0": "4.4.0",
"4.5.0.0": "4.5.0",
"4.6.0.0": "4.6.0"
}
},
"System.ServiceModel.Security": {
"StableVersions": [
"3.9.0",
"4.0.0",
"4.0.1",
"4.3.0",
"4.3.1"
],
"BaselineVersion": "4.6.0",
"InboxOn": {
"uap10.0.16299": "4.0.4.0"
},
"AssemblyVersionInPackageVersion": {
"3.9.0.0": "3.9.0",
"4.0.0.0": "4.0.0",
"4.0.1.0": "4.0.1",
"4.0.2.0": "4.3.1",
"4.0.3.0": "4.4.0",
"4.5.0.0": "4.5.0",
"4.6.0.0": "4.6.0"
}
}
},
"ModulesToPackages": {},
"MetaPackages": {}
}

80
pkg/descriptions.json Normal file
Просмотреть файл

@ -0,0 +1,80 @@
[
{
"Name": "RuntimePackage",
"Description": "Internal implementation package not meant for direct consumption. Please do not reference directly.",
"CommonTypes": [ ]
},
{
"Name": "NuGet3MinVersion",
"Description": "When using NuGet 3.x this package requires at least version {0}.",
"CommonTypes": [ ]
},
{
"Name": "System.Private.ServiceModel",
"Description": "Internal implementation package not meant for direct consumption. Please do not reference directly. Provides implementation of System.ServiceModel packages.",
"CommonTypes": [ ]
},
{
"Name": "System.ServiceModel.Duplex",
"Description": "Provides classes for consuming and communicating with duplex services.",
"CommonTypes": [
"System.ServiceModel.DuplexClientBase<TChannel>",
"System.ServiceModel.InstanceContext"
]
},
{
"Name": "System.ServiceModel.Http",
"Description": "Provides classes that allow applications to consume HTTP and WebSocket web services. Use the System.ServiceModel.BasicHttpBinding class for communication with ASMX-based web services and other services that conform to the WS-I Basic Profile 1.1. Whereas, use the System.ServiceModel.NetHttpBinding class for communication with .NET-based WebSocket services.",
"CommonTypes": [
"System.ServiceModel.BasicHttpBinding",
"System.ServiceModel.Channels.HttpRequestMessageProperty",
"System.ServiceModel.Channels.HttpResponseMessageProperty",
"System.ServiceModel.Channels.HttpTransportBindingElement",
"System.ServiceModel.Channels.HttpsTransportBindingElement",
"System.ServiceModel.HttpClientCredentialType",
"System.ServiceModel.BasicHttpSecurityMode",
"System.ServiceModel.HttpTransportSecurity",
"System.ServiceModel.BasicHttpMessageCredentialType",
"System.ServiceModel.HttpBindingBase"
]
},
{
"Name": "System.ServiceModel.NetTcp",
"Description": "Provides types for consuming and communicating with WCF services over the Transmission Control Protocol (TCP).",
"CommonTypes": [
"System.ServiceModel.NetTcpBinding",
"System.ServiceModel.NetTcpSecurity"
]
},
{
"Name": "System.ServiceModel.Primitives",
"Description": "Provides common Windows Communication Foundation (WCF) types for consuming and communicating with services.",
"CommonTypes": [
"System.ServiceModel.ClientBase<TChannel>",
"System.ServiceModel.IClientChannel",
"System.ServiceModel.ICommunicationObject",
"System.ServiceModel.Channels.IChannel",
"System.ServiceModel.IContextChannel",
"System.ServiceModel.IExtensibleObject<T>",
"System.ServiceModel.DataContractFormatAttribute",
"System.ServiceModel.Description.IOperationBehavior",
"System.ServiceModel.Channels.Message",
"System.ServiceModel.FaultException<TDetail>"
]
},
{
"Name": "System.ServiceModel.Security",
"Description": "Provides common security types for consuming and communicating with services.",
"CommonTypes": [
"System.ServiceModel.DnsEndpointIdentity",
"System.ServiceModel.MessageSecurityVersion",
"System.ServiceModel.UpnEndpointIdentity",
"System.ServiceModel.SpnEndpointIdentity"
]
},
{
"Name": "dotnet-svcutil.xmlserializer",
"Description": "Generate XML serializers for types used by Service Contracts in an assembly",
"CommonTypes": []
}
]

2
run.cmd Normal file
Просмотреть файл

@ -0,0 +1,2 @@
@ECHO OFF
PowerShell -NoProfile -NoLogo -ExecutionPolicy unrestricted -Command "[System.Threading.Thread]::CurrentThread.CurrentCulture = ''; [System.Threading.Thread]::CurrentThread.CurrentUICulture = '';& '%~dp0run.ps1' %*; exit $LASTEXITCODE"

196
run.ps1 Normal file
Просмотреть файл

@ -0,0 +1,196 @@
#!/usr/bin/env powershell
#requires -version 4
<#
.SYNOPSIS
Executes KoreBuild commands.
.DESCRIPTION
Downloads korebuild if required. Then executes the KoreBuild command. To see available commands, execute with `-Command help`.
.PARAMETER Command
The KoreBuild command to run.
.PARAMETER Path
The folder to build. Defaults to the folder containing this script.
.PARAMETER Channel
The channel of KoreBuild to download. Overrides the value from the config file.
.PARAMETER DotNetHome
The directory where .NET Core tools will be stored.
.PARAMETER ToolsSource
The base url where build tools can be downloaded. Overrides the value from the config file.
.PARAMETER Update
Updates KoreBuild to the latest version even if a lock file is present.
.PARAMETER ConfigFile
The path to the configuration file that stores values. Defaults to korebuild.json.
.PARAMETER ToolsSourceSuffix
The Suffix to append to the end of the ToolsSource. Useful for query strings in blob stores.
.PARAMETER Arguments
Arguments to be passed to the command
.NOTES
This function will create a file $PSScriptRoot/korebuild-lock.txt. This lock file can be committed to source, but does not have to be.
When the lockfile is not present, KoreBuild will create one using latest available version from $Channel.
The $ConfigFile is expected to be an JSON file. It is optional, and the configuration values in it are optional as well. Any options set
in the file are overridden by command line parameters.
.EXAMPLE
Example config file:
```json
{
"$schema": "https://raw.githubusercontent.com/aspnet/BuildTools/dev/tools/korebuild.schema.json",
"channel": "dev",
"toolsSource": "https://aspnetcore.blob.core.windows.net/buildtools"
}
```
#>
[CmdletBinding(PositionalBinding = $false)]
param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$Command,
[string]$Path = $PSScriptRoot,
[Alias('c')]
[string]$Channel,
[Alias('d')]
[string]$DotNetHome,
[Alias('s')]
[string]$ToolsSource,
[Alias('u')]
[switch]$Update,
[string]$ConfigFile,
[string]$ToolsSourceSuffix,
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$Arguments
)
Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop'
#
# Functions
#
function Get-KoreBuild {
$lockFile = Join-Path $Path 'korebuild-lock.txt'
if (!(Test-Path $lockFile) -or $Update) {
Get-RemoteFile "$ToolsSource/korebuild/channels/$Channel/latest.txt" $lockFile $ToolsSourceSuffix
}
$version = Get-Content $lockFile | Where-Object { $_ -like 'version:*' } | Select-Object -first 1
if (!$version) {
Write-Error "Failed to parse version from $lockFile. Expected a line that begins with 'version:'"
}
$version = $version.TrimStart('version:').Trim()
$korebuildPath = Join-Paths $DotNetHome ('buildtools', 'korebuild', $version)
if (!(Test-Path $korebuildPath)) {
Write-Host -ForegroundColor Magenta "Downloading KoreBuild $version"
New-Item -ItemType Directory -Path $korebuildPath | Out-Null
$remotePath = "$ToolsSource/korebuild/artifacts/$version/korebuild.$version.zip"
try {
$tmpfile = Join-Path ([IO.Path]::GetTempPath()) "KoreBuild-$([guid]::NewGuid()).zip"
Get-RemoteFile $remotePath $tmpfile $ToolsSourceSuffix
if (Get-Command -Name 'Expand-Archive' -ErrorAction Ignore) {
# Use built-in commands where possible as they are cross-plat compatible
Expand-Archive -Path $tmpfile -DestinationPath $korebuildPath
}
else {
# Fallback to old approach for old installations of PowerShell
Add-Type -AssemblyName System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::ExtractToDirectory($tmpfile, $korebuildPath)
}
}
catch {
Remove-Item -Recurse -Force $korebuildPath -ErrorAction Ignore
throw
}
finally {
Remove-Item $tmpfile -ErrorAction Ignore
}
}
return $korebuildPath
}
function Join-Paths([string]$path, [string[]]$childPaths) {
$childPaths | ForEach-Object { $path = Join-Path $path $_ }
return $path
}
function Get-RemoteFile([string]$RemotePath, [string]$LocalPath, [string]$RemoteSuffix) {
if ($RemotePath -notlike 'http*') {
Copy-Item $RemotePath $LocalPath
return
}
$retries = 10
while ($retries -gt 0) {
$retries -= 1
try {
Invoke-WebRequest -UseBasicParsing -Uri $($RemotePath + $RemoteSuffix) -OutFile $LocalPath
return
}
catch {
Write-Verbose "Request failed. $retries retries remaining"
}
}
Write-Error "Download failed: '$RemotePath'."
}
#
# Main
#
# Load configuration or set defaults
$Path = Resolve-Path $Path
if (!$ConfigFile) { $ConfigFile = Join-Path $Path 'korebuild.json' }
if (Test-Path $ConfigFile) {
try {
$config = Get-Content -Raw -Encoding UTF8 -Path $ConfigFile | ConvertFrom-Json
if ($config) {
if (!($Channel) -and (Get-Member -Name 'channel' -InputObject $config)) { [string] $Channel = $config.channel }
if (!($ToolsSource) -and (Get-Member -Name 'toolsSource' -InputObject $config)) { [string] $ToolsSource = $config.toolsSource}
}
}
catch {
Write-Warning "$ConfigFile could not be read. Its settings will be ignored."
Write-Warning $Error[0]
}
}
if (!$DotNetHome) {
$DotNetHome = if ($env:DOTNET_HOME) { $env:DOTNET_HOME } `
elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} `
elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}`
else { Join-Path $PSScriptRoot '.dotnet'}
}
if (!$Channel) { $Channel = 'dev' }
if (!$ToolsSource) { $ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools' }
# Execute
$korebuildPath = Get-KoreBuild
Import-Module -Force -Scope Local (Join-Path $korebuildPath 'KoreBuild.psd1')
try {
Set-KoreBuildSettings -ToolsSource $ToolsSource -DotNetHome $DotNetHome -RepoPath $Path -ConfigFile $ConfigFile
Invoke-KoreBuildCommand $Command @Arguments
}
finally {
Remove-Module 'KoreBuild' -ErrorAction Ignore
}

231
run.sh Normal file
Просмотреть файл

@ -0,0 +1,231 @@
#!/usr/bin/env bash
set -euo pipefail
#
# variables
#
RESET="\033[0m"
RED="\033[0;31m"
YELLOW="\033[0;33m"
MAGENTA="\033[0;95m"
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
[ -z "${DOTNET_HOME:-}" ] && DOTNET_HOME="$HOME/.dotnet"
verbose=false
update=false
repo_path="$DIR"
channel=''
tools_source=''
tools_source_suffix=''
#
# Functions
#
__usage() {
echo "Usage: $(basename "${BASH_SOURCE[0]}") command [options] [[--] <Arguments>...]"
echo ""
echo "Arguments:"
echo " command The command to be run."
echo " <Arguments>... Arguments passed to the command. Variable number of arguments allowed."
echo ""
echo "Options:"
echo " --verbose Show verbose output."
echo " -c|--channel <CHANNEL> The channel of KoreBuild to download. Overrides the value from the config file.."
echo " --config-file <FILE> The path to the configuration file that stores values. Defaults to korebuild.json."
echo " -d|--dotnet-home <DIR> The directory where .NET Core tools will be stored. Defaults to '\$DOTNET_HOME' or '\$HOME/.dotnet."
echo " --path <PATH> The directory to build. Defaults to the directory containing the script."
echo " -s|--tools-source|-ToolsSource <URL> The base url where build tools can be downloaded. Overrides the value from the config file."
echo " --tools-source-suffix|-ToolsSourceSuffix <SUFFIX> The suffix to append to tools-source. Useful for query strings."
echo " -u|--update Update to the latest KoreBuild even if the lock file is present."
echo ""
echo "Description:"
echo " This function will create a file \$DIR/korebuild-lock.txt. This lock file can be committed to source, but does not have to be."
echo " When the lockfile is not present, KoreBuild will create one using latest available version from \$channel."
if [[ "${1:-}" != '--no-exit' ]]; then
exit 2
fi
}
get_korebuild() {
local version
local lock_file="$repo_path/korebuild-lock.txt"
if [ ! -f "$lock_file" ] || [ "$update" = true ]; then
__get_remote_file "$tools_source/korebuild/channels/$channel/latest.txt" "$lock_file" "$tools_source_suffix"
fi
version="$(grep 'version:*' -m 1 "$lock_file")"
if [[ "$version" == '' ]]; then
__error "Failed to parse version from $lock_file. Expected a line that begins with 'version:'"
return 1
fi
version="$(echo "${version#version:}" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')"
local korebuild_path="$DOTNET_HOME/buildtools/korebuild/$version"
{
if [ ! -d "$korebuild_path" ]; then
mkdir -p "$korebuild_path"
local remote_path="$tools_source/korebuild/artifacts/$version/korebuild.$version.zip"
tmpfile="$(mktemp)"
echo -e "${MAGENTA}Downloading KoreBuild ${version}${RESET}"
if __get_remote_file "$remote_path" "$tmpfile" "$tools_source_suffix"; then
unzip -q -d "$korebuild_path" "$tmpfile"
fi
rm "$tmpfile" || true
fi
source "$korebuild_path/KoreBuild.sh"
} || {
if [ -d "$korebuild_path" ]; then
echo "Cleaning up after failed installation"
rm -rf "$korebuild_path" || true
fi
return 1
}
}
__error() {
echo -e "${RED}error: $*${RESET}" 1>&2
}
__warn() {
echo -e "${YELLOW}warning: $*${RESET}"
}
__machine_has() {
hash "$1" > /dev/null 2>&1
return $?
}
__get_remote_file() {
local remote_path=$1
local local_path=$2
local remote_path_suffix=$3
if [[ "$remote_path" != 'http'* ]]; then
cp "$remote_path" "$local_path"
return 0
fi
local failed=false
if __machine_has wget; then
wget --tries 10 --quiet -O "$local_path" "${remote_path}${remote_path_suffix}" || failed=true
else
failed=true
fi
if [ "$failed" = true ] && __machine_has curl; then
failed=false
curl --retry 10 -sSL -f --create-dirs -o "$local_path" "${remote_path}${remote_path_suffix}" || failed=true
fi
if [ "$failed" = true ]; then
__error "Download failed: $remote_path" 1>&2
return 1
fi
}
#
# main
#
command="${1:-}"
shift
while [[ $# -gt 0 ]]; do
case $1 in
-\?|-h|--help)
__usage --no-exit
exit 0
;;
-c|--channel|-Channel)
shift
channel="${1:-}"
[ -z "$channel" ] && __usage
;;
--config-file|-ConfigFile)
shift
config_file="${1:-}"
[ -z "$config_file" ] && __usage
if [ ! -f "$config_file" ]; then
__error "Invalid value for --config-file. $config_file does not exist."
exit 1
fi
;;
-d|--dotnet-home|-DotNetHome)
shift
DOTNET_HOME="${1:-}"
[ -z "$DOTNET_HOME" ] && __usage
;;
--path|-Path)
shift
repo_path="${1:-}"
[ -z "$repo_path" ] && __usage
;;
-s|--tools-source|-ToolsSource)
shift
tools_source="${1:-}"
[ -z "$tools_source" ] && __usage
;;
--tools-source-suffix|-ToolsSourceSuffix)
shift
tools_source_suffix="${1:-}"
[ -z "$tools_source_suffix" ] && __usage
;;
-u|--update|-Update)
update=true
;;
--verbose|-Verbose)
verbose=true
;;
--)
shift
break
;;
*)
break
;;
esac
shift
done
if ! __machine_has unzip; then
__error 'Missing required command: unzip'
exit 1
fi
if ! __machine_has curl && ! __machine_has wget; then
__error 'Missing required command. Either wget or curl is required.'
exit 1
fi
[ -z "${config_file:-}" ] && config_file="$repo_path/korebuild.json"
if [ -f "$config_file" ]; then
if __machine_has jq ; then
if jq '.' "$config_file" >/dev/null ; then
config_channel="$(jq -r 'select(.channel!=null) | .channel' "$config_file")"
config_tools_source="$(jq -r 'select(.toolsSource!=null) | .toolsSource' "$config_file")"
else
__warn "$config_file is invalid JSON. Its settings will be ignored."
fi
elif __machine_has python ; then
if python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'))" >/dev/null ; then
config_channel="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['channel'] if 'channel' in obj else '')")"
config_tools_source="$(python -c "import json,codecs;obj=json.load(codecs.open('$config_file', 'r', 'utf-8-sig'));print(obj['toolsSource'] if 'toolsSource' in obj else '')")"
else
__warn "$config_file is invalid JSON. Its settings will be ignored."
fi
else
__warn 'Missing required command: jq or pyton. Could not parse the JSON file. Its settings will be ignored.'
fi
[ ! -z "${config_channel:-}" ] && channel="$config_channel"
[ ! -z "${config_tools_source:-}" ] && tools_source="$config_tools_source"
fi
[ -z "$channel" ] && channel='dev'
[ -z "$tools_source" ] && tools_source='https://aspnetcore.blob.core.windows.net/buildtools'
get_korebuild
set_korebuildsettings "$tools_source" "$DOTNET_HOME" "$repo_path" "$config_file"
invoke_korebuild_command "$command" "$@"

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

@ -0,0 +1,7 @@
<Project>
<Import Project="..\Directory.Build.props" />
<ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
</ItemGroup>
</Project>

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

@ -6,15 +6,13 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.4" />
<PackageReference Include="Microsoft.Azure.Relay" Version="1.0.0" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.1" />
<PackageReference Include="PowerShellStandard.Library" Version="3.0.0-preview-01" />
<PackageReference Include="System.Diagnostics.Tracing" Version="4.3.0" />
<PackageReference Include="System.Net.Http" Version="4.3.3" />
<PackageReference Include="System.Net.NameResolution" Version="4.3.0" />
<PackageReference Include="System.Runtime.Serialization.Json" Version="4.3.0" />
<PackageReference Include="YamlDotNet.Signed" Version="4.3.1" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="$(McMasterExtensionsCommandLineUtilsPackageVersion)" />
<PackageReference Include="Microsoft.Azure.Relay" Version="$(MicrosoftAzureRelayPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<PackageReference Include="System.Diagnostics.Tracing" Version="$(SystemDiagnosticsTracingPackageVersion)" />
<PackageReference Include="System.Net.Http" Version="$(SystemNetHttpPackageVersion)" />
<PackageReference Include="System.Net.NameResolution" Version="$(SystemNetNameResolutionPackageVersion)" />
<PackageReference Include="YamlDotNet.Signed" Version="$(YamlDotNetSignedPackageVersion)" />
</ItemGroup>
<ItemGroup>

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

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

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

@ -7,7 +7,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="2.2.4" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="$(McMasterExtensionsCommandLineUtilsPackageVersion)" />
</ItemGroup>
<ItemGroup>

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

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

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

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

@ -0,0 +1,35 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net462</TargetFrameworks>
<RuntimeIdentifiers>win-x64</RuntimeIdentifiers>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="$(McMasterExtensionsCommandLineUtilsPackageVersion)" />
<PackageReference Include="System.Console" Version="$(SystemConsolePackageVersion)" />
<PackageReference Include="System.IO" Version="$(SystemIOPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Microsoft.Azure.Relay.Bridge\Microsoft.Azure.Relay.Bridge.csproj" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.ComponentModel.Composition" />
<Reference Include="System.ComponentModel.DataAnnotations" />
<Reference Include="System.Configuration" />
<Reference Include="System.Configuration.Install" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.ServiceProcess" />
<Reference Include="System.Xml" />
</ItemGroup>
</Project>

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

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

@ -0,0 +1,18 @@
<Project>
<Import Project="..\Directory.Build.props" />
<PropertyGroup>
<DeveloperBuildTestTfms>netcoreapp2.1</DeveloperBuildTestTfms>
<StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">$(StandardTestTfms)</StandardTestTfms>
<StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
<PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
<PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" />
</ItemGroup>
</Project>

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

@ -95,7 +95,7 @@ namespace Microsoft.Azure.Relay.Bridge.Test
[Fact]
public async Task CommandLineMaxTest()
public void CommandLineMaxTest()
{
bool callbackInvoked = false;
CommandLineSettings.Run(CreateMaxCommandLine().Split(' '),

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

@ -0,0 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netcoreapp2.0;netcoreapp2.1</TargetFrameworks>
<RuntimeIdentifiers>win-x64;osx-x64;linux-x64</RuntimeIdentifiers>
<IsPackable>false</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="$(McMasterExtensionsCommandLineUtilsPackageversion)" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
<PackageReference Include="xunit" Version="$(XunitPackageVersion)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XunitRunnerVisualStudioPackageVersion)" />
<PackageReference Include="YamlDotNet.Signed" Version="$(YamlDotnetSignedPackageVersion)" />
<DotNetCliToolReference Include="dotnet-xunit" Version="$(DotnetXunitPackageVersion)" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\azbridge\azbridge.csproj" />
<ProjectReference Include="..\..\src\Microsoft.Azure.Relay.Bridge\Microsoft.Azure.Relay.Bridge.csproj" />
</ItemGroup>
</Project>

12
version.props Normal file
Просмотреть файл

@ -0,0 +1,12 @@
<Project>
<PropertyGroup>
<VersionPrefix>1.0.0</VersionPrefix>
<VersionSuffix>preview</VersionSuffix>
<PackageVersion Condition="'$(IsFinalBuild)' == 'true' AND '$(VersionSuffix)' == 'rtm' ">$(VersionPrefix)</PackageVersion>
<PackageVersion Condition="'$(IsFinalBuild)' == 'true' AND '$(VersionSuffix)' != 'rtm' ">$(VersionPrefix)-$(VersionSuffix)-final</PackageVersion>
<BuildNumber Condition="'$(BuildNumber)' == ''">t000</BuildNumber>
<FeatureBranchVersionPrefix Condition="'$(FeatureBranchVersionPrefix)' == ''">a-</FeatureBranchVersionPrefix>
<VersionSuffix Condition="'$(VersionSuffix)' != '' And '$(FeatureBranchVersionSuffix)' != ''">$(FeatureBranchVersionPrefix)$(VersionSuffix)-$([System.Text.RegularExpressions.Regex]::Replace('$(FeatureBranchVersionSuffix)', '[^\w-]', '-'))</VersionSuffix>
<VersionSuffix Condition="'$(VersionSuffix)' != '' And '$(BuildNumber)' != ''">$(VersionSuffix)-$(BuildNumber)</VersionSuffix>
</PropertyGroup>
</Project>