Commit Graph

1572 Commits

Author SHA1 Message Date
Ajay Bhargav Baaskaran ba7f955afa Split arguments for the build server properly 2018-02-06 11:32:48 -08:00
Pranav K 84beb5985f Add support for relative paths
* Move path munging in to Razor SDK
* Use AssignTargetPath to determine the target path for outputs and embedded resources

Fixes #1829
Fixes #1847
Fixes #1999
2018-02-05 14:19:52 -08:00
Ajay Bhargav Baaskaran 5a93f68ccc Pass through DebugTool to to debug build server creation 2018-02-05 14:10:32 -08:00
Pranav K 0df6bfb839 Change the casing of Sdk to match other Sdks 2018-02-05 11:20:18 -08:00
Ryan Nowak ff82e743ce Merge branch 'rel/vs15.7' into dev 2018-02-03 20:14:56 -08:00
Ryan Nowak 870f023aa9 Add prelimianry support for extensions to Razor (#2012)
* Add prelimianry support for extensions to Razor

This PR adds MSBuild insfrastructure to the SDK that can understand
concepts we need to expose to the project, code generator and runtime
like:
- Language version
- Configuration
- Extensions (plugins)

As an example of how this works, I've done the wireup for MVC. This will
now generate assembly attributes in your application that can act as a
source-of-truth for what should be included in runtime compilation, and
it's all based on the project-file. This means that it can be delivered
and configured by packages.

The next step here is to implement a loader for RazorProjectEngine based
on these primitives, and then use it in our CLI tools and MVC.

The next step after that is to expose it in VS and VS4Mac through the
project system.

(cherry picked from commit 5b28c06d64)
2018-02-03 20:13:24 -08:00
Ryan Nowak 5b28c06d64
Add prelimianry support for extensions to Razor (#2012)
* Add prelimianry support for extensions to Razor

This PR adds MSBuild insfrastructure to the SDK that can understand
concepts we need to expose to the project, code generator and runtime
like:
- Language version
- Configuration
- Extensions (plugins)

As an example of how this works, I've done the wireup for MVC. This will
now generate assembly attributes in your application that can act as a
source-of-truth for what should be included in runtime compilation, and
it's all based on the project-file. This means that it can be delivered
and configured by packages.

The next step here is to implement a loader for RazorProjectEngine based
on these primitives, and then use it in our CLI tools and MVC.

The next step after that is to expose it in VS and VS4Mac through the
project system.
2018-02-02 17:41:14 -08:00
Ryan Brandenburg 8c328edfb2 Skip flaky test 2018-02-02 16:23:38 -08:00
N. Taylor Mullen ca15840d05 Remove VisualStudioWorkspaceAccessor.Workspace.
- This property used to represent a "primary Workspace". Now that we're moving away from having a "primary Workspace" this needs to go away.

#2001
2018-02-02 15:35:07 -08:00
N. Taylor Mullen ea9a74ee3c Change RazorTextViewConnectionListener to not depend on a primary workspace.
- Updated the `DefaultRazorDocumentManager` to also not be a workspace service. It didn't end up having any workspace specific logic so it made sense to have the lifetime of the IDE.

#2010
2018-02-02 14:04:35 -08:00
Nate McMaster b760102148 Merge branch 'release/2.1' into dev 2018-02-02 13:55:28 -08:00
Pranav K 8461158306 Use consistent file casing for Razor Sdk 2018-02-02 13:42:14 -08:00
Ryan Nowak 07f3c5cb50 Merge branch 'rel/vs15.7' into dev 2018-02-02 13:17:27 -08:00
Ryan Nowak eb5abc6ac5 Add CPS dependencies
Getting this in to avoid pain when rebasing/merging.
2018-02-02 13:16:24 -08:00
Ryan Nowak addedca997 Merge branch 'rel/vs15.7' into dev 2018-02-02 13:15:48 -08:00
Pranav K 35779abd9a Rename Microsoft.AspNetCore.Razor.Sdk to Microsoft.NET.Sdk.Razor 2018-02-02 13:12:29 -08:00
N. Taylor Mullen 4eea2f6992 Change DefaultTagHelperFactsService to not expect a primary workspace.
- Removed `TagHelperFactsServiceInternal` since we had no way of retrieving the internal Workspace service given the exposed public API. Not to mention I think the `TagHelperFactsService` made more sense as a MEF service anyhow.
- Moved `TagHelperFactsServiceInternal` tests to `Microsoft.VisualStudio.Editor.Razor.Test` project and changed them to utilize the non-"internal" version.
- Updated completion service API to rely on non-`TagHelperFactsServiceInternal` pieces.

#2004
2018-02-02 12:02:45 -08:00
Nate McMaster d452ff44b3
Include portable symbols in nupkgs (#2009) 2018-02-02 11:14:25 -08:00
N. Taylor Mullen 64f9474eb1 Change RazorCodeDocumentProvider to not be per-workspace.
- Changed the `RazorCodeDocumentProvider` and its `TextBufferCodeDocumentProvider` dependency to be MEF services. This changes their lifetimes from per-workspace to per-IDE.
- Updated `RazorDirectiveCompletionProvider` to get the code document provider via MEF instead of the old primary workspace".
- Removed language service factory types.

#2007
2018-02-01 17:59:23 -08:00
N. Taylor Mullen fff1c01aa0 Add Mac implementation of VisualStudioWorkspaceAccessor new APIs.
- The Mac implementation does not have fallback logic like the windows variant because Workspaces in VS mac world are spun up / torn down regularly. We don't want to be tracking down bugs that involve us adding services or Razor logic to Workspaces that have nothing to do with Razor.
- Added a test for the `DefaultVisualStudioWorkspaceAccessor`. Could not add other tests due to limitations of MonoDevelop's abstractions.

#1989
2018-02-01 14:51:23 -08:00
N. Taylor Mullen 6d2460ae7f Update DefaultRazorEditorFactoryService to be per-workspace.
- Updated the a `VisualStudioWorkspaceAccessor` API in windows to enable the factory to retrieve a workspace given a text buffer.
- Added a way to add test services to `AdhocWorkspace` so we can test against services being retrieved from a `Workspace`. This will be much more common once we rely on services coming from `TextBuffer`s in our other tooling pieces.
- Added tests for the default workspace provider.

#1989
2018-02-01 14:51:23 -08:00
N. Taylor Mullen 5e454a36fa Change TextBufferProjectService to not be per-workspace.
- Updated impacted code to now expect this from MEF.

#1997
2018-02-01 14:51:23 -08:00
Ryan Nowak e3932aa1ec Merge remote-tracking branch 'origin/release/2.1' into dev 2018-02-01 13:36:07 -08:00
Ryan Nowak 818d4256aa Fix #1999
The fix for this for preview1 is to ignore any files with an absolute path. MvcPrecompilation
ignores files outside the project root, and we're aiming for parity.

This will have a proper fix in preview2
2018-02-01 13:05:45 -08:00
ASP.NET CI f3817ef738 Update dependencies.props
[auto-updated: dependencies]
2018-02-01 04:19:14 +00:00
Nate McMaster 8653225b0c Update dependencies.props to 2.1.0-preview-28193, build tools to 2.1.0-preview1-1010 [ci skip]
Scripted changes:
- updated travis and appveyor.yml files to only build dev, ci, and release branches
- updated dependencies.props
- updated korebuild-lock.txt
- updated korebuild.json to release/2.1 channel
2018-01-31 15:01:13 -08:00
Ajay Bhargav Baaskaran 4f5a5854b6 Skipping flaky tests on windows as well 2018-01-31 11:28:07 -08:00
N. Taylor Mullen 99010aaea4 Change EditorSettingsManager to not be per-workspace.
- Lifted `DefaultEditorSettingsManagerInternal`s state / event handling functionality into its `DefaultEditorSettingsManager`.
- Re-purposed `EditorSettingsManagerInternal` into a less-API heavy middleman `WorkspaceEditorSettings` for any workspace services concerned with editor settings to consume.
- Moved `DefaultEditorSettingsManagerInternal` into the Editor.Razor assembly and renamed it to `DefaultWorkspaceEditorSettings` since it needed the `EditorSettingsManager` API to function properly. The contract still exists at the `CodeAnalysis.Razor.Workspace` level.

#1982
2018-01-30 16:01:55 -08:00
Ajay Bhargav Baaskaran 9244383ec7 Modified integration test infrastructure to test build server 2018-01-30 15:55:17 -08:00
Ajay Bhargav Baaskaran b677a9e43f Skip only on non-windows 2018-01-29 18:56:18 -08:00
Ajay Bhargav Baaskaran 399216730a Temporarily skip tests 2018-01-29 18:27:45 -08:00
Pranav K 13388ca6ae Make testapps run without deployment 2018-01-29 18:12:35 -08:00
N. Taylor Mullen c0cb8f009c Update RazorProjectEngine to use RazorConfiguration.
- In this PR we do away with `CreateDesignTime` on the `RazorProjectEngine`. Instead we now have an overload that takes in a configuration and does the right thing.
- Updated `RazorProjectEngineBuilder` to have a configuration.
- Updated `RazorConfiguration` to only have a `Default`. Setting up a razor configuration for design time now requires calling code to construct the configuration manually.
2018-01-29 16:08:17 -08:00
N. Taylor Mullen 80f943caef Flow RazorLanguageVersion to RazorEngine.
- Restructured RazorLanguageVersion to be a sealed concrete type to enable things like `RazorLanguageVersion.Latest`; it also allows us to make broader changes in the future. Also, in the future if we want to add support for overriding operators to enable greater than comparisons we can as well.
- Removed version validity checks because we restrict who can construct a `RazorLanguageVersion` now. This way we don't have to check for valid versions all throughout our code.
- Added a simple `ProjectExtensibilityConfiguration` => `RazorLanguageVersion` method in the `DefaultProjectExtensibilityConfigurationFactory` to temporarily enable letting the system operate on the `RazorLanguageVersion`. Eventually that entire class will change.

#1961
2018-01-29 16:08:17 -08:00
Pranav K cf578e103b Merge remote-tracking branch 'origin/release/2.1' into dev 2018-01-29 11:17:55 -08:00
Pranav K 766862390b Print an error when Razor targets are invoked from a multitargeting build 2018-01-29 11:17:32 -08:00
Pranav K ee9f9225c3 Remove unused property 2018-01-29 07:45:46 -08:00
N. Taylor Mullen 84bc0fa4c9 Change ForegroundDispatcher to be a MEF service.
- The `ForegroundDispatcher` needed to be accessible by services without requiring a workspace; given that it doesn't have any ties to the `Workspace` other than being a service of one I was able to move it into a MEF service.
- Updated all workspace inclusions of the dispatcher to use importing constructors instead.
- Updated the Mac + Windows implementations to be exported as MEF pieces.

#1979
2018-01-26 17:14:40 -08:00
Ajay Bhargav Baaskaran 004ff204aa Refactoring, naming cleanup and tests for build server
- Multiple renames and cleanup
- Added tests for ServerProtocol and RequestDispatcher
- Added ServerLifecycleTest
2018-01-26 16:19:22 -08:00
Pranav K 42c3102cd4 Changes per PR comments 2018-01-26 11:04:24 -08:00
Pranav K bd72b1bac9 Don't import the SDK when cross-targeting 2018-01-26 11:04:24 -08:00
Pranav K 44f102d6ff Remove multitargeting target 2018-01-25 16:07:44 -08:00
Pranav K 04bf7eec0f Introduce a Razor SDK package
Move parts of Razor.Design in to an SDK that ship with the CLI.
2018-01-25 14:26:30 -08:00
N. Taylor Mullen 771a7e35a4 Add MVC support for RazorProjectEngine.
- Make `RazorProjectEngine` call paths for all feature registrations.
- Add `DefaultMvcImportFeature` for latest and 1.X MVC.
- Ported `AddTargetExtension` and `AddDirective` to `RazorProjectEngineBuilderExtensions`.
- Added tests and a test file system project type.
- Moved obsolete `IRazorEngineBuilder` methods to the bottom of each file. Will actually obsolete the methods once `RazorProjectEngine` is working end-to-end.

#1828
2018-01-25 12:26:11 -08:00
Ryan Brandenburg bc6d726c36 Preview2 2018-01-25 09:37:00 -08:00
N. Taylor Mullen a01fa1c5b6 Flow RazorLanguageVersion to RazorEngine.
- Restructured RazorLanguageVersion to be a sealed concrete type to enable things like `RazorLanguageVersion.Latest`; it also allows us to make broader changes in the future. Also, in the future if we want to add support for overriding operators to enable greater than comparisons we can as well.
- Removed version validity checks because we restrict who can construct a `RazorLanguageVersion` now. This way we don't have to check for valid versions all throughout our code.
- Added a simple `ProjectExtensibilityConfiguration` => `RazorLanguageVersion` method in the `DefaultProjectExtensibilityConfigurationFactory` to temporarily enable letting the system operate on the `RazorLanguageVersion`. Eventually that entire class will change.

#1961
2018-01-25 09:17:37 -08:00
Ajay Bhargav Baaskaran d9b7ff238f Unified cli tools
- Removed GenerateTool and TagHelperTool
- rzc now handles four commands (server, shutdown, discover and
generate)
- Removed RequestCommand
2018-01-24 15:38:11 -08:00
Ajay Bhargav Baaskaran 4500de5862 Build server working end to end
- Added a UseServer switch
- Updated tasks to use the build server in enabled
2018-01-24 15:30:37 -08:00
N. Taylor Mullen 5c6ff4366f Make it so MPacks generate in Mac build.
#1966
2018-01-24 12:28:01 -08:00
N. Taylor Mullen aa3fb32220 Revert "Revert "Add contracts for RazorProjectEngine.""
This reverts commit f301d92332.
2018-01-24 11:20:18 -08:00