Merge rel/1.0.0 to master

This commit is contained in:
Piotr Puszkiewicz 2017-02-06 12:43:57 -08:00
commit b0a5d53ed5
72 changed files with 3664 additions and 231 deletions

View file

@ -18,8 +18,7 @@ There are a couple of things to keep in mind:
* We welcome any and all issues that relate to MSBuild-based tools, so feel free to try them out and leave comments and file any bugs/problems.
### Download links
* Instructions and links for download: [Preview 4 download links](https://github.com/dotnet/core/blob/master/release-notes/preview4-download.md).
* Instructions and links for download: [RC3 download links](https://github.com/dotnet/core/blob/master/release-notes/rc3-download.md).
* Directory for future Preview release notes: [.NET Core release notes](https://github.com/dotnet/core/tree/master/release-notes).
Found an issue?

View file

@ -0,0 +1,12 @@
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

View file

@ -0,0 +1,23 @@
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {
"ProjectA": {
"target": "project"
}
},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"imports": "dnxcore50"
}
}
}

View file

@ -0,0 +1,19 @@
{
"version": "1.0.0-*",
"buildOptions": {
"debugType": "portable",
"emitEntryPoint": true
},
"dependencies": {},
"frameworks": {
"netcoreapp1.0": {
"dependencies": {
"Microsoft.NETCore.App": {
"type": "platform",
"version": "1.0.0"
}
},
"imports": "dnxcore50"
}
}
}

View file

@ -0,0 +1,3 @@
{
"projects": [ "src" ]
}

View file

@ -0,0 +1,12 @@
using System;
namespace ConsoleApplication
{
public class Program
{
public static void Main(string[] args)
{
Console.WriteLine("Hello World!");
}
}
}

View file

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<DebugType>portable</DebugType>
<AssemblyName>ProjectA</AssemblyName>
<OutputType>Exe</OutputType>
<PackageId>ProjectA</PackageId>
<PackageTargetFallback>$(PackageTargetFallback);dnxcore50</PackageTargetFallback>
<RuntimeFrameworkVersion>1.0.3</RuntimeFrameworkVersion>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard1.5</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Something.Nonexistent" Version="1.1.1" />
</ItemGroup>
</Project>

View file

@ -0,0 +1 @@
{}

View file

@ -2,9 +2,9 @@
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
<ItemGroup>
<BundledTemplate Include="Microsoft.DotNet.Common.ItemTemplates" Version="$(TemplateEngineVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Common.ProjectTemplates" Version="$(TemplateEngineVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Test.ProjectTemplates" Version="$(TemplateEngineVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Web.ProjectTemplates" Version="$(TemplateEngineVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Common.ItemTemplates" Version="$(TemplateEngineTemplateVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Common.ProjectTemplates" Version="$(TemplateEngineTemplateVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Test.ProjectTemplates" Version="$(TemplateEngineTemplateVersion)" />
<BundledTemplate Include="Microsoft.DotNet.Web.ProjectTemplates" Version="$(TemplateEngineTemplateVersion)" />
</ItemGroup>
</Project>

View file

@ -8,8 +8,9 @@
<CLI_NETSDK_Version>1.0.0-alpha-20170125-1</CLI_NETSDK_Version>
<!-- non-official NuGet build taken from https://github.com/nuget/nuget.client/tree/release-4.0.0-rc3-netstandard2.0 to contain "2.0" TFMs -->
<CLI_NuGet_Version>4.0.0-rc3-2193</CLI_NuGet_Version>
<CLI_WEBSDK_Version>1.0.0-alpha-20170120-3-249</CLI_WEBSDK_Version>
<CLI_WEBSDK_Version>1.0.0-alpha-20170130-3-281</CLI_WEBSDK_Version>
<CLI_TestPlatform_Version>15.0.0-preview-20170125-04</CLI_TestPlatform_Version>
<TemplateEngineVersion>1.0.0-beta1-20170126-102</TemplateEngineVersion>
<TemplateEngineVersion>1.0.0-beta1-20170202-111</TemplateEngineVersion>
<TemplateEngineTemplateVersion>1.0.0-beta1-20170131-110</TemplateEngineTemplateVersion>
</PropertyGroup>
</Project>

View file

@ -7,7 +7,7 @@
<Import Project="Microsoft.DotNet.Cli.DependencyVersions.props" />
<Target Name="Prepare"
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages;ZipTemplates" />
DependsOnTargets="Init;DownloadHostAndSharedFxArtifacts;RestoreSrcPackages;RestoreToolsPackages" />
<Target Name="Init"
DependsOnTargets="InitializeCommonProps;
@ -61,6 +61,8 @@
<Output TaskParameter="CommitCount" PropertyName="DefaultCommitCount" />
<Output TaskParameter="MsiVersion" PropertyName="MsiVersion" />
<Output TaskParameter="VersionBadgeMoniker" PropertyName="VersionBadgeMoniker" />
<Output TaskParameter="Channel" PropertyName="Channel" />
<Output TaskParameter="BranchName" PropertyName="BranchName" Condition=" '$(BranchName)' == '' " />
</GenerateBuildVersionInfo>
<GenerateNuGetPackagesArchiveVersion RepoRoot="$(RepoRoot)"
@ -303,27 +305,4 @@
</ItemGroup>
</Target>
<Target Name="SetupZipTemplatesInputsOutputs">
<PropertyGroup>
<_DotNetNewFolder>$(RepoRoot)/src/dotnet/commands/dotnet-new</_DotNetNewFolder>
</PropertyGroup>
<ItemGroup>
<DotNetNewArchive Include="$([System.IO.Directory]::GetDirectories($(_DotNetNewFolder)))" />
<ZipTemplatesInput Include="$(_DotNetNewFolder)/**" Exclude="$(_DotNetNewFolder)/*.zip" />
<ZipTemplatesOutput Include="@(DotNetNewArchive->'%(RelativeDir)/$([System.IO.Path]::GetFileName('%(DotNetNewArchive.FullPath)')).zip')" />
</ItemGroup>
</Target>
<Target Name="ZipTemplates"
DependsOnTargets="SetupZipTemplatesInputsOutputs"
Inputs="@(ZipTemplatesInput)"
Outputs="@(ZipTemplatesOutput)">
<ZipFileCreateFromDirectory
SourceDirectory="%(DotNetNewArchive.FullPath)"
DestinationArchive="%(DotNetNewArchive.RelativeDir)/$([System.IO.Path]::GetFileName(%(DotNetNewArchive.FullPath))).zip"
OverwriteDestination="True" />
</Target>
</Project>

View file

@ -52,7 +52,7 @@
</ItemGroup>
</Target>
<Target Name="PublishDebFilesToDebianRepo" Condition=" '$(OSName)' == 'ubuntu' ">
<Target Name="PublishDebFilesToDebianRepo" Condition=" '$(OSName)' == 'ubuntu' AND '$(SkipPublishToDebianRepo)' != 'true' ">
<Error Condition="'$(REPO_ID)' == ''" Text="REPO_ID must be set as an environment variable for debian publishing." />
<Error Condition="'$(REPO_USER)' == ''" Text="REPO_USER must be set as an environment variable for debian publishing." />
<Error Condition="'$(REPO_PASS)' == ''" Text="REPO_PASS must be set as an environment variable for debian publishing." />

View file

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="utf-8"?>
<Project InitialTargets="SetSigningProperties" DefaultTargets="SignFiles" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))/dir.props" />
<Import Project="$(RepoRoot)/build_tools/MicroBuild.Core.props" />
<!-- This will be overridden if we're building with MicroBuild. -->
<Target Name="SignFiles">
<Message Text="Fake sign target. Would sign: @(FilesToSign)" />
</Target>
<Target Name="SetSigningProperties">
<Error Condition="'$(Rid)' == ''" Text="Missing required property 'Rid'." />
<PropertyGroup>
<BaseOutputDirectory Condition="'$(BaseOutputDirectory)' == ''">$(RepoRoot)/artifacts/$(Rid)</BaseOutputDirectory>
<Stage2Directory Condition="'$(Stage2Directory)' == ''">$(BaseOutputDirectory)/stage2</Stage2Directory>
<Stage2CompilationDirectory Condition="'$(Stage2CompilationDirectory)' == ''">$(BaseOutputDirectory)/stage2compilation</Stage2CompilationDirectory>
<PackagesDirectory Condition="'$(PackagesDirectory)' == ''">$(BaseOutputDirectory)/packages</PackagesDirectory>
<!-- The OutDir and IntermediateOutputPath properties are required by MicroBuild. MicroBuild only
signs files that are under these paths. -->
<OutDir Condition="'$(OutDir)' == ''">$(BaseOutputDirectory)</OutDir>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">$(BaseOutputDirectory)/intermediate</IntermediateOutputPath>
</PropertyGroup>
</Target>
<Target Name="PostCompileSign" DependsOnTargets="GetPostCompileSignFiles;SignFiles" />
<Target Name="GetPostCompileSignFiles">
<ItemGroup>
<!-- External files -->
<FilesToSign Include="$(Stage2Directory)/sdk/**/Newtonsoft.Json.dll;
$(Stage2Directory)/shared/**/libuv.dll">
<Authenticode>$(ExternalCertificateId)</Authenticode>
</FilesToSign>
<!-- Built binaries -->
<FilesToSign Include="$(Stage2Directory)/sdk/**/csc.exe;
$(Stage2Directory)/sdk/**/csc.dll;
$(Stage2Directory)/sdk/**/dotnet.dll;
$(Stage2Directory)/sdk/**/System.*.dll;
$(Stage2Directory)/sdk/**/Microsoft.*.dll;
$(Stage2Directory)/sdk/**/NuGet*.dll;
$(Stage2Directory)/sdk/**/datacollector.dll;
$(Stage2Directory)/sdk/**/MSBuild.dll;
$(Stage2Directory)/sdk/**/testhost.dll;
$(Stage2Directory)/sdk/**/vstest.console.dll">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
<!-- Built files for the packages -->
<FilesToSign Include="$(Stage2CompilationDirectory)/forPackaging/**/*dotnet*.dll;
$(Stage2CompilationDirectory)/forPackaging/**/Microsoft.Extensions.DependencyModel.dll;
$(Stage2CompilationDirectory)/forPackaging/**/Microsoft.Extensions.Testing.Abstractions.dll">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
<Target Name="SignNuPkgContents" DependsOnTargets="GetSignNuPkgContentsFiles;SignFiles" />
<Target Name="GetSignNuPkgContentsFiles">
<PropertyGroup>
<OutDir>$(RepoRoot)/src/Microsoft.DotNet.Cli.Utils</OutDir>
</PropertyGroup>
<ItemGroup>
<!-- NuPkg contents -->
<FilesToSign Include="$(OutDir)/bin/**/Microsoft.DotNet.Cli.Utils.dll">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
<Target Name="SignMsiAndCab" DependsOnTargets="GetSignMsiAndCabFiles;SignFiles" />
<Target Name="GetSignMsiAndCabFiles">
<PropertyGroup>
<OutDir>$(PackagesDirectory)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(PackagesDirectory)/**/*.msi">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
<FilesToSign Include="$(PackagesDirectory)/**/*.cab">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
<Target Name="SignEngine" DependsOnTargets="GetSignEngineFiles;SignFiles" />
<Target Name="GetSignEngineFiles">
<PropertyGroup>
<OutDir>$(PackagesDirectory)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(PackagesDirectory)/**/*engine.exe">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
<Target Name="SignCliBundle" DependsOnTargets="GetSignCliBundleFiles;SignFiles" />
<Target Name="GetSignCliBundleFiles">
<PropertyGroup>
<OutDir>$(PackagesDirectory)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(PackagesDirectory)/**/*.exe">
<Authenticode>$(InternalCertificateId)</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
<Import Project="$(RepoRoot)/build_tools/MicroBuild.Core.targets" />
</Project>

View file

@ -86,14 +86,25 @@
Lines="$(NuGetConfigContent)" />
<DotNetNew ToolPath="$(Stage2Directory)"
TemplateType="Console"
WorkingDirectory="$(NuGetPackagesArchiveProject)/Console" />
TemplateType="Mvc"
TemplateArgs="-au Individual --debug:ephemeral-hive"
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web" />
<DotNetRestore ToolPath="$(Stage2Directory)"
Packages="$(NuGetPackagesArchiveFolder)"
SkipInvalidConfigurations="True"
WorkingDirectory="$(NuGetPackagesArchiveProject)/Console" />
<DotNetNew ToolPath="$(Stage2Directory)"
TemplateType="Mvc"
TemplateArgs="-au Individual -f netcoreapp1.1 --debug:ephemeral-hive"
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web1.1" />
<DotNetRestore ToolPath="$(Stage2Directory)"
Packages="$(NuGetPackagesArchiveFolder)"
SkipInvalidConfigurations="True"
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web1.1" />
<Delete Files="$(IntermediateArchive);$(IntermediateArchive).zip" />
<Message Text="Publishing Archiver" />
@ -108,6 +119,9 @@
<Target Name="SetupNuGetPackagesArchiveInputsOutputs"
DependsOnTargets="Prepare;SetupStage;SetupAzureBlobInformation">
<GenerateNuGetPackagesArchiveVersion ToolPath="$(Stage2Directory)">
<Output TaskParameter="Version" PropertyName="NuGetPackagesArchiveVersion"/>
</GenerateNuGetPackagesArchiveVersion>
<PropertyGroup>
<NugetPackagesArchiveName>nuGetPackagesArchive.$(NuGetPackagesArchiveVersion).lzma</NugetPackagesArchiveName>
<NuGetPackagesArchiveProject>$(IntermediateDirectory)/NuGetPackagesArchiveProject</NuGetPackagesArchiveProject>

View file

@ -26,12 +26,6 @@
<SdkInstallerNupkgFile>$(InstallerOutputDirectory)/VS.Redist.Common.Net.Core.SDK.$(Architecture).$(NugetVersion).nupkg</SdkInstallerNupkgFile>
</PropertyGroup>
<!-- Generate SDK MSI Inputs -->
<ItemGroup>
<GenerateSdkMsiInputs Include="$(SdkLayoutOutputDirectory)/**/*;
$(SdkGenerateMsiPowershellScript)" />
</ItemGroup>
<!-- Consumed By Publish -->
<ItemGroup>
<GeneratedInstallers Include="$(SdkInstallerFile);$(CombinedFrameworkSdkHostInstallerFile)" />
@ -80,9 +74,7 @@
<Target Name="GenerateSdkMsi"
DependsOnTargets="Init;Layout;AcquireWix;MsiTargetsSetupInputOutputs"
Condition=" '$(OS)' == 'Windows_NT'"
Inputs="@(GenerateSdkMsiInputs)"
Outputs="$(SdkInstallerFile)">
Condition=" '$(OS)' == 'Windows_NT'">
<Exec Command="powershell -NoProfile -NoLogo $(SdkGenerateMsiPowershellScript)
'$(SdkLayoutOutputDirectory)'

View file

@ -12,19 +12,11 @@ namespace Microsoft.DotNet.Cli.Build
protected override string Args
{
get { return $"{GetTemplateType()}"; }
get { return $"{TemplateType} {TemplateArgs}"; }
}
public string TemplateType { get; set; }
private string GetTemplateType()
{
if (!string.IsNullOrEmpty(TemplateType))
{
return $"--type {TemplateType}";
}
return null;
}
public string TemplateArgs { get; set; }
}
}

View file

@ -19,7 +19,7 @@ namespace Microsoft.DotNet.Cli.Build
}
[Required]
public string RepoRoot { get; set; }
public string ToolPath { get; set; }
[Required]
public string SharedFrameworkVersion { get; set; }
@ -27,25 +27,33 @@ namespace Microsoft.DotNet.Cli.Build
[Output]
public String Version { get; set; }
private static string[] s_TemplatesToArchive = new string[]
private static string[][] _templatesAndArgs = new string[][]
{
"CSharp_Console",
new string[] { "mvc", "-au Individual -f netcoreapp1.0" },
new string[] { "mvc", "-au Individual -f netcoreapp1.1" }
};
public override bool Execute()
{
var dataToHash = string.Empty;
foreach (string templateToArchive in s_TemplatesToArchive)
foreach (var newArgs in _templatesAndArgs)
{
var templatePath = Path.Combine(
RepoRoot,
"src",
"dotnet",
"commands",
"dotnet-new",
templateToArchive,
"$projectName$.csproj");
var targetDir = Path.GetTempFileName();
File.Delete(targetDir);
Directory.CreateDirectory(targetDir);
var outputDir = Path.Combine(targetDir, newArgs[0]);
Directory.CreateDirectory(outputDir);
var newTask = new DotNetNew
{
ToolPath = ToolPath,
TemplateType = newArgs[0],
TemplateArgs = newArgs[1] + $" --debug:ephemeral-hive -n TempProject -o \"{outputDir}\"",
HostObject = HostObject,
BuildEngine = BuildEngine
};
newTask.Execute();
var templatePath = Path.Combine(outputDir, "TempProject.csproj");
var rootElement = ProjectRootElement.Open(templatePath);
var packageRefs = rootElement.Items.Where(i => i.ItemType == "PackageReference").ToList();
@ -62,7 +70,7 @@ namespace Microsoft.DotNet.Cli.Build
}
}
dataToHash += SharedFrameworkVersion;
Directory.Delete(targetDir, true);
}
Log.LogMessage($"NuGet Packages Archive Data To Hash: '{dataToHash}'");

View file

@ -0,0 +1,172 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Shell Script build.sh",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "build.sh",
"args": "$(BuildArguments)",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --docker centos --targets Default /p:BranchName=sandbox",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true",
"allowOverride": true
}
},
"demands": [
"Agent.OS -equals linux"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [ ],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "DotNet-CLI-CentOS-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,172 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Shell Script build.sh",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "build.sh",
"args": "$(BuildArguments)",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --docker opensuse.13.2 --targets Default /p:BranchName=sandbox",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true",
"allowOverride": true
}
},
"demands": [
"Agent.OS -equals linux"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [ ],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "DotNet-CLI-opensuse13.2-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,172 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Shell Script build.sh",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "build.sh",
"args": "$(BuildArguments)",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --docker debian --targets Default /p:BranchName=sandbox",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true",
"allowOverride": true
}
},
"demands": [
"Agent.OS -equals linux"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [ ],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-Debian8-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,172 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Shell Script build.sh",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "build.sh",
"args": "$(BuildArguments)",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --docker fedora.23 --targets Default /p:BranchName=sandbox",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true",
"allowOverride": true
}
},
"demands": [
"Agent.OS -equals linux"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [ ],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-Fedora23-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,175 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Shell Script build.sh",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "build.sh",
"args": "$(BuildArguments)",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --targets Default /p:BranchName=sandbox",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true",
"allowOverride": true
},
"PUBLISH_LZMA_TO_AZURE_BLOB": {
"value": "true"
}
},
"demands": [
"Agent.OS -equals darwin"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [ ],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-OSX-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,190 @@
{
"build": [
{
"enabled": true,
"continueOnError": true,
"alwaysRun": false,
"displayName": "Clean docker containers",
"timeoutInMinutes": 0,
"task": {
"id": "d9bafed4-0b18-4f58-968d-86655b4d2ce9",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "bash",
"arguments": "-c \"docker ps -a -q -f status=exited | xargs --no-run-if-empty docker rm -v\"",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Run build in Docker container",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "scripts/dockerrun-as-current-user.sh",
"args": "-t --rm --sig-proxy=true --name $(Build.BuildId) -v $(Build.SourcesDirectory):/opt/code -w /opt/code -e CHANNEL -e CONNECTION_STRING -e REPO_ID -e REPO_USER -e REPO_PASS -e REPO_SERVER -e DOTNET_BUILD_SKIP_CROSSGEN -e PUBLISH_TO_AZURE_BLOB -e NUGET_FEED_URL -e NUGET_API_KEY -e GITHUB_PASSWORD -e ARTIFACT_STORAGE_KEY -e ARTIFACT_STORAGE_ACCOUNT -e ARTIFACT_STORAGE_CONTAINER -e CHECKSUM_STORAGE_KEY -e CHECKSUM_STORAGE_ACCOUNT -e CHECKSUM_STORAGE_CONTAINER chcosta/dotnetcore:rhel7_prereqs /bin/bash -c \"HOME=/opt/code; git clean -X -d -f; ./build.sh $(BuildArguments)\"",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --targets Default /p:BranchName=sandbox",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true",
"allowOverride": true
}
},
"demands": [
"Agent.OS -equals linux"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [ ],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-RHEL7-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,547 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Install Signing Plugin",
"timeoutInMinutes": 0,
"task": {
"id": "30666190-6959-11e5-9f96-f56098202fef",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"signType": "$(PB_SignType)",
"zipSources": "false",
"version": "",
"feedSource": "https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Compile",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "/p:Configuration=$(BuildConfiguration) /t:Compile",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign Assemblies",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:PostCompileSign $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "x64",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign NuPkg Contents",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:SignNuPkgContents $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "x64",
"msbuildLocation": ""
}
},
{
"enabled": false,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Test",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "/p:Configuration=$(BuildConfiguration) /t:Test",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Package",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "/p:Configuration=$(BuildConfiguration) /t:Package",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign MSI and CAB",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:SignMsiAndCab $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "x64",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Generate Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "/p:Configuration=$(BuildConfiguration) /t:Package",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Extract Engine from Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "/p:Configuration=$(BuildConfiguration) /t:ExtractEngineFromSdkBundle",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign Engine",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:SignEngine $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "x64",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Reattach Engine to Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "/p:Configuration=$(BuildConfiguration) /t:ReattachEngineToSdkBundle",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:SignCliBundle $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "x64",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Perform Cleanup Tasks",
"timeoutInMinutes": 0,
"task": {
"id": "521a94ea-9e68-468a-8167-6dcf361ea776",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": { }
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Download NuGet.exe",
"timeoutInMinutes": 0,
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "# Download nuget.exe to .nuget/nuget.exe\n$NuGetDir = Join-Path $env:BUILD_REPOSITORY_LOCALPATH \".nuget\"\n$NuGetExe = Join-Path $NuGetDir \"nuget.exe\"\n \nif (-not (Test-Path $NuGetDir))\n{\n New-Item -ItemType Directory -Force -Path $NuGetDir | Out-Null\n}\n\nif (-not (Test-Path $NuGetExe)) {\n Write-Host 'Downloading nuget.exe to ' + $NuGetExe\n wget https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe -OutFile $NuGetExe\n}",
"workingFolder": "",
"failOnStandardError": "true"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Publish NuGet Packages",
"timeoutInMinutes": 0,
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "$(MygetApiKey)",
"inlineScript": "$NuGetExe = Join-Path $env:BUILD_REPOSITORY_LOCALPATH \".nuget\\nuget.exe\"\n\n& $NuGetExe push -Source https://dotnet.myget.org/F/dotnet-cli-private/ -ApiKey $args[0] artifacts\\$env:RID\\packages\\Microsoft*.nupkg",
"workingFolder": "",
"failOnStandardError": "true"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Publish Build Artifacts",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "/p:Configuration=$(BuildConfiguration) /p:BranchName=sandbox /t:Publish",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Publish Windows Installer NuPkg to VS Feed",
"timeoutInMinutes": 0,
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "$(VS_FEED_PASSWORD)",
"inlineScript": "$NuGetExe = Join-Path $env:BUILD_REPOSITORY_LOCALPATH \".nuget\\nuget.exe\"\n$Nupkg = Join-Path $env:BUILD_REPOSITORY_LOCALPATH \"artifacts\\$env:RID\\packages\\VS.Redist.Common.Net.Core.SDK.x64*.nupkg\"\n\n& $NuGetExe sources Add -Name \"VS\" -Source $env:VS_FEED_URL -username foobar -password $args[0]\n\n& $NuGetExe push -Source \"VS\" -ApiKey VSTS $Nupkg",
"workingFolder": "",
"failOnStandardError": "true"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "-Configuration ${BuildConfiguration} -Targets Default -NoPackage",
"allowOverride": true
},
"COREHOST_TRACE": {
"value": "0",
"allowOverride": true
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ProductMoniker": {
"value": "Microsoft .NET Core 1.0.1 - SDK 1.0.0 Preview 4 (x64)"
},
"VS_FEED_URL": {
"value": "https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-cli-test/nuget/v3/index.json"
},
"VS_FEED_PASSWORD": {
"value": null,
"isSecret": true
},
"MygetApiKey": {
"value": null,
"isSecret": true
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true",
"allowOverride": true
},
"InternalCertificateId": {
"value": "400"
},
"ExternalCertificateId": {
"value": "135020001"
},
"RID": {
"value": "win81-x64"
},
"MsbuildSigningArguments": {
"value": "/p:Rid=$(RID) /p:Architecture=x64 /v:detailed"
},
"TeamName": {
"value": "DotNetCore"
},
"system.debug": {
"value": "false"
}
},
"demands": [
"Agent.OS -equals Windows_NT"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [
"build.SourceLabel"
],
"artifactTypesToDelete": [ ],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 120,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-Signing-Windows-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,498 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Install Signing Plugin",
"timeoutInMinutes": 0,
"task": {
"id": "30666190-6959-11e5-9f96-f56098202fef",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"signType": "$(PB_SignType)",
"zipSources": "false",
"version": "",
"feedSource": "https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Compile",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "-Architecture $(BuildArchitecture) /p:Configuration=$(BuildConfiguration) /t:Compile /v:normal",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign Assemblies",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:PostCompileSign $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "$(BuildArchitecture)",
"msbuildLocation": ""
}
},
{
"enabled": false,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Test",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "-Architecture $(BuildArchitecture) /p:Configuration=$(BuildConfiguration) /t:Compile /v:normal",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Package",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "-Architecture $(BuildArchitecture) /p:Configuration=$(BuildConfiguration) /t:Package /v:normal",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign MSI and CAB",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:SignMsiAndCab $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "$(BuildArchitecture)",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Generate Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "-Architecture $(BuildArchitecture) /p:Configuration=$(BuildConfiguration) /t:Package /v:normal",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Extract Engine from Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "-Architecture $(BuildArchitecture) /p:Configuration=$(BuildConfiguration) /t:ExtractEngineFromSdkBundle /v:normal",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign Engine",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:SignEngine $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "$(BuildArchitecture)",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Reattach Engine to Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "-Architecture $(BuildArchitecture) /p:Configuration=$(BuildConfiguration) /t:ReattachEngineToSdkBundle /v:normal",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Sign Bundle",
"timeoutInMinutes": 0,
"task": {
"id": "c6c4c611-aa2e-4a33-b606-5eaba2196824",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"solution": "build\\Microsoft.DotNet.Cli.Signing.proj",
"platform": "",
"configuration": "$(BuildConfiguration)",
"msbuildArguments": "/t:SignCliBundle $(MsbuildSigningArguments)",
"clean": "false",
"maximumCpuCount": "false",
"restoreNugetPackages": "false",
"logProjectEvents": "false",
"createLogFile": "false",
"msbuildLocationMethod": "version",
"msbuildVersion": "15.0",
"msbuildArchitecture": "$(BuildArchitecture)",
"msbuildLocation": ""
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Perform Cleanup Tasks",
"timeoutInMinutes": 0,
"task": {
"id": "521a94ea-9e68-468a-8167-6dcf361ea776",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": { }
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Publish Build Artifacts",
"timeoutInMinutes": 0,
"task": {
"id": "bfc8bf76-e7ac-4a8c-9a55-a944a9f632fd",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"filename": "build.cmd",
"arguments": "-Architecture $(BuildArchitecture) /p:Configuration=$(BuildConfiguration) /p:BranchName=sandbox /t:Publish /v:normal",
"modifyEnvironment": "false",
"workingFolder": "",
"failOnStandardError": "false"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Download NuGet.exe",
"timeoutInMinutes": 0,
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "",
"inlineScript": "# Download nuget.exe to .nuget/nuget.exe\n$NuGetDir = Join-Path $env:BUILD_REPOSITORY_LOCALPATH \".nuget\"\n$NuGetExe = Join-Path $NuGetDir \"nuget.exe\"\n \nif (-not (Test-Path $NuGetDir))\n{\n New-Item -ItemType Directory -Force -Path $NuGetDir | Out-Null\n}\n\nif (-not (Test-Path $NuGetExe)) {\n Write-Host 'Downloading nuget.exe to ' + $NuGetExe\n wget https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe -OutFile $NuGetExe\n}",
"workingFolder": "",
"failOnStandardError": "true"
}
},
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Publish Windows Installer Nupkg to VS Feed",
"timeoutInMinutes": 0,
"task": {
"id": "e213ff0f-5d5c-4791-802d-52ea3e7be1f1",
"versionSpec": "1.*",
"definitionType": "task"
},
"inputs": {
"scriptType": "inlineScript",
"scriptName": "",
"arguments": "$(VS_FEED_PASSWORD)",
"inlineScript": "$NuGetExe = Join-Path $env:BUILD_REPOSITORY_LOCALPATH \".nuget\\nuget.exe\"\n$Nupkg = Join-Path $env:BUILD_REPOSITORY_LOCALPATH \"artifacts\\$env:RID\\packages\\VS.Redist.Common.Net.Core.SDK.x86*.nupkg\"\n\n& $NuGetExe sources Add -Name \"VS\" -Source $env:VS_FEED_URL -username foobar -password $args[0]\n\n& $NuGetExe push -Source \"VS\" -ApiKey VSTS $Nupkg",
"workingFolder": "",
"failOnStandardError": "true"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "-Configuration ${BuildConfiguration} -Targets Default -NoPackage",
"allowOverride": true
},
"COREHOST_TRACE": {
"value": "0",
"allowOverride": true
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"BuildArchitecture": {
"value": "x86"
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ProductMoniker": {
"value": "Microsoft .NET Core 1.0.1 - SDK 1.0.0 Preview 4 (x86)"
},
"VS_FEED_URL": {
"value": "https://devdiv.pkgs.visualstudio.com/_packaging/dotnet-cli-test/nuget/v3/index.json"
},
"VS_FEED_PASSWORD": {
"value": null,
"isSecret": true
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CLIBUILD_SKIP_TESTS": {
"value": "true"
},
"InternalCertificateId": {
"value": "400"
},
"ExternalCertificateId": {
"value": "135020001"
},
"RID": {
"value": "win81-x86"
},
"MsbuildSigningArguments": {
"value": "/p:Rid=$(RID) /p:Architecture=x86 /v:detailed"
},
"TeamName": {
"value": "DotNetCore"
},
"system.debug": {
"value": "false"
}
},
"demands": [
"Agent.OS -equals Windows_NT"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [
"build.SourceLabel"
],
"artifactTypesToDelete": [ ],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 120,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-Signing-Windows-x86",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,182 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Shell Script build.sh",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "build.sh",
"args": "$(BuildArguments)",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --docker ubuntu.14.04 --targets Default /p:BranchName=sandbox /p:SkipPublishToDebianRepo=true",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"REPO_ID": {
"value": "562fbfe0b2d7d0e0a43780c4"
},
"REPO_USER": {
"value": "dotnet"
},
"REPO_PASS": {
"value": "PassedViaPipeBuild"
},
"REPO_SERVER": {
"value": "azure-apt-cat.cloudapp.net"
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
}
},
"demands": [
"Agent.OS -equals linux"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [
"build.SourceLabel"
],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-Ubuntu14.04-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

View file

@ -0,0 +1,180 @@
{
"build": [
{
"enabled": true,
"continueOnError": false,
"alwaysRun": false,
"displayName": "Shell Script build.sh",
"timeoutInMinutes": 0,
"task": {
"id": "6c731c3c-3c68-459a-a5c9-bde6e6595b5b",
"versionSpec": "2.*",
"definitionType": "task"
},
"inputs": {
"scriptPath": "build.sh",
"args": "$(BuildArguments)",
"disableAutoCwd": "false",
"cwd": "",
"failOnStandardError": "false"
}
}
],
"options": [
{
"enabled": false,
"definition": {
"id": "5bc3cfb7-6b54-4a4b-b5d2-a3905949f8a6"
},
"inputs": {
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "7c555368-ca64-4199-add6-9ebaf0b0137d"
},
"inputs": {
"multipliers": "[]",
"parallel": "false",
"continueOnError": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "a9db38f9-9fdc-478c-b0f9-464221e58316"
},
"inputs": {
"workItemType": "4777",
"assignToRequestor": "true",
"additionalFields": "{}"
}
},
{
"enabled": false,
"definition": {
"id": "57578776-4c22-4526-aeb0-86b6da17ee9c"
},
"inputs": {
"additionalFields": "{}"
}
}
],
"variables": {
"BuildConfiguration": {
"value": "Release",
"allowOverride": true
},
"BuildArguments": {
"value": "--skip-prereqs --configuration $(BuildConfiguration) --docker ubuntu.16.04 --targets Default /p:BranchName=sandbox /p:SkipPublishToDebianRepo=true",
"allowOverride": true
},
"CONNECTION_STRING": {
"value": "PassedViaPipeBuild"
},
"PUBLISH_TO_AZURE_BLOB": {
"value": "true",
"allowOverride": true
},
"REPO_ID": {
"value": "562fbfe0b2d7d0e0a43780c4"
},
"REPO_USER": {
"value": "dotnet"
},
"REPO_PASS": {
"value": "PassedViaPipeBuild"
},
"REPO_SERVER": {
"value": "azure-apt-cat.cloudapp.net"
},
"GITHUB_PASSWORD": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"ARTIFACT_STORAGE_ACCOUNT": {
"value": "dotnetcli"
},
"ARTIFACT_STORAGE_CONTAINER": {
"value": "mlorbe"
},
"CHECKSUM_STORAGE_KEY": {
"value": "PassedViaPipeBuild"
},
"CHECKSUM_STORAGE_ACCOUNT": {
"value": "dotnetclichecksums"
},
"CHECKSUM_STORAGE_CONTAINER": {
"value": "mlorbe"
}
},
"demands": [
"Agent.OS -equals linux"
],
"retentionRules": [
{
"branches": [
"+refs/heads/*"
],
"artifacts": [ ],
"artifactTypesToDelete": [
"FilePath",
"SymbolStore"
],
"daysToKeep": 2,
"minimumToKeep": 1,
"deleteBuildRecord": true,
"deleteTestResults": true
}
],
"buildNumberFormat": "$(Date:yyyMMdd)$(Rev:.r)",
"jobAuthorizationScope": "projectCollection",
"jobTimeoutInMinutes": 90,
"badgeEnabled": true,
"repository": {
"properties": {
"connectedServiceId": "f4c31735-42d2-4c3a-bc47-7ac06fd0dccc",
"apiUrl": "https://api.github.com/repos/dotnet/cli",
"branchesUrl": "https://api.github.com/repos/dotnet/cli/branches",
"cloneUrl": "https://github.com/dotnet/cli.git",
"refsUrl": "https://api.github.com/repos/dotnet/cli/git/refs",
"gitLfsSupport": "false",
"skipSyncSource": "false",
"fetchDepth": "0",
"cleanOptions": "0"
},
"id": "https://github.com/dotnet/cli.git",
"type": "GitHub",
"name": "dotnet/cli",
"url": "https://github.com/dotnet/cli.git",
"defaultBranch": "rel/1.0.0",
"clean": "true",
"checkoutSubmodules": false
},
"quality": "definition",
"queue": {
"pool": {
"id": 39,
"name": "DotNet-Build"
},
"id": 36,
"name": "DotNet-Build"
},
"path": "\\",
"type": "build",
"id": 1,
"name": "Dotnet-CLI-Ubuntu16.04-x64",
"project": {
"id": "0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"name": "DevDiv",
"description": "Visual Studio and DevDiv team project for git source code repositories. Work items will be added for Adams, Dev14 work items are tracked in vstfdevdiv. ",
"url": "https://devdiv.visualstudio.com/DefaultCollection/_apis/projects/0bdbc590-a062-4c3f-b0f6-9383f67865ee",
"state": "wellFormed",
"revision": 418097459
}
}

101
buildpipeline/pipeline.json Normal file
View file

@ -0,0 +1,101 @@
{
"Repository": "cli",
"Definitions": {
"Path": ".",
"Type": "VSTS",
"BaseUrl": "https://devdiv.visualstudio.com/DefaultCollection"
},
"Pipelines": [
{
"Name": "Trusted-All-Release",
"Parameters": {
"TreatWarningsAsErrors": "false"
},
"BuildParameters": {
"BuildConfiguration": "Release"
},
"Definitions": [
{
"Name": "DotNet-CLI-CentOS-x64",
"ReportingParameters": {
"OperatingSystem": "CentOS 7.1",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-Debian8-x64",
"ReportingParameters": {
"OperatingSystem": "Debian 8.2",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-Fedora23-x64",
"ReportingParameters": {
"OperatingSystem": "Fedora 23",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-opensuse13.2-x64",
"ReportingParameters": {
"OperatingSystem": "OpenSuse 13.2",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-OSX-x64",
"ReportingParameters": {
"OperatingSystem": "OSX",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-RHEL7-x64",
"ReportingParameters": {
"OperatingSystem": "RedHat 7",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-Signing-Windows-x64",
"ReportingParameters": {
"OperatingSystem": "Windows",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-Signing-Windows-x86",
"ReportingParameters": {
"OperatingSystem": "Windows",
"Type": "build/product/",
"Platform": "x86"
}
},
{
"Name": "DotNet-CLI-Ubuntu14.04-x64",
"ReportingParameters": {
"OperatingSystem": "Ubuntu 14.04",
"Type": "build/product/",
"Platform": "x64"
}
},
{
"Name": "DotNet-CLI-Ubuntu16.04-x64",
"ReportingParameters": {
"OperatingSystem": "Ubuntu 16.04",
"Type": "build/product/",
"Platform": "x64"
}
}
]
}
]
}

View file

@ -0,0 +1,9 @@
#!/usr/bin/env bash
#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
set -e
docker run -u="$(id -u):$(id -g)" "$@"

View file

@ -7,6 +7,13 @@ namespace Microsoft.DotNet.Cli.Utils
{
internal static class ExceptionExtensions
{
public static TException DisplayAsError<TException>(this TException exception)
where TException : Exception
{
exception.Data.Add(CLI_User_Displayed_Exception, true);
return exception;
}
public static void ReportAsWarning(this Exception e)
{
Reporter.Verbose.WriteLine($"Warning: Ignoring exception: {e.ToString().Yellow()}");

View file

@ -10,9 +10,10 @@ namespace Microsoft.DotNet.Configurer
{
public class NuGetCachePrimer : INuGetCachePrimer
{
private static string[] s_TemplatesUsedToPrimeCache = new string[]
private static IReadOnlyList<IReadOnlyList<string>> _templatesUsedToPrimeCache = new List<IReadOnlyList<string>>()
{
"Console",
new List<string>() { "mvc", "-f", "netcoreapp1.0", "-au", "Individual", "--debug:ephemeral-hive" },
new List<string>() { "mvc", "-f", "netcoreapp1.1", "-au", "Individual", "--debug:ephemeral-hive" }
};
private readonly ICommandFactory _commandFactory;
@ -76,7 +77,7 @@ namespace Microsoft.DotNet.Configurer
{
bool succeeded = true;
foreach (string template in s_TemplatesUsedToPrimeCache)
foreach (IReadOnlyList<string> templateInfo in _templatesUsedToPrimeCache)
{
if (succeeded)
{
@ -84,7 +85,7 @@ namespace Microsoft.DotNet.Configurer
{
var workingDirectory = temporaryDotnetNewDirectory.DirectoryPath;
succeeded &= CreateTemporaryProject(workingDirectory, template);
succeeded &= CreateTemporaryProject(workingDirectory, templateInfo);
if (succeeded)
{
@ -100,11 +101,11 @@ namespace Microsoft.DotNet.Configurer
}
}
private bool CreateTemporaryProject(string workingDirectory, string templateName)
private bool CreateTemporaryProject(string workingDirectory, IReadOnlyList<string> templateInfo)
{
return RunCommand(
"new",
new[] { "-t", templateName },
templateInfo,
workingDirectory);
}

View file

@ -35,6 +35,8 @@ namespace Microsoft.DotNet.Internal.ProjectModel.Files
throw new ArgumentNullException(nameof(rawObject));
}
CustomIncludePatterns = new List<string>();
CustomRemovePatterns = new List<string>();
SourceBasePath = sourceBasePath;
Option = option;
var token = rawObject.Value<JToken>(option);
@ -111,6 +113,10 @@ namespace Microsoft.DotNet.Internal.ProjectModel.Files
public string Option { get; }
public List<string> CustomIncludePatterns { get; }
public List<string> CustomRemovePatterns { get; }
public List<string> IncludePatterns { get; }
public List<string> ExcludePatterns { get; }
@ -131,6 +137,7 @@ namespace Microsoft.DotNet.Internal.ProjectModel.Files
return other != null &&
SourceBasePath == other.SourceBasePath &&
Option == other.Option &&
EnumerableEquals(CustomIncludePatterns, other.CustomIncludePatterns) &&
EnumerableEquals(IncludePatterns, other.IncludePatterns) &&
EnumerableEquals(ExcludePatterns, other.ExcludePatterns) &&
EnumerableEquals(IncludeFiles, other.IncludeFiles) &&

View file

@ -230,10 +230,10 @@ namespace Microsoft.DotNet.ProjectJsonMigration
projectSearchPaths.Add(projectRootDirectory);
var globalPaths = GetGlobalPaths(projectRootDirectory);
projectSearchPaths = projectSearchPaths.Union(globalPaths).ToList();
projectSearchPaths = globalPaths.Union(projectSearchPaths).ToList();
var solutionPaths = GetSolutionPaths(slnFile);
projectSearchPaths = projectSearchPaths.Union(solutionPaths).ToList();
projectSearchPaths = solutionPaths.Union(projectSearchPaths).ToList();
var projects = new Dictionary<string, ProjectDependency>(StringComparer.Ordinal);
@ -328,11 +328,16 @@ namespace Microsoft.DotNet.ProjectJsonMigration
var projectJSONFilePath = Path.Combine(projectDirectory.FullName, "project.json");
var csProjFilePath = Path.Combine(projectDirectory.FullName, $"{projectDirectory.Name}.csproj");
if (File.Exists(projectJSONFilePath) || File.Exists(csProjFilePath))
if (File.Exists(projectJSONFilePath))
{
var project = new ProjectDependency(projectDirectory.Name, projectJSONFilePath);
projects.Add(project);
}
else if (File.Exists(csProjFilePath))
{
var project = new ProjectDependency(projectDirectory.Name, csProjFilePath);
projects.Add(project);
}
}
internal static List<string> GetGlobalPaths(string rootPath)

View file

@ -15,6 +15,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
internal class MigrateBuildOptionsRule : IMigrationRule
{
private const string BuiltInCompilerResourcesPattern = "compiler/resources/*";
private AddPropertyTransform<CommonCompilerOptions>[] EmitEntryPointTransforms
=> new []
{
@ -171,15 +173,15 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
private Func<CommonCompilerOptions, string, ProjectType, IEnumerable<ProjectItemElement>> RemoveCompileFilesTransformExecute =>
(compilerOptions, projectDirectory, projectType) =>
RemoveCompileFilesTransform.Transform(compilerOptions.CompileInclude);
RemoveCompileFilesTransform.Transform(GetCompileRemoveContext(compilerOptions, projectDirectory));
private Func<CommonCompilerOptions, string, ProjectType, IEnumerable<ProjectItemElement>> EmbedFilesTransformExecute =>
(compilerOptions, projectDirectory, projectType) =>
EmbedFilesTransform.Transform(GetEmbedIncludeContext(compilerOptions));
EmbedFilesTransform.Transform(GetEmbedIncludeContext(compilerOptions, projectDirectory));
private Func<CommonCompilerOptions, string, ProjectType, IEnumerable<ProjectItemElement>> RemoveEmbedFilesTransformExecute =>
(compilerOptions, projectDirectory, projectType) =>
RemoveEmbedFilesTransform.Transform(GetEmbedIncludeContext(compilerOptions));
RemoveEmbedFilesTransform.Transform(GetEmbedRemoveContext(compilerOptions));
private Func<CommonCompilerOptions, string, ProjectType, IEnumerable<ProjectItemElement>> CopyToOutputFilesTransformExecute =>
(compilerOptions, projectDirectory, projectType) =>
@ -224,6 +226,11 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
ConstructTransformLists();
}
private bool ContainsCompilerResources(string projectDirectory)
{
return Directory.Exists(Path.Combine(projectDirectory, "compiler", "resources"));
}
private void ConstructTransformLists()
{
_propertyTransforms = new List<AddPropertyTransform<CommonCompilerOptions>>()
@ -342,7 +349,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
var configurationOutput =
removeContextTransformExecutes(configurationCompilerOptions, projectDirectory, projectType);
if (configurationOutput != null)
if (configurationOutput != null &&
!ItemRemovesAreEqual(nonConfigurationOutput, configurationOutput))
{
transformApplicator.Execute(configurationOutput, itemGroup, mergeExisting: true);
}
@ -372,6 +380,38 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
return configurationOutput == nonConfigurationOutput;
}
private bool ItemRemovesAreEqual(
IEnumerable<ProjectItemElement> nonConfigurationOutput,
IEnumerable<ProjectItemElement> configurationOutput)
{
return Enumerable.SequenceEqual(
nonConfigurationOutput ?? EmptyArray<ProjectItemElement>.Value,
configurationOutput ?? EmptyArray<ProjectItemElement>.Value,
new ItemRemoveAttributeComparer());
}
private class ItemRemoveAttributeComparer : EqualityComparer<ProjectItemElement>
{
public override bool Equals(ProjectItemElement item1, ProjectItemElement item2)
{
if (item1 == null && item2 == null)
{
return true;
}
else if (item1 == null || item2 == null)
{
return false;
}
return string.Equals(item1.Remove, item2.Remove, StringComparison.Ordinal);
}
public override int GetHashCode(ProjectItemElement item)
{
return item.GetHashCode();
}
}
private void PerformPropertyAndItemMappings(
CommonCompilerOptions compilerOptions,
ProjectPropertyGroupElement propertyGroup,
@ -428,7 +468,46 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
}
}
private IncludeContext GetEmbedIncludeContext(CommonCompilerOptions compilerOptions)
private IncludeContext GetCompileRemoveContext(
CommonCompilerOptions compilerOptions,
string projectDirectory)
{
var includeContext = compilerOptions.CompileInclude;
if (includeContext == null && ContainsCompilerResources(projectDirectory))
{
includeContext = new IncludeContext(
projectDirectory,
"compile",
new JObject(),
null,
null);
includeContext.CustomRemovePatterns.Add(BuiltInCompilerResourcesPattern);
}
return includeContext;
}
private IncludeContext GetEmbedIncludeContext(
CommonCompilerOptions compilerOptions,
string projectDirectory)
{
var embedIncludeContext = compilerOptions.EmbedInclude;
embedIncludeContext?.BuiltInsExclude.Add("@(EmbeddedResource)");
if (embedIncludeContext == null && ContainsCompilerResources(projectDirectory))
{
embedIncludeContext = new IncludeContext(
projectDirectory,
"embed",
new JObject(),
null,
null);
embedIncludeContext.CustomIncludePatterns.Add(BuiltInCompilerResourcesPattern);
}
return embedIncludeContext;
}
private IncludeContext GetEmbedRemoveContext(CommonCompilerOptions compilerOptions)
{
var embedIncludeContext = compilerOptions.EmbedInclude;

View file

@ -1,6 +1,8 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.ProjectJsonMigration.Transforms;
using Newtonsoft.Json.Linq;
using System;
using System.IO;
@ -8,8 +10,16 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
{
internal class MigrateRuntimeOptionsRule : IMigrationRule
{
private const string ConfigPropertiesTokenName = "configProperties";
private const string SystemGCServerTokenName = "System.GC.Server";
private readonly ITransformApplicator _transformApplicator;
private static readonly string s_runtimeOptionsFileName = "runtimeconfig.template.json";
public MigrateRuntimeOptionsRule(ITransformApplicator transformApplicator = null)
{
_transformApplicator = transformApplicator ?? new TransformApplicator();
}
public void Apply(MigrationSettings migrationSettings, MigrationRuleInputs migrationRuleInputs)
{
var projectContext = migrationRuleInputs.DefaultProjectContext;
@ -24,8 +34,69 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Rules
String.Format(LocalizableStrings.ProjAlreadyExistsError, outputRuntimeOptionsFile)).Throw();
}
File.WriteAllText(outputRuntimeOptionsFile, raw);
var runtimeOptions = JObject.Parse(raw);
if (HasServerGCProperty(runtimeOptions))
{
bool serverGCValue = GetServerGCValue(runtimeOptions);
if (!IsServerGCValueInjectedBySdk(serverGCValue, projectContext.ProjectFile.GetProjectType()))
{
var propertyTransform = new AddPropertyTransform<bool>(
"ServerGarbageCollection",
gcValue => gcValue.ToString().ToLower(),
gcValue => true);
_transformApplicator.Execute(
propertyTransform.Transform(serverGCValue),
migrationRuleInputs.CommonPropertyGroup,
true);
}
RemoveServerGCProperty(runtimeOptions);
}
if (runtimeOptions.HasValues)
{
File.WriteAllText(outputRuntimeOptionsFile, runtimeOptions.ToString());
}
}
}
}
private bool IsServerGCValueInjectedBySdk(bool serverGCValue, ProjectType projectType)
{
return (projectType == ProjectType.Web && serverGCValue);
}
private bool HasServerGCProperty(JObject runtimeOptions)
{
bool hasServerGCProperty = false;
var configProperties = runtimeOptions.Value<JObject>(ConfigPropertiesTokenName);
if (configProperties != null)
{
hasServerGCProperty = configProperties[SystemGCServerTokenName] != null;
}
return hasServerGCProperty;
}
private bool GetServerGCValue(JObject runtimeOptions)
{
var configProperties = runtimeOptions[ConfigPropertiesTokenName];
return configProperties.Value<bool>(SystemGCServerTokenName);
}
private void RemoveServerGCProperty(JObject runtimeOptions)
{
var configProperties = runtimeOptions.Value<JObject>(ConfigPropertiesTokenName);
if (configProperties != null)
{
configProperties.Remove(SystemGCServerTokenName);
if (!configProperties.HasValues)
{
runtimeOptions.Remove(ConfigPropertiesTokenName);
}
}
}
}
}

View file

@ -36,7 +36,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
includeContext =>
{
var fullIncludeSet = includeContext.IncludePatterns.OrEmptyIfNull()
.Union(includeContext.BuiltInsInclude.OrEmptyIfNull());
.Union(includeContext.BuiltInsInclude.OrEmptyIfNull())
.Union(includeContext.CustomIncludePatterns.OrEmptyIfNull());
return FormatGlobPatternsForMsbuild(fullIncludeSet, includeContext.SourceBasePath);
},
@ -47,6 +48,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
(includeContext.IncludePatterns != null && includeContext.IncludePatterns.Count > 0)
||
(includeContext.BuiltInsInclude != null && includeContext.BuiltInsInclude.Count > 0)
||
(includeContext.CustomIncludePatterns != null && includeContext.CustomIncludePatterns.Count > 0)
);
});

View file

@ -23,16 +23,17 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
.Where((pattern) => !_excludePatternRule(pattern)),
includeContext.SourceBasePath),
includeContext => FormatGlobPatternsForMsbuild(includeContext.ExcludeFiles, includeContext.SourceBasePath),
includeContext => includeContext != null
&& includeContext.IncludeFiles != null
includeContext => includeContext != null
&& includeContext.IncludeFiles != null
&& includeContext.IncludeFiles.Where((pattern) => !_excludePatternRule(pattern)).Count() > 0);
protected virtual Func<string, AddItemTransform<IncludeContext>> IncludeExcludeTransformGetter =>
(itemName) => new AddItemTransform<IncludeContext>(
itemName,
includeContext =>
includeContext =>
{
var fullIncludeSet = includeContext.IncludePatterns.OrEmptyIfNull();
var fullIncludeSet = includeContext.IncludePatterns.OrEmptyIfNull()
.Union(includeContext.CustomIncludePatterns.OrEmptyIfNull());
if (_emitBuiltInIncludes)
{
fullIncludeSet = fullIncludeSet.Union(includeContext.BuiltInsInclude.OrEmptyIfNull());
@ -50,12 +51,14 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
return FormatGlobPatternsForMsbuild(fullExcludeSet, includeContext.SourceBasePath);
},
includeContext =>
includeContext =>
{
return includeContext != null &&
(
(
(includeContext.IncludePatterns != null && includeContext.IncludePatterns.Where((pattern) => !_excludePatternRule(pattern)).Count() > 0)
||
(includeContext.CustomIncludePatterns != null && includeContext.CustomIncludePatterns.Where((pattern) => !_excludePatternRule(pattern)).Count() > 0)
||
(_emitBuiltInIncludes &&
includeContext.BuiltInsInclude != null &&
includeContext.BuiltInsInclude.Count > 0)

View file

@ -21,7 +21,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
includeContext =>
{
var fullRemoveSet = includeContext.ExcludePatterns.OrEmptyIfNull()
.Union(includeContext.ExcludeFiles.OrEmptyIfNull());
.Union(includeContext.ExcludeFiles.OrEmptyIfNull())
.Union(includeContext.CustomRemovePatterns.OrEmptyIfNull());
return FormatGlobPatternsForMsbuild(fullRemoveSet, includeContext.SourceBasePath);
},
@ -32,6 +33,8 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Transforms
(includeContext.ExcludePatterns != null && includeContext.ExcludePatterns.Count > 0)
||
(includeContext.ExcludeFiles != null && includeContext.ExcludeFiles.Count > 0)
||
(includeContext.CustomRemovePatterns != null && includeContext.CustomRemovePatterns.Count > 0)
);
});

View file

@ -136,7 +136,7 @@ namespace Microsoft.DotNet.Cli.CommandLine
public int Execute(params string[] args)
{
CommandLineApplication command = this;
IEnumerator<CommandArgument> arguments = null;
CommandArgumentEnumerator arguments = null;
if (HandleResponseFiles)
{
@ -156,7 +156,10 @@ namespace Microsoft.DotNet.Cli.CommandLine
else if (isLongOption || arg.StartsWith("-"))
{
CommandOption option;
var result = ParseOption(isLongOption, command, args, ref index, out option);
if (result == ParseOptionResult.ShowHelp)
{
command.ShowHelp();
@ -181,9 +184,9 @@ namespace Microsoft.DotNet.Cli.CommandLine
}
else
{
if (arguments == null)
if (arguments == null || arguments.CommandName != command.Name)
{
arguments = new CommandArgumentEnumerator(command.Arguments.GetEnumerator());
arguments = new CommandArgumentEnumerator(command.Arguments.GetEnumerator(), command.Name);
}
if (arguments.MoveNext())
@ -285,14 +288,24 @@ namespace Microsoft.DotNet.Cli.CommandLine
else
{
index++;
arg = args[index];
if (!option.TryParse(arg))
if (index < args.Length)
{
arg = args[index];
if (!option.TryParse(arg))
{
command.ShowHint();
throw new CommandParsingException(
command,
String.Format(LocalizableStrings.UnexpectedValueForOptionError, arg, optionName));
}
}
else
{
command.ShowHint();
throw new CommandParsingException(
command,
String.Format(LocalizableStrings.UnexpectedValueForOptionError, arg, optionName));
String.Format(LocalizableStrings.OptionRequiresSingleValueWhichIsMissing, arg, optionName));
}
}
}
@ -629,11 +642,16 @@ namespace Microsoft.DotNet.Cli.CommandLine
{
private readonly IEnumerator<CommandArgument> _enumerator;
public CommandArgumentEnumerator(IEnumerator<CommandArgument> enumerator)
public CommandArgumentEnumerator(
IEnumerator<CommandArgument> enumerator,
string commandName)
{
CommandName = commandName;
_enumerator = enumerator;
}
public string CommandName { get; }
public CommandArgument Current
{
get

View file

@ -4,6 +4,8 @@ namespace Microsoft.DotNet.Cli.CommandLine
{
public const string LastArgumentMultiValueError = "The last argument '{0}' accepts multiple values. No more argument can be added.";
public const string OptionRequiresSingleValueWhichIsMissing = "Required value for option '{0}' was not provided.";
public const string UnexpectedValueForOptionError = "Unexpected value '{0}' for option '{1}'";
public const string UnexpectedArgumentError = "Unrecognized {0} '{1}'";

View file

@ -17,7 +17,6 @@ using Microsoft.DotNet.Tools.List;
using Microsoft.DotNet.Tools.Migrate;
using Microsoft.DotNet.Tools.MSBuild;
using Microsoft.DotNet.Tools.New;
using Microsoft.DotNet.Tools.New3;
using Microsoft.DotNet.Tools.NuGet;
using Microsoft.DotNet.Tools.Pack;
using Microsoft.DotNet.Tools.Publish;
@ -43,8 +42,7 @@ namespace Microsoft.DotNet.Cli
["list"] = ListCommand.Run,
["migrate"] = MigrateCommand.Run,
["msbuild"] = MSBuildCommand.Run,
["new"] = NewCommand.Run,
["new3"] = New3CommandShim.Run,
["new"] = NewCommandShim.Run,
["nuget"] = NuGetCommand.Run,
["pack"] = PackCommand.Run,
["publish"] = PublishCommand.Run,

View file

@ -50,7 +50,7 @@ namespace Microsoft.DotNet.Tools.Migrate
}
Directory.CreateDirectory(tempDir);
RunCommand("new", new string[] {}, tempDir);
RunCommand("new", new string[] { "console", "-o", tempDir, "--debug:ephemeral-hive" }, tempDir);
return tempDir;
}
@ -77,8 +77,9 @@ namespace Microsoft.DotNet.Tools.Migrate
{
MigrationTrace.Instance.WriteLine(commandResult.StdOut);
MigrationTrace.Instance.WriteLine(commandResult.StdErr);
throw new GracefulException($"Failed to run {commandToExecute} in directory: {workingDirectory}");
string argList = string.Join(", ", args);
throw new GracefulException($"Failed to run {commandToExecute} with args: {argList} ... workingDirectory = {workingDirectory}");
}
}
}

View file

@ -41,10 +41,11 @@ namespace Microsoft.DotNet.Tools.MSBuild
{
Type loggerType = typeof(MSBuildLogger);
argsToForward = argsToForward.Concat(new[]
{
$"/Logger:{loggerType.FullName},{loggerType.GetTypeInfo().Assembly.Location}"
});
argsToForward = argsToForward
.Concat(new[]
{
$"/Logger:{loggerType.FullName},{loggerType.GetTypeInfo().Assembly.Location}"
});
}
catch (Exception)
{
@ -54,7 +55,7 @@ namespace Microsoft.DotNet.Tools.MSBuild
_forwardingApp = new ForwardingApp(
GetMSBuildExePath(),
_msbuildRequiredParameters.Concat(argsToForward),
_msbuildRequiredParameters.Concat(argsToForward.Select(Escape)),
environmentVariables: _msbuildRequiredEnvironmentVariables);
}
@ -77,6 +78,13 @@ namespace Microsoft.DotNet.Tools.MSBuild
return app.Option("-v|--verbosity", LocalizableStrings.VerbosityOptionDescription, CommandOptionType.SingleValue);
}
private static string Escape(string arg) =>
// this is a workaround for https://github.com/Microsoft/msbuild/issues/1622
(arg.StartsWith("/p:RestoreSources=", StringComparison.OrdinalIgnoreCase)) ?
arg.Replace(";", "%3B")
.Replace("://", ":%2F%2F") :
arg;
private static string GetMSBuildExePath()
{
return Path.Combine(

View file

@ -0,0 +1,73 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using Microsoft.DotNet.Cli.Utils;
using Microsoft.TemplateEngine.Abstractions;
using Microsoft.TemplateEngine.Cli;
using Microsoft.TemplateEngine.Edge;
using Microsoft.TemplateEngine.Orchestrator.RunnableProjects;
using Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Config;
using Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Macros;
using Microsoft.TemplateEngine.Utils;
namespace Microsoft.DotNet.Tools.New
{
internal class NewCommandShim
{
private const string HostIdentifier = "dotnetcli";
private const string CommandName = "new";
public static int Run(string[] args)
{
return New3Command.Run(CommandName, CreateHost(), FirstRun, args);
}
private static ITemplateEngineHost CreateHost()
{
var builtIns = new Dictionary<Guid, Func<Type>>
{
{ new Guid("0C434DF7-E2CB-4DEE-B216-D7C58C8EB4B3"), () => typeof(RunnableProjectGenerator) },
{ new Guid("3147965A-08E5-4523-B869-02C8E9A8AAA1"), () => typeof(BalancedNestingConfig) },
{ new Guid("3E8BCBF0-D631-45BA-A12D-FBF1DE03AA38"), () => typeof(ConditionalConfig) },
{ new Guid("A1E27A4B-9608-47F1-B3B8-F70DF62DC521"), () => typeof(FlagsConfig) },
{ new Guid("3FAE1942-7257-4247-B44D-2DDE07CB4A4A"), () => typeof(IncludeConfig) },
{ new Guid("3D33B3BF-F40E-43EB-A14D-F40516F880CD"), () => typeof(RegionConfig) },
{ new Guid("62DB7F1F-A10E-46F0-953F-A28A03A81CD1"), () => typeof(ReplacementConfig) },
{ new Guid("370996FE-2943-4AED-B2F6-EC03F0B75B4A"), () => typeof(ConstantMacro) },
{ new Guid("BB625F71-6404-4550-98AF-B2E546F46C5F"), () => typeof(EvaluateMacro) },
{ new Guid("10919008-4E13-4FA8-825C-3B4DA855578E"), () => typeof(GuidMacro) },
{ new Guid("F2B423D7-3C23-4489-816A-41D8D2A98596"), () => typeof(NowMacro) },
{ new Guid("011E8DC1-8544-4360-9B40-65FD916049B7"), () => typeof(RandomMacro) },
{ new Guid("8A4D4937-E23F-426D-8398-3BDBD1873ADB"), () => typeof(RegexMacro) },
{ new Guid("B57D64E0-9B4F-4ABE-9366-711170FD5294"), () => typeof(SwitchMacro) },
{ new Guid("10919118-4E13-4FA9-825C-3B4DA855578E"), () => typeof(CaseChangeMacro) }
}.ToList();
var preferences = new Dictionary<string, string>
{
{ "prefs:language", "C#" },
{ "dotnet-cli-version", Product.Version }
};
return new DefaultTemplateEngineHost(HostIdentifier, "v" + Product.Version, CultureInfo.CurrentCulture.Name, preferences, builtIns);
}
private static void FirstRun(IEngineEnvironmentSettings environmentSettings, IInstaller installer)
{
Paths paths = new Paths(environmentSettings);
var templatesDir = Path.Combine(paths.Global.BaseDir, "Templates");
if (paths.Exists(templatesDir))
{
var layoutIncludedPackages = environmentSettings.Host.FileSystem.EnumerateFiles(templatesDir, "*.nupkg", SearchOption.TopDirectoryOnly);
installer.InstallPackages(layoutIncludedPackages);
}
}
}
}

View file

@ -121,12 +121,14 @@ namespace Microsoft.DotNet.Tools.Run
{
throw new InvalidOperationException(
$"{LocalizableStrings.RunCommandInvalidOperationException1} {directory}." + Environment.NewLine +
LocalizableStrings.RunCommandInvalidOperationException2);
LocalizableStrings.RunCommandInvalidOperationException2)
.DisplayAsError();
}
else if (projectFiles.Length > 1)
{
throw new InvalidOperationException(
$"{LocalizableStrings.RunCommandInvalidOperationException3}'{directory}'{LocalizableStrings.RunCommandInvalidOperationException4}");
$"{LocalizableStrings.RunCommandInvalidOperationException3}'{directory}'{LocalizableStrings.RunCommandInvalidOperationException4}")
.DisplayAsError();
}
Project = projectFiles[0];

View file

@ -55,8 +55,5 @@
public const string RunSettingsArgsHelpText = @"Any extra command-line runsettings arguments that should be passed to vstest. See 'dotnet vstest --help' for available options.
Example: -- RunConfiguration.ResultsDirectory=""C:\users\user\desktop\Results Directory"" MSTest.DeploymentEnabled=false";
public const string CmdResultsDirectoryDescription = @"The test results directory will be created in the specified path if it does not exist.
Example: --results-directory <PATH_TO_RESULTS_DIRECTORY>";
}
}

View file

@ -83,11 +83,6 @@ namespace Microsoft.DotNet.Tools.Test
LocalizableStrings.CmdNoBuildDescription,
CommandOptionType.NoValue);
var resultsDirectoryOption = cmd.Option(
"-r|--results-directory",
LocalizableStrings.CmdResultsDirectoryDescription,
CommandOptionType.SingleValue);
CommandOption verbosityOption = MSBuildForwardingApp.AddVerbosityOption(cmd);
cmd.OnExecute(() =>
@ -134,11 +129,6 @@ namespace Microsoft.DotNet.Tools.Test
msbuildArgs.Add($"/p:TargetFramework={frameworkOption.Value()}");
}
if (resultsDirectoryOption.HasValue())
{
msbuildArgs.Add($"/p:VSTestResultsDirectory={resultsDirectoryOption.Value()}");
}
if (outputOption.HasValue())
{
msbuildArgs.Add($"/p:OutputPath={outputOption.Value()}");

View file

@ -6,6 +6,8 @@ using System.IO;
using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
[assembly: CollectionBehavior(DisableTestParallelization = true)]
namespace Microsoft.DotNet.Tests.EndToEnd
{
public class GivenDotNetUsesMSBuild : TestBase
@ -17,9 +19,10 @@ namespace Microsoft.DotNet.Tests.EndToEnd
{
string projectDirectory = directory.Path;
new NewCommand()
string newArgs = "console --debug:ephemeral-hive";
new NewCommandShim()
.WithWorkingDirectory(projectDirectory)
.Execute("")
.Execute(newArgs)
.Should().Pass();
new RestoreCommand()

View file

@ -61,8 +61,12 @@ namespace Microsoft.DotNet.Configurer.UnitTests
_dotnetNewCommandMock = new Mock<ICommand>();
SetupCommandMock(_dotnetNewCommandMock);
commandFactoryMock
.Setup(c => c.Create("new", new[] { "-t", "Console" }, null, Constants.DefaultConfiguration))
.Setup(c => c.Create("new", new[] { "mvc", "-f", "netcoreapp1.0", "-au", "Individual", "--debug:ephemeral-hive" }, null, Constants.DefaultConfiguration))
.Returns(_dotnetNewCommandMock.Object);
commandFactoryMock
.Setup(c => c.Create("new", new[] { "mvc", "-f", "netcoreapp1.1", "-au", "Individual", "--debug:ephemeral-hive" }, null, Constants.DefaultConfiguration))
.Returns(_dotnetNewCommandMock.Object);
_dotnetRestoreCommandMock = new Mock<ICommand>();
@ -151,7 +155,7 @@ namespace Microsoft.DotNet.Configurer.UnitTests
_commandFactoryMock.Verify(
c => c.Create(
"restore",
new [] {"-s", $"{PACKAGES_ARCHIVE_PATH}"},
new[] { "-s", $"{PACKAGES_ARCHIVE_PATH}" },
null,
Constants.DefaultConfiguration),
Times.Exactly(1));

View file

@ -618,6 +618,61 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
mockProj.Items.Count(i => i.ItemType.Equals("Compile", StringComparison.Ordinal)).Should().Be(0);
}
[Fact]
public void MigratingProjectWithCompileResourcesPopulatesAppropriateProjectItemElements()
{
var testDirectory = Temp.CreateDirectory().Path;
WriteCompileResourceFiles(testDirectory);
var pj = @"
{
""version"": ""1.0.0-*"",
""dependencies"": {
""NETStandard.Library"": ""1.6.0""
},
""frameworks"": {
""netstandard1.5"": {}
}
}";
var mockProj = RunBuildOptionsRuleOnPj(pj, testDirectory);
var compileItems = mockProj.Items.Where(i => i.ItemType.Equals("Compile", StringComparison.Ordinal));
compileItems.Count().Should().Be(1);
var compileItem = compileItems.Single();
compileItem.Include.Should().BeEmpty();
compileItem.Exclude.Should().BeEmpty();
compileItem.Remove.Should().Be(@"compiler\resources\*");
var embeddedResourceItems = mockProj.Items.Where(
i => i.ItemType.Equals("EmbeddedResource", StringComparison.Ordinal));
embeddedResourceItems.Count().Should().Be(1);
var embeddedResourceItem = embeddedResourceItems.Single();
embeddedResourceItem.Include.Should().Be(@"compiler\resources\*");
embeddedResourceItem.Exclude.Should().BeEmpty();
embeddedResourceItem.Remove.Should().BeEmpty();
}
[Fact]
public void MigratingProjectWithoutCompileResourcesDoesNotAddProjectItemElements()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""version"": ""1.0.0-*"",
""dependencies"": {
""NETStandard.Library"": ""1.6.0""
},
""frameworks"": {
""netstandard1.5"": {}
}
}";
var mockProj = RunBuildOptionsRuleOnPj(pj, testDirectory);
mockProj.Items.Count.Should().Be(0);
}
private static IEnumerable<string> GetDefaultExcludePatterns(string group)
{
var defaultExcludePatterns = new List<string>(group == "copyToOutput" ?
@ -658,6 +713,13 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
File.WriteAllText(Path.Combine(directory, "rootfile.cs"), "content");
}
private void WriteCompileResourceFiles(string directory)
{
Directory.CreateDirectory(Path.Combine(directory, "compiler"));
Directory.CreateDirectory(Path.Combine(directory, "compiler", "resources"));
File.WriteAllText(Path.Combine(directory, "compiler", "resources", "file.cs"), "content");
}
private ProjectRootElement RunBuildOptionsRuleOnPj(string s, string testDirectory = null)
{
testDirectory = testDirectory ?? Temp.CreateDirectory().Path;

View file

@ -302,6 +302,27 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
item => item.ItemType == "ProjectReference" && item.Include == projectReferenceInclude);
}
[Fact]
public void ItDoesNotReferenceTheProjectUnderBackupWhenMigratingAPartiallyMigratedStructure()
{
var testAssetsManager = GetTestGroupTestAssetsManager("NonRestoredTestProjects");
var solutionDirectory = testAssetsManager.CreateTestInstance("PJHalfMigrated").Path;
var appDirectory = Path.Combine(solutionDirectory, "ProjectB");
var projectContext = ProjectContext.Create(appDirectory, FrameworkConstants.CommonFrameworks.NetCoreApp10);
var mockProj = ProjectRootElement.Create();
var testSettings = MigrationSettings.CreateMigrationSettingsTestHook(appDirectory, appDirectory, mockProj, null);
var testInputs = new MigrationRuleInputs(new[] {projectContext}, mockProj, mockProj.AddItemGroup(),
mockProj.AddPropertyGroup());
new MigrateProjectDependenciesRule().Apply(testSettings, testInputs);
var projectReferences = mockProj.Items.Where(
item => item.ItemType.Equals("ProjectReference", StringComparison.Ordinal));
projectReferences.Should().ContainSingle();
projectReferences.Single().Include.Should().Be(Path.Combine("..", "src", "ProjectA", "ProjectA.csproj"));
}
private ProjectRootElement MigrateProject(string solution, string project)
{
return MigrateProject(solution, project, FrameworkConstants.CommonFrameworks.NetCoreApp10);

View file

@ -23,7 +23,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
private static readonly string s_runtimeConfigFileName = "runtimeconfig.template.json";
[Fact]
public void RuntimeOptions_are_copied_from_projectJson_to_runtimeconfig_template_json_file()
public void RuntimeOptionsAreCopiedFromProjectJsonToRuntimeConfigTemplateJsonFile()
{
var testInstance = TestAssetsManager.CreateTestInstance("TestAppWithRuntimeOptions");
var projectDir = testInstance.Path;
@ -47,7 +47,7 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
}
[Fact]
public void Migrating_ProjectJson_with_no_RuntimeOptions_produces_no_runtimeconfig_template_json_file()
public void MigratingProjectJsonWithNoRuntimeOptionsProducesNoRuntimeConfigTemplateJsonFile()
{
var testInstance = TestAssetsManager.CreateTestInstance("PJTestAppSimple");
var projectDir = testInstance.Path;
@ -62,5 +62,173 @@ namespace Microsoft.DotNet.ProjectJsonMigration.Tests
File.Exists(migratedRuntimeOptionsPath).Should().BeFalse();
}
[Fact]
public void MigratingProjectJsonWithOnlyServerGCRuntimeOptionsProducesNoRuntimeConfigTemplateJsonFile()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""runtimeOptions"": {
""configProperties"": {
""System.GC.Server"": true
}
}
}";
RunMigrateRuntimeOptionsRulePj(pj, testDirectory);
var migratedRuntimeOptionsPath = Path.Combine(testDirectory, s_runtimeConfigFileName);
File.Exists(migratedRuntimeOptionsPath).Should().BeFalse();
}
[Fact]
public void MigratingProjectJsonWithServerGCAndOtherConfigPropertiesProducesRuntimeConfigTemplateJsonFile()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""runtimeOptions"": {
""configProperties"": {
""System.GC.Server"": false,
""Other"": false
}
}
}";
RunMigrateRuntimeOptionsRulePj(pj, testDirectory);
var migratedRuntimeOptionsPath = Path.Combine(testDirectory, s_runtimeConfigFileName);
File.Exists(migratedRuntimeOptionsPath).Should().BeTrue();
var root = JObject.Parse(File.ReadAllText(migratedRuntimeOptionsPath));
var configProperties = root.Value<JObject>("configProperties");
configProperties.Should().NotBeNull();
configProperties["System.GC.Server"].Should().BeNull();
configProperties["Other"].Should().NotBeNull();
}
[Fact]
public void MigratingProjectJsonWithServerGCAndOtherRuntimeOptionsProducesRuntimeConfigTemplateJsonFile()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""runtimeOptions"": {
""configProperties"": {
""System.GC.Server"": false
},
""Other"": false
}
}";
RunMigrateRuntimeOptionsRulePj(pj, testDirectory);
var migratedRuntimeOptionsPath = Path.Combine(testDirectory, s_runtimeConfigFileName);
File.Exists(migratedRuntimeOptionsPath).Should().BeTrue();
var root = JObject.Parse(File.ReadAllText(migratedRuntimeOptionsPath));
root.Value<JObject>("configProperties").Should().BeNull();
}
[Fact]
public void MigratingProjectJsonWithServerGCTrueProducesServerGarbageCollectionProperty()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""runtimeOptions"": {
""configProperties"": {
""System.GC.Server"": true
}
}
}";
var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory);
var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal));
props.Count().Should().Be(1);
props.First().Value.Should().Be("true");
}
[Fact]
public void MigratingProjectJsonWithServerGCFalseProducesServerGarbageCollectionProperty()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""runtimeOptions"": {
""configProperties"": {
""System.GC.Server"": false
}
}
}";
var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory);
var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal));
props.Count().Should().Be(1);
props.First().Value.Should().Be("false");
}
[Fact]
public void MigratingWebProjectJsonWithServerGCTrueDoesNotProduceServerGarbageCollectionProperty()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""buildOptions"": {
""emitEntryPoint"": true
},
""dependencies"": {
""Microsoft.AspNetCore.Mvc"": ""1.0.0""
},
""runtimeOptions"": {
""configProperties"": {
""System.GC.Server"": true
}
}
}";
var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory);
var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal));
props.Count().Should().Be(0);
}
[Fact]
public void MigratingWebProjectJsonWithServerGCFalseProducesServerGarbageCollectionProperty()
{
var testDirectory = Temp.CreateDirectory().Path;
var pj = @"
{
""buildOptions"": {
""emitEntryPoint"": true
},
""dependencies"": {
""Microsoft.AspNetCore.Mvc"": ""1.0.0""
},
""runtimeOptions"": {
""configProperties"": {
""System.GC.Server"": false
}
}
}";
var mockProj = RunMigrateRuntimeOptionsRulePj(pj, testDirectory);
var props = mockProj.Properties.Where(p => p.Name.Equals("ServerGarbageCollection", StringComparison.Ordinal));
props.Count().Should().Be(1);
props.First().Value.Should().Be("false");
}
private ProjectRootElement RunMigrateRuntimeOptionsRulePj(string s, string testDirectory = null)
{
testDirectory = testDirectory ?? Temp.CreateDirectory().Path;
return TemporaryProjectFileRuleRunner.RunRules(new IMigrationRule[]
{
new MigrateRuntimeOptionsRule()
}, s, testDirectory);
}
}
}

View file

@ -0,0 +1,29 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Cli.Utils;
using Xunit;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public sealed class NewCommandShim : TestCommand
{
public NewCommandShim()
: base("dotnet")
{
}
public override CommandResult Execute(string args = "")
{
args = $"new {args} --debug:ephemeral-hive";
return base.Execute(args);
}
public override CommandResult ExecuteWithCapturedOutput(string args = "")
{
args = $"new {args} --debug:ephemeral-hive";
return base.ExecuteWithCapturedOutput(args);
}
}
}

View file

@ -2,18 +2,23 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using FluentAssertions;
using Microsoft.Build.Construction;
using Microsoft.DotNet.Cli.Sln.Internal;
using Microsoft.DotNet.Tools.Test.Utilities;
using System;
using System.IO;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
namespace Microsoft.DotNet.Cli.Package.Add.Tests
{
public class GivenDotnetPackageAdd : TestBase
{
private readonly ITestOutputHelper _output;
public GivenDotnetPackageAdd(ITestOutputHelper output)
{
_output = output;
}
[Fact]
public void WhenValidPackageIsPassedBeforeVersionItGetsAdded()
@ -37,6 +42,35 @@ namespace Microsoft.DotNet.Cli.Package.Add.Tests
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void
WhenValidProjectAndPackageArePassedItGetsAdded()
{
var testAsset = "TestAppSimple";
var projectDirectory = TestAssets
.Get(testAsset)
.CreateInstance()
.WithSourceFiles()
.Root
.FullName;
var csproj = $"{projectDirectory + Path.DirectorySeparatorChar + testAsset}.csproj";
var packageName = "Newtonsoft.Json";
var packageVersion = "9.0.1";
var cmd = new DotnetCommand()
.WithWorkingDirectory(projectDirectory)
.ExecuteWithCapturedOutput($"add {csproj} package {packageName} --version {packageVersion}");
_output.WriteLine($"[STDOUT] {cmd.StdOut}\n[STDERR]{cmd.StdErr}\n");
cmd.Should().Pass();
cmd.StdOut.Should()
.Contain($"PackageReference for package \'{packageName}\' version \'{packageVersion}\' added to file '{csproj}'.");
cmd.StdErr.Should().BeEmpty();
}
[Fact]
public void WhenValidPackageIsPassedAfterVersionItGetsAdded()
{

View file

@ -58,9 +58,10 @@ Additional Arguments:
try
{
new NewCommand()
string args = $"classlib -o \"{dir.Path}\" --debug:ephemeral-hive";
new NewCommandShim()
.WithWorkingDirectory(dir.Path)
.ExecuteWithCapturedOutput("-t Lib")
.ExecuteWithCapturedOutput(args)
.Should().Pass();
}
catch (System.ComponentModel.Win32Exception e)

View file

@ -46,9 +46,10 @@ namespace Microsoft.DotNet.Cli.Build.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
new NewCommand()
string newArgs = $"console -o \"{rootPath}\" --debug:ephemeral-hive";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute()
.Execute(newArgs)
.Should()
.Pass();

View file

@ -193,9 +193,10 @@ Options:
try
{
new NewCommand()
string newArgs = $"classlib -o \"{dir.Path}\" --debug:ephemeral-hive";
new NewCommandShim()
.WithWorkingDirectory(dir.Path)
.ExecuteWithCapturedOutput("-t Lib")
.ExecuteWithCapturedOutput(newArgs)
.Should().Pass();
}
catch (System.ComponentModel.Win32Exception e)

View file

@ -19,6 +19,8 @@ using Newtonsoft.Json.Linq;
using MigrateCommand = Microsoft.DotNet.Tools.Migrate.MigrateCommand;
[assembly: CollectionBehavior(DisableTestParallelization = true)]
namespace Microsoft.DotNet.Migration.Tests
{
public class GivenThatIWantToMigrateTestApps : TestBase

View file

@ -5,18 +5,27 @@ using System;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.InteropServices;
using FluentAssertions;
using Microsoft.DotNet.Configurer;
using Microsoft.DotNet.Tools.MSBuild;
using Microsoft.DotNet.Tools.Test.Utilities;
using NuGet.Protocol;
using Xunit;
using Xunit.Abstractions;
using MSBuildCommand = Microsoft.DotNet.Tools.Test.Utilities.MSBuildCommand;
namespace Microsoft.DotNet.Cli.MSBuild.Tests
{
public class GivenDotnetMSBuildBuildsProjects : TestBase
{
private readonly ITestOutputHelper _output;
public GivenDotnetMSBuildBuildsProjects(ITestOutputHelper output)
{
_output = output;
}
[Fact]
public void ItRunsSpecifiedTargetsWithPropertiesCorrectly()
{
@ -76,6 +85,37 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
}
}
[Fact]
public void WhenRestoreSourcesStartsWithUnixPathThenHttpsSourceIsParsedCorrectly()
{
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
{
return;
}
// this is a workaround for https://github.com/Microsoft/msbuild/issues/1622
var testInstance = TestAssets.Get("LibraryWithUnresolvablePackageReference")
.CreateInstance()
.WithSourceFiles();
var root = testInstance.Root;
var somePathThatExists = "/usr/local/bin";
var result = new DotnetCommand()
.WithWorkingDirectory(root)
.Execute($"msbuild /p:RestoreSources={somePathThatExists};https://api.nuget.org/v3/index.json /t:restore LibraryWithUnresolvablePackageReference.csproj");
_output.WriteLine($"[STDOUT]\n{result.StdOut}\n[STDERR]\n{result.StdErr}");
result.Should().Fail();
result.StdOut.Should()
.ContainVisuallySameFragment(
@"Feeds used:
/usr/local/bin
https://api.nuget.org/v3/index.json");
}
[Fact]
public void WhenDotnetRunHelpIsInvokedAppArgumentsTextIsIncludedInOutput()
{
@ -85,7 +125,7 @@ namespace Microsoft.DotNet.Cli.MSBuild.Tests
var result = new TestCommand("dotnet")
.WithWorkingDirectory(projectDirectory.Path)
.ExecuteWithCapturedOutput("run --help");
result.ExitCode.Should().Be(0);
result.StdOut.Should().Contain(AppArgumentsText);
}

View file

@ -1,9 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using Microsoft.DotNet.Tools.Test.Utilities;
using System;
using System.IO;
using Microsoft.DotNet.Tools.Test.Utilities;
using FluentAssertions;
using Xunit;
@ -17,53 +17,52 @@ namespace Microsoft.DotNet.New.Tests
var rootPath = TestAssetsManager.CreateTestDirectory().Path;
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute("new");
.Execute($"new console --debug:ephemeral-hive");
DateTime expectedState = Directory.GetLastWriteTime(rootPath);
var result = new TestCommand("dotnet") { WorkingDirectory = rootPath }
.ExecuteWithCapturedOutput("new");
.ExecuteWithCapturedOutput($"new console --debug:ephemeral-hive");
DateTime actualState = Directory.GetLastWriteTime(rootPath);
Assert.Equal(expectedState, actualState);
result.Should().Fail()
.And.HaveStdErr();
result.Should().Fail();
}
[Fact]
public void RestoreDoesNotUseAnyCliProducedPackagesOnItsTemplates()
{
string[] cSharpTemplates = new[] { "console", "classlib", "mstest", "xunit", "web", "mvc", "webapi" };
var rootPath = TestAssetsManager.CreateTestDirectory().Path;
var packagesDirectory = Path.Combine(rootPath, "packages");
foreach (string cSharpTemplate in cSharpTemplates)
{
var projectFolder = Path.Combine(rootPath, cSharpTemplate + "1");
Directory.CreateDirectory(projectFolder);
CreateAndRestoreNewProject(cSharpTemplate, projectFolder, packagesDirectory);
}
Directory.EnumerateFiles(packagesDirectory, $"*.nupkg", SearchOption.AllDirectories)
.Should().NotContain(p => p.Contains("Microsoft.DotNet.Cli.Utils"));
}
private void CreateAndRestoreNewProject(
string projectType,
string projectFolder,
string packagesDirectory)
{
new TestCommand("dotnet") { WorkingDirectory = projectFolder }
.Execute($"new {projectType} --debug:ephemeral-hive")
.Should().Pass();
new RestoreCommand()
.WithWorkingDirectory(projectFolder)
.Execute($"--packages {packagesDirectory} /p:SkipInvalidConfigurations=true")
.Should().Pass();
}
[Fact]
public void RestoreDoesNotUseAnyCliProducedPackagesOnItsTemplates()
{
var cSharpTemplates = new [] { "Console", "Lib", "Web", "Mstest", "XUnittest" };
var rootPath = TestAssetsManager.CreateTestDirectory().Path;
var packagesDirectory = Path.Combine(rootPath, "packages");
foreach (var cSharpTemplate in cSharpTemplates)
{
var projectFolder = Path.Combine(rootPath, cSharpTemplate);
Directory.CreateDirectory(projectFolder);
CreateAndRestoreNewProject(cSharpTemplate, projectFolder, packagesDirectory);
}
Directory.EnumerateFiles(packagesDirectory, $"*.nupkg", SearchOption.AllDirectories)
.Should().NotContain(p => p.Contains("Microsoft.DotNet.Cli.Utils"));
}
private void CreateAndRestoreNewProject(
string projectType,
string projectFolder,
string packagesDirectory)
{
new TestCommand("dotnet") { WorkingDirectory = projectFolder }
.Execute($"new --type {projectType}")
.Should().Pass();
new RestoreCommand()
.WithWorkingDirectory(projectFolder)
.Execute($"--packages {packagesDirectory} /p:SkipInvalidConfigurations=true")
.Should().Pass();
}
}
}

View file

@ -1,13 +1,9 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Microsoft.DotNet.TestFramework;
using Microsoft.DotNet.Tools.Test.Utilities;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using Xunit;
using FluentAssertions;
using Microsoft.DotNet.Cli.Utils;
@ -17,26 +13,27 @@ namespace Microsoft.DotNet.New.Tests
public class GivenThatIWantANewAppWithSpecifiedType : TestBase
{
[Theory]
[InlineData("C#", "Console", false)]
[InlineData("C#", "Lib", false)]
[InlineData("C#", "Web", true)]
[InlineData("C#", "Mstest", false)]
[InlineData("C#", "XUnittest", false)]
[InlineData("F#", "Console", false)]
[InlineData("F#", "Lib", false)]
[InlineData("F#", "Web", true)]
[InlineData("F#", "Mstest", false)]
[InlineData("F#", "XUnittest", false)]
[InlineData("C#", "console", false)]
[InlineData("C#", "classlib", false)]
[InlineData("C#", "mstest", false)]
[InlineData("C#", "xunit", false)]
[InlineData("C#", "web", true)]
[InlineData("C#", "mvc", true)]
[InlineData("C#", "webapi", true)]
[InlineData("F#", "console", false)]
[InlineData("F#", "classlib", false)]
[InlineData("F#", "mstest", false)]
[InlineData("F#", "xunit", false)]
[InlineData("F#", "mvc", true)]
public void TemplateRestoresAndBuildsWithoutWarnings(
string language,
string projectType,
bool useNuGetConfigForAspNet)
{
var rootPath = TestAssetsManager.CreateTestDirectory(identifier: $"{language}_{projectType}").Path;
string rootPath = TestAssetsManager.CreateTestDirectory(identifier: $"{language}_{projectType}").Path;
new TestCommand("dotnet")
.WithWorkingDirectory(rootPath)
.Execute($"new --type {projectType} --lang {language}")
new TestCommand("dotnet") { WorkingDirectory = rootPath }
.Execute($"new {projectType} -lang {language} -o {rootPath} --debug:ephemeral-hive")
.Should().Pass();
if (useNuGetConfigForAspNet)

View file

@ -3,10 +3,7 @@
using FluentAssertions;
using Microsoft.DotNet.Tools.Test.Utilities;
using System;
using System.Linq;
using Xunit;
using Xunit.Abstractions;
namespace Microsoft.DotNet.New.Tests
{
@ -18,9 +15,18 @@ namespace Microsoft.DotNet.New.Tests
var cmd = new DotnetCommand().Execute("new Web1.1");
cmd.ExitCode.Should().NotBe(0);
cmd.StdErr.Should().Be("Unrecognized command or argument 'Web1.1'");
cmd.StdOut.Should().Be("Specify --help for a list of available options and commands.");
}
}
cmd.StdErr.Should().StartWith("No templates matched the input template name: [Web1.1]");
}
[Fact]
public void WhenTemplateNameIsNotUniquelyMatchedThenItIndicatesProblemToUser()
{
var cmd = new DotnetCommand().Execute("new c");
cmd.ExitCode.Should().NotBe(0);
cmd.StdErr.Should().StartWith("Unable to determine the desired template from the input template name: [c]");
}
}
}

View file

@ -216,9 +216,10 @@ namespace Microsoft.DotNet.Tools.Pack.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
new NewCommand()
string newArgs = $"console -o \"{rootPath}\"";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute()
.Execute(newArgs)
.Should()
.Pass();

View file

@ -93,9 +93,10 @@ namespace Microsoft.DotNet.Cli.Publish.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
new NewCommand()
string newArgs = $"console -o \"{rootPath}\"";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute()
.Execute(newArgs)
.Should()
.Pass();

View file

@ -55,9 +55,10 @@ Additional Arguments:
try
{
new NewCommand()
string newArgs = $"classlib -o \"{dir.Path}\"";
new NewCommandShim()
.WithWorkingDirectory(dir.Path)
.ExecuteWithCapturedOutput("-t Lib")
.ExecuteWithCapturedOutput(newArgs)
.Should().Pass();
}
catch (System.ComponentModel.Win32Exception e)

View file

@ -22,9 +22,10 @@ namespace Microsoft.DotNet.Restore.Tests
string dir = "pkgs";
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));
new NewCommand()
string newArgs = $"console -o \"{rootPath}\"";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute()
.Execute(newArgs)
.Should()
.Pass();
@ -48,9 +49,10 @@ namespace Microsoft.DotNet.Restore.Tests
string dir = "pkgs";
string fullPath = Path.GetFullPath(Path.Combine(rootPath, dir));
new NewCommand()
string newArgs = $"classlib -o \"{rootPath}\"";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute("-t lib")
.Execute(newArgs)
.Should()
.Pass();

View file

@ -123,9 +123,10 @@ namespace Microsoft.DotNet.Cli.Run.Tests
string dir = "pkgs";
string args = $"--packages {dir}";
new NewCommand()
string newArgs = $"console -o \"{rootPath}\"";
new NewCommandShim()
.WithWorkingDirectory(rootPath)
.Execute()
.Execute(newArgs)
.Should()
.Pass();

View file

@ -0,0 +1,26 @@
using System;
using FluentAssertions;
using Microsoft.DotNet.Cli.CommandLine;
using Xunit;
namespace Microsoft.DotNet.Tests
{
public class CommandLineApplicationTests
{
[Fact]
public void WhenAnOptionRequiresASingleValueThatIsNotSuppliedItThrowsCommandParsingException()
{
var app = new CommandLineApplication();
app.Option("-v|--verbosity", "be verbose", CommandOptionType.SingleValue);
Action execute = () => app.Execute("-v");
execute.ShouldThrow<CommandParsingException>()
.Which
.Message
.Should()
.Be("Required value for option '-v' was not provided.");
}
}
}

View file

@ -11,9 +11,11 @@ using Microsoft.DotNet.Tools.Test.Utilities;
using Xunit;
using FluentAssertions;
[assembly: CollectionBehavior(DisableTestParallelization = true)]
namespace Microsoft.DotNet.Tests
{
public class GivenThatTheUserIsRunningDotNetForTheFirstTime : TestBase
public class GivenThatTheUserIsRunningDotNetForTheFirstTime : TestBase
{
private static CommandResult _firstDotnetNonVerbUseCommandResult;
private static CommandResult _firstDotnetVerbUseCommandResult;
@ -31,7 +33,7 @@ namespace Microsoft.DotNet.Tests
command.Environment["SkipInvalidConfigurations"] = "true";
_firstDotnetNonVerbUseCommandResult = command.ExecuteWithCapturedOutput("--info");
_firstDotnetVerbUseCommandResult = command.ExecuteWithCapturedOutput("new");
_firstDotnetVerbUseCommandResult = command.ExecuteWithCapturedOutput("new --debug:ephemeral-hive");
_nugetCacheFolder = new DirectoryInfo(testNugetCache);
}
@ -77,9 +79,9 @@ A command is running to initially populate your local package cache, to improve
.And.NotContain("Restore completed in");
}
[Fact]
public void ItCreatesASentinelFileUnderTheNuGetCacheFolder()
{
[Fact]
public void ItCreatesASentinelFileUnderTheNuGetCacheFolder()
{
_nugetCacheFolder
.Should()
.HaveFile($"{GetDotnetVersion()}.dotnetSentinel");
@ -123,10 +125,10 @@ A command is running to initially populate your local package cache, to improve
}
private string GetDotnetVersion()
{
return new DotnetCommand().ExecuteWithCapturedOutput("--version").StdOut
.TrimEnd(Environment.NewLine.ToCharArray());
}
{
return new DotnetCommand().ExecuteWithCapturedOutput("--version").StdOut
.TrimEnd(Environment.NewLine.ToCharArray());
}
private static string NormalizeLineEndings(string s)
{

View file

@ -41,7 +41,6 @@ namespace Microsoft.DotNet.Tests
};
}
}
public static IEnumerable<object[]> LibraryDependencyToolArguments
{
get