Commit Graph

1598 Commits

Author SHA1 Message Date
N. Taylor Mullen e200b69511 Change IImportProjectFeature to consume RazorProjectItems.
- Updated all implementations of `IImportProjectFeature`; for MVC I went ahead and made a single project item that's always returned for MVC scenarios. That project item is smart about returning its content in a light-weight stream fashion.
- Had to add a `RazorProjectItem` => `RazorSourceDocument` conversion mechanic into `DefaultRazorProjectEngine`.
- Added tests for `DefaultRazorProjectItem.ConvertToSourceDocument`.
- Removed the `ProjectEngine` API from `VisualStudioRazorParser`. This was unrelated but was missed feedback.

#2068
2018-02-15 11:31:18 -08:00
Pranav K 501c180b5f Use properties in package props to redirect imports 2018-02-15 10:40:27 -08:00
Ryan Nowak e5eda0b276 Merge branch 'release/2.1' into dev 2018-02-14 12:59:19 -08:00
Ryan Nowak 02200d4c11 Integrate new WebSDK
One of these tests had to be updated and split into two because the
expectations of the test weren't totally right.

I also logged https://github.com/aspnet/Razor/issues/1986 during this,
we didn't consider the impact of putting this logic in the WebSDK on
class library.
2018-02-14 12:48:49 -08:00
Ryan Nowak 3e449ec3de Update KoreBuild and deps 2018-02-14 12:48:49 -08:00
N. Taylor Mullen 133eff3119 Move to RazorProjectEngine.
- Instead of using Razor/Mvc TemplateEngine use `RazorProjectEngine`. This involved changing several locations (each of which used `RazorTemplateEngine` in an entirely different way) to use the RazorProjectEngine's two Process methods.
- Changed an unused public API `VisualStudioRazorParser.TemplateEngine` to `VisualStudioRazorParser.RazorProjectEngine`.
- Ported the remainder of `RazorEngineBuilder`'s extension methods over to `RazorProjectEngineBuilder`. These were used in tests and our `RazorGenerate` tool.
- Added a few test helper methods/classes to enable simple testing of the `RazorProjectEngine`.
- Resolved several test hacks that were working around little discrepancies each of the `RazorTemplateEngine` APIs.
- Changed the template engine factory service to be a project engine factory service.
2018-02-14 12:40:23 -08:00
Ryan Nowak 0c6ec09958 Addressed Taylors feedback 2018-02-13 16:21:18 -08:00
Ryan Nowak 82579b6333 Get rid of RazorConfiguration.DesignTime
This change makes it so that we no longer create 'design time' engines.
The choice of design time or runtime is made when we initiate a code
generation operation.

Options instances are now created as part of the CodeDocument
initialization. Our existing code can still be created using a
RazorEngine so our passes that initialize the options still support the
old code path.
2018-02-13 16:21:18 -08:00
Pranav K 010b43cedf Make imports work without warnings or errors when the Sdk is referenced via MsBuild and package. 2018-02-13 13:45:42 -08:00
Pranav K 6be6229d18 Include the buildMultiTargeting folder in the Sdk package 2018-02-12 18:00:58 -08:00
Ryan Nowak c733156596 SDK changes needed to decouple Razor from MVC 2018-02-12 14:08:57 -08:00
ASP.NET CI 19ec125880 Update dependencies.props
[auto-updated: dependencies]
2018-02-11 12:37:35 -08:00
N. Taylor Mullen 3375fc8b99 Change RazorProjectEngine to operate on RazorProjectItems.
- Removed the `Process(string)` overload to make it extra clear that you must operate on project items. This way we also don't need to worry about the various formats of paths that can flow through the system.
- Updated tests to use the new project item format.
- Did a few formatting fixes on unrealted files.

#2049
2018-02-09 17:24:27 -08:00
Ryan Nowak 0c6aadb897 Add a test for design time builds #1846
This change adds a test to verify that Razor targets don't show up in
design time builds when RazorCompileOnBuild=true

We don't want to add a significant perf cost to design time builds since
they affect project load.
2018-02-09 15:33:19 -08:00
N. Taylor Mullen 84bc74ea9f Move to RazorProjectFileSystem.
- Changed all existing APIs to utilize `RazorProjectFileSystem`. This was possible because `RazorProjectFileSystem` inherits from RazorProject.
- Renamed `FileSystemRazorProject` to `DefaultRazorProjectFileSystem`.
- Renamed FileSystemRazorProjectItem` to `DefaultRazorProjectItem`.
- Obsoleted `RazorProject.Create`

#1828
2018-02-09 11:49:31 -08:00
Nate McMaster 06c2f0cfd2 Merge branch 'release/2.1' into dev 2018-02-09 10:12:41 -08:00
Nate McMaster 1a77aecf68 Align NETStandard.Library version variable with Universe 2018-02-09 10:08:09 -08:00
Pranav K e537cdd319 Prepare for Razor Sdk to be imported by Web Sdk 2018-02-08 15:14:47 -08:00
N. Taylor Mullen 6c75f29419 Include VSIX symbols in build output.
#2037
2018-02-08 14:36:07 -08:00
Ajay Bhargav Baaskaran 8b78b4f421 Cleaned up logging in build server 2018-02-07 23:52:54 -08:00
Ajay Bhargav Baaskaran f991b9ae48 Better comment 2018-02-07 18:23:33 -08:00
Ryan Nowak 2ae925a0f2 Update SDK with tooling changes
These are some updates to the SDK based on the work going on in the
VS 15.7 branch. I porting the SDK changes here early for ease of
testing.
2018-02-06 18:21:33 -08:00
Ryan Nowak 6d757988c9 Integrate new Sdk
The project file change is a workaround for
https://github.com/Microsoft/msbuild/issues/2874
2018-02-06 15:41:31 -08:00
Ajay Bhargav Baaskaran 0a7edd665e Added another integration test 2018-02-06 14:33:47 -08:00
N. Taylor Mullen 7490b4413c Change GenerateMPACK ItemGroup names to be non-plural. 2018-02-06 12:13:17 -08:00
N. Taylor Mullen 83c31f611f Update GenerateMPACK to capture PDBs.
- VS Mac expects pdbs to sit side-by-side.

#1968
2018-02-06 12:13:17 -08:00
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