Commit graph

354 commits

Author SHA1 Message Date
Daniel Plaisted
cc5a67d2e5 Refactor / fix implicit version tests 2018-11-08 12:11:30 -08:00
Daniel Plaisted
bfcc6fa2a0 Merge CLI 2.2.1xx changes 2018-10-08 18:59:34 -07:00
Abood AbuHashem
7d2f3151e8
Implement the dotnet list package command.
This commit implements the `dotnet list package` command.
2018-09-20 10:26:01 -07:00
William Li
f3c7f5ed78 Merge remote-tracking branch 'oldcli/release/2.2.1xx' into merge-release/2.2.1xx 2018-09-09 20:42:17 -07:00
Livar Cunha
7bb693bff5 We have a few tests that write their own NuGet.Config file to use during restore. Those tests need access to the ExternalRestoreSources value to be added to this NuGet config so that they can restore properly. This change writes a file in the test/artifacts folder containing the value of ExternalRestoreSources value. The tests can then use it to write that to their NuGet.Config. There is a failure in ProdCon that this addresses. 2018-08-28 17:16:58 -07:00
Nick Guerrera
ceffacfef8 Merge branch 'release/2.2.1xx' into merges/release/2.1.4xx-to-release/2.2.1xx 2018-07-17 18:17:04 -07:00
Peter Huene
d9e8947ff4
Revert implementation of the --mode option for the publish command.
This commit reverts the implementation of the `--mode` option for the `dotnet
publish` command.  A bug in the apphost prevents this feature from working
properly in some cases and there currently is not a mechanism to service it
with this feature.

The team has decided to move this feature to 2.2.1xx for the .NET Core SDK.

Fixes dotnet/sdk#2380.
2018-07-09 12:46:13 -07:00
Nick Guerrera
1326c79a5d Merge branch 'release/2.2.1xx' into merges/release/2.1.4xx-to-release/2.2.1xx 2018-06-29 15:25:24 -07:00
Livar Cunha
e2b679c4bb Merge branch 'master' of /Users/livarcocc/Documents/git/cli into merge_master_cli
* 'master' of /Users/livarcocc/Documents/git/cli: (1063 commits)
  Updating signing project to use new intermediate directory (int).
  Update runtimeconfig.json doc for 2.1 (#9382)
  Shortening the path to the intermediate folder by renaming it to int.
  fix typo (#9364)
  Updating asp.net to 2.2.0 as well.
  Updating the build and tests to work with the 2.2.0 runtime.
  Simplified combining dictionaries in Telemetry
  Fixing 'Channel' and 'BranchName': "release/2.1.4xx" to "master" (#9362)
  Fix extraction of folders (#9335)
  Update Sha256Hasher.cs
  Fix relative path tool path (#9330)
  Insert updated SDK from 2.1.4xx branch
  MSBuild 15.8.60
  Fix crash when user home directory cannot be determined.
  Make `CliFolderPathCalculator` a static class.
  Don't add the ReleaseSuffix to the branding on the CLI when DropSuffix is set to true.
  Add retry when Directory.Move (#9313)
  Override new SdkResult public properties
  Add reference to Microsoft.Build.NuGetSdkResolver
  Disable crossgen for MSBuild inline-task refs
  ...
2018-06-25 22:38:01 -07:00
Peter Huene
bc96902c61
Implement mode option for dotnet publish.
This commit implements a `mode` option that can control how an application is
published with the `dotnet publish` command.

There are three supported modes:

* self-contained: publishes a self-contained application (same as
--self-contained).
* fx-dependent: publishes a framework-dependent application (with an
application host when a runtime is specified).
* fx-dependent-no-exe: publishes a framework-dependent application without an
application host.

The default when publishing without a runtime specified is
`fx-dependent-no-exe`.

The default when publishing with a runtime specified is `self-contained`.

`fx-dependent` requires netcoreapp2.1 or later when a runtime is specified.

The `--self-contained` option is still supported, but is now hidden so that
users will be encouraged to move to the `--mode` option.

Fixes #6237.
2018-06-11 15:43:55 -07:00
William Li
2594a6d7ec
Always store absolute full path in directory and file path (#9363)
There is no need to store relative path today. But some part of the system does not accept relative path and there is no indication if it is storing full path or not. This is the root cause of https://github.com/dotnet/cli/issues/9319

“someplace” means different full path for Path class on unix and Windows. And the mock file system uses real Path class. Change tests' setup to use essentially “TEMPATH/someplace” instead of  “someplace”
2018-06-06 11:22:19 -07:00
Livar Cunha
2f0f270a73 Updating the build and tests to work with the 2.2.0 runtime. 2018-05-31 19:14:24 -07:00
Tanner Gooding
a8856ddccc Merge remote-tracking branch 'dotnet/release/2.1.2xx' into merges/release/2.1.2xx-to-release/2.1.3xx 2018-05-03 15:24:39 -07:00
Peter Huene
b2b3947c68
Fix Razor server shutdown on Windows.
On Windows, the Razor server correctly creates the pid file with
`FileAccess.Write` and `FileOptions.DeleteOnClose`.  This requires a share mode
of `FileShare.Write | FileShare.Delete` to open.  However, the
`dotnet build-server shutdown` command was opening the file with
`FileShare.Read`.  As a result, an `IOException` was being thrown and was not
handled.

This change first opens the file with the appropriate share access and also
properly handles a failure to access or read the contents of the pid file.

Additionally, an integration test was added to test that Razor server shutdown
works as expected.

Fixes #9158.
2018-04-27 13:52:17 -07:00
Wes Haggard
65d5730631 Replace alpine with linux-musl builds
We still build linux-musl on the alpine OS but we no longer
produce a alpine installer/tar file instead we just have the
linux-musl version.
2018-04-20 13:23:00 -07:00
Peter Huene
1ade191cb6
Implement Razor server discovery by pid file.
Previously, Razor server discovery for the `build-server shutdown` command was
implemented by invoking MSBuild on a project file in the current directory to
evaluate the path to the Razor server dll.  This was problematic since it would
only discover a single running Razor server instance and required that the user
run the `build-server shutdown` command from a specific location.

Razor's server now writes a "pid file" to a well-known location
(`~/.dotnet/pids/build`) which the command can now enumerate to discover, and
shutdown, the running Razor servers.

This commit changes the Razor server discovery to use the pid files and removes
the requirement that users need to run the command in specific directories to
work.

Fixes #9084.
2018-04-20 10:49:31 -07:00
William Li
b0ee5db411
consume bring your own shim(byos) (#9018)
If there are shims packaged by convention in nupkg. Shim Repository will simply copy it to the right location.

The query interface ToolPackageInstance will be in charge of finding the shim folder and filter the right RID. Shim Repository will pick the right file after the folder is located since Shim Repository knows the shim name and it also book keep the files at uninstallation.
During development, due to the wrong adapter level. The mock duplicated too much logic. So, I corrected the abstraction level to lower (only create shim). And replaced the existing mock with a much smaller one without any atomic control and file move, copy logic. At the same time. The chmod, which is a IO action, causes problem during tests. So I added adapter layer to it and put it in Util.
2018-04-10 15:42:50 -07:00
Livar
7cb7535bae
Merge branch 'master' into merges/release/2.1.3xx-to-master 2018-04-06 09:05:57 -07:00
Livar
721c068376
Merge branch 'release/2.1.2xx' into merges/release/2.1.1xx-to-release/2.1.2xx 2018-04-04 10:15:45 -07:00
Livar Cunha
b1fca8c4d2 Replacing the short form version of implicit msbuild parameters with longform ones. 2018-04-02 22:54:51 -07:00
Livar Cunha
10289504a8 Replacing all implicit msbuild parameters from using a forward slash to using a dash. 2018-04-02 14:49:52 -07:00
William Li
e70f07178a
Apphost shim (#8893)
* Publish app host to folder under SDK

* Use carried apphost as shim

* Remove full framework launcher

* Fix test run command issue

* Use latest release/2.1 build

* Test with 32 bit env

* Add missing return

* Update to latest prodcon build

* Add xlfs
2018-04-02 12:37:25 -07:00
Peter Huene
abcdeba455
Merge pull request #8950 from peterhuene/server-command
Implement `buildserver shutdown` command.
2018-03-30 17:19:29 -07:00
Peter Huene
3488a84c35
Implement buildserver shutdown command.
This commit implements the `buildserver shutdown` command that can be used to
shutdown MSBuild, VB/C# compiler, and Razor build servers.

By default, all three build servers are shut down.  Options can be passed to
shut down a subset of the build servers.

Fixes #8185.
2018-03-30 15:13:52 -07:00
Daniel Plaisted
a9742686ed Infer test packages path in tests if TEST_PACKAGES environment variable isn't set 2018-03-30 14:39:12 -07:00
Livar Cunha
6600612b9e Adding new docker files for opensuse.42.3, ubuntu.18.04 and fedora.27 and removing the project.json CLI from the build. It was not being used anymore. 2018-03-27 10:24:10 -07:00
Jeff Kluge
8d7009cb83 Move some projects to netstandard2.0 (#8692)
* Move some projects to netstandard2.0

* Use version agnostic $(TargetFrameworkIdentifier) property to make changing versions easier since we only care about .NET Framework vs .NET Standard
* Add missing project to solution file
* Update TestPackageProjects.targets to use netstandard2.0 on non-Windows
2018-03-22 16:11:51 -07:00
William Lee
149bdfd0fa
Change command order for tools (#8862)
dotnet install tool -> dotnet tool install
dotnet uninstall tool -> dotnet tool uninstall
dotnet list tool -> dotnet tool list
dotnet update tool -> dotnet tool update
2018-03-21 19:12:32 -07:00
Dan Moseley
f9c40ce94d Log Windows product type and installation type, and Linux libc version (#8688)
* Installation type

* Product Type

* Libc Release and Version

* Catch all

* Fix test

* Fix mac test

* Extract class

* Remove CharSet

* Remove extraneous assignment

* Missing space

* Typo

* Fix comment XML

* CR feedback
2018-02-27 18:55:35 -08:00
Jeff Kluge
8f7b58dd66
Move some projects to netstandard2.0 (#8692)
* Move some projects to netstandard2.0

* Use version agnostic $(TargetFrameworkIdentifier) property to make changing versions easier since we only care about .NET Framework vs .NET Standard
* Add missing project to solution file
* Update TestPackageProjects.targets to use netstandard2.0 on non-Windows
2018-02-27 13:59:59 -08:00
Peter Huene
aab9af71b8
Implement uninstall tool command.
This commit implements the `uninstall tool` command.

The `uninstall tool` command is responsible for uninstalling global tools that
are installed with the `install tool` command.

This commit heavily refactors the ToolPackage and ShellShim namespaces to
better support the operations required for the uninstall command.

Several string resources have been updated to be more informative or to correct
oddly structured sentences.

This commit also fixes `--version` on the install command not supporting ranges
and wildcards.

Fixes #8549.

Issue #8485 is partially fixed by this commit (`--prerelease` is not yet
implemented).
2018-02-19 22:46:16 -08:00
William Lee
5fa558a2ed
Atomic install tool (#8518)
* Make dotnet install tool atomic

Apply TransactionScope to tool install. It can handle the correct timing
of roll back and commit.

Convert existing ToolPackageObtainer and ShellShimMaker by passing logic
via lambda to an object that has IEnlistmentNotification interface. It
turns out the very clean.

Use .stage as staging place to verify of package content, and shim. It
should roll back when something is wrong. When there is ctrl-c, there
will be garbage in .stage folder but not the root of the package folder.
2018-02-06 13:38:06 -08:00
Peter Huene
7ebfdde749
Add verbosity option to install tool command.
This commit adds the `--verbosity` option to the `install tool` command.

MSBuild/NuGet output is now controllable by the user and defaults to being "quiet".

This enables users to see warnings from NuGet that otherwise would be swallowed
unless NuGet returned a non-zero exit code. As a byproduct of this change, the
exception handling and error messages related to obtaining tool packages was
retooled. We no longer display `install tool` command line help for installation
failures, as it should only be displayed for command line syntax errors.

Fixes #8465.
2018-01-31 15:19:34 -08:00
William Lee
05052c0541
Use rich mock to test InstallCommand (#8402)
To ensure the mock has the same behavior the component has, run mock under the same tests the adapter has.
It is a common problem that moq has -- "everything is mocked out, you are not test anything"
2018-01-24 10:16:27 -08:00
Jan Vorlicek
1abd2d9209 Enable Alpine 3.6 CLI build
This change enables CLI build for Alpine 3.6 and also adds CI job for
it. It is mostly based on changes that were necessary to
enable building of rhel.6 CLI
2017-12-13 12:10:44 +01:00
Livar Cunha
90e254b9ed More fixes that were missing from the merge. 2017-12-07 13:23:27 -08:00
Livar Cunha
5a0e95897e Merge remote-tracking branch 'dotnet/release/15.5' into merges/release/15.5-to-master-20171206-080040
* dotnet/release/15.5: (26 commits)
  Fixing the reference to Microsoft.Build.Runtime from Cli.Utils.Tests. It was using the wrong package version property.
  One more old style version package name needed to change in redist.
  Fixing the versions of MSBuild and passing the right property to find roslyn files.
  Use "15.5.179" for the other Microsoft.Build.* packages
  Moving the 'MicrosoftBuildPackageVersion' forward.
  Fixing "RuntimeFrameworkVersion"
  Updating version naming convention.
  Fixed a typo...
  Nuget.config update to align with CLI:master - add comments in DependencyVersions.prop
  Even more package dependency re-names...
  Third pass clean-up of package names.
  Second pass clean-up of package names; resequencing download.
  Updating dependency version properties in alignment with sample orchestrated build file at: https://dotnetfeed.blob.core.windows.net/orchestrated/20171129-03/orchestration-metadata/PackageVersions.props
  The access key is already resolved: 'CoreSetupBlobAccessTokenParam'
  Fixed another typo...
  Fixed typo...
  The first pass will need the extra args [same as run-build.ps1].
  Dependency Uptake: download and import a package version props file.
  Accounting for MSRC builds with pre-set 'CoreSetupBlobRootUrl' and 'CoreSetupBlobAccessToke' properties.
  Changes per code review...
  ...

	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/EmptyItemGroup/EmptyItemGroup.csproj
	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Lib/Lib.csproj
	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/Net452AndNetCoreApp10Lib/Net452AndNetCoreApp10Lib.csproj
	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/ValidRef/ValidRef.csproj
	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithDoubledRef/WithDoubledRef.csproj
	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondOnItem/WithExistingRefCondOnItem.csproj
	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithExistingRefCondWhitespaces/WithExistingRefCondWhitespaces.csproj
	TestAssets/NonRestoredTestProjects/DotnetAddP2PProjects/WithRefNoCondNonUniform/WithRefNoCondNonUniform.csproj
	TestAssets/TestProjects/AppWithMultipleFxAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj
	TestAssets/TestProjects/MSBuildAppWithMultipleFrameworksAndTools/MSBuildAppWithMultipleFrameworksAndTools.csproj
	TestAssets/TestProjects/XunitMulti/VSTestXunitDesktopAndNetCore.csproj
	build/BundledTemplates.props
	build/DependencyVersions.props
	build/NugetConfigFile.targets
	build/Test.targets
	build_projects/dotnet-cli-build/dotnet-cli-build.csproj
	dir.props
	run-build.sh
	src/Microsoft.DotNet.Archive/Microsoft.DotNet.Archive.csproj
	src/Microsoft.DotNet.Cli.Utils/Microsoft.DotNet.Cli.Utils.csproj
	src/Microsoft.DotNet.Configurer/Microsoft.DotNet.Configurer.csproj
	src/dotnet/dotnet.csproj
	src/redist/redist.csproj
	src/tool_fsharp/tool_fsc.csproj
	test/ArgumentForwardingTests/ArgumentForwardingTests.csproj
	test/EndToEnd/EndToEnd.csproj
	test/Microsoft.DotNet.Cli.Sln.Internal.Tests/Microsoft.DotNet.Cli.Sln.Internal.Tests.csproj
	test/Microsoft.DotNet.Cli.Utils.Tests/Microsoft.DotNet.Cli.Utils.Tests.csproj
	test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj
	test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj
	test/binding-redirects.Tests/binding-redirects.Tests.csproj
	test/dotnet-add-package.Tests/dotnet-add-package.Tests.csproj
	test/dotnet-add-reference.Tests/dotnet-add-reference.Tests.csproj
	test/dotnet-back-compat.Tests/dotnet-back-compat.Tests.csproj
	test/dotnet-help.Tests/dotnet-help.Tests.csproj
	test/dotnet-migrate.Tests/dotnet-migrate.Tests.csproj
	test/dotnet-new.Tests/dotnet-new.Tests.csproj
	test/dotnet-remove-package.Tests/dotnet-remove-package.Tests.csproj
	test/dotnet-remove-reference.Tests/dotnet-remove-reference.Tests.csproj
	test/dotnet-restore.Tests/dotnet-restore.Tests.csproj
	test/dotnet-sln-add.Tests/dotnet-sln-add.Tests.csproj
	test/dotnet.Tests/dotnet.Tests.csproj
2017-12-07 09:55:12 -08:00
John Beisner
f0abfb6b12 Updating dependency version properties in alignment with sample orchestrated build file at: https://dotnetfeed.blob.core.windows.net/orchestrated/20171129-03/orchestration-metadata/PackageVersions.props 2017-12-01 20:07:48 -08:00
Peter Huene
40b0e0fcec Make --no-build imply --no-restore for pack command.
This commit makes the `--no-build` option for the pack command
automatically imply `--no-restore`.

Fixes issue #7472.
2017-11-27 23:53:22 -08:00
William Lee
584d3f0502
Global tools package obtain (#8035)
Add ExeutablePackageObtainer

Given a tools package id, it can create a fake project and restore to correct folder

- DI, aka no circular dependency of commands
- Parser of config XML
- I try to create test nupkg at build time, so I can run test and debug
easily with VSCode. The code is in test csproj.
2017-11-21 20:10:06 -08:00
Livar Cunha
62ae014c37 Making this repo consume the dotnet-sdk-internal zip and produce a full core-sdk by using sdk-internal, runtime, lzma, templates and store. Also deleted a bunch of now, unecessary code. I am sure there is more to be deleted though. 2017-10-13 10:45:50 -07:00
Daniel Plaisted
65b0df5b43 Rename output folder from out to bin
(cherry picked from commit 97b7553e31)
2017-09-27 14:45:04 -07:00
Daniel Plaisted
9f3bbc40a2 Use a shorter path for test working directories, get rid of Stage 0 project.json based CLI
(cherry picked from commit 4c3b13e4a8)
2017-09-27 14:40:57 -07:00
Daniel Plaisted
4cd03dcae4 Use shorter output paths to avoid max path issues on Windows
For example, "out/2" instead of "artifacts/stage2"

(cherry picked from commit dcb3a7ade7)
2017-09-27 14:40:13 -07:00
Daniel Plaisted
2b134c91fe Support new artifacts layout in tests and other build logic
(cherry picked from commit 13da213183)
2017-09-27 14:20:05 -07:00
Daniel Plaisted
8385d37185 Move dir.props to auto-imported Directory.Build.props
This is necessary for setting the intermediate output path to work correctly

(cherry picked from commit ae0aa8ed24)
2017-09-27 14:16:37 -07:00
Nick Guerrera
6fad8be40a Fix warnings in test projects 2017-09-27 13:29:08 -07:00
Jan Vorlicek
90e217831b Enable RHEL 6 support
This change enables RHEL 6 support. It also adds a new command line option to the
run-build.sh script that enables passing in a folder containing a bootstrap CLI.
This helps in bringup of new target platforms.
2017-09-21 15:20:55 +00:00
Livar Cunha
3efd44f935 Removing Microsoft.DotNet.TestFramework from the product code and from the SDK deployment and moving the code to the test folder. 2017-09-15 09:49:19 -07:00
Daniel Plaisted
97b7553e31 Rename output folder from out to bin 2017-09-01 16:43:02 -07:00