Commit Graph

62 Commits

Author SHA1 Message Date
Pranav K ac3065a9e1
Temporary workaround to make Razor Windows build on dotnet-ci 2018-03-22 12:17:06 -07:00
Pranav K 8631f287d9 Add a few more Razor Sdk fixes
* UseSharedCompilation to determine the default value of UseRazorBuildServer
* Generate AssemblyDescriptionAttribute
2018-03-21 08:44:55 -07:00
Pranav K 2bc3466e3d Do not write generated files to disk if the input has parser errors
Fixes #2169
2018-03-19 21:30:47 -07:00
Ryan Nowak 6e4a968e12 Fix #2149 give generated files distinct extension
Gives our generated a files an extension that isn't used for any other
purpose (that we know of). This is handy for tooling to be able to
quickly know if a file is 'ours'. This comes up in places like
IVsSymbolicNavigationNotify (go to definition).
2018-03-19 12:59:16 -07:00
Ajay Bhargav Baaskaran 767e5a12c3 Display errors from build server as part of MsBuild output 2018-03-19 10:49:00 -07:00
Pranav K b74582e101 Ensure PreserveCompilationContext is set if we're targeting precompilation tool
PreserveCompilationContext must be set for precompilation tool to work, even when
the app has no views.

Fixes #2168
2018-03-15 12:49:56 -07:00
Pranav K 5f69a01cc5
RazorSdk - Attribute code generation fixes
* Allow the type name for ProvideApplicationPartFactoryAttribute to be specified.

* Generate ReleatedAssemblyAttribute in class library projects
2018-03-14 23:09:28 -07:00
Pranav K 425724ce28 Avoid generating RelatedAssemblyAttribute when RazorSdk isn't in play 2018-03-13 13:54:02 -07:00
Pranav K 483fba5972 Generate application part attributes
* Add support for generating attributes on Razor assembly
* Generate ProvideApplicationPartFactoryAttribute on Razor assembly
* Generate RelatedAssemblyAttribute on application assembly
2018-03-09 14:36:55 -08:00
Ajay Bhargav Baaskaran e085441ad3 Don't limit parallel threads for xunit tests 2018-03-07 10:43:25 -08:00
Pranav K c4ba279fb5
Skipping flaky test and additional additional diagnositcs to Shutdown command 2018-03-06 09:15:53 -08:00
Pranav K 0d321771ad
Make UseRazorBuildServer=true by default 2018-03-06 09:15:52 -08:00
Pranav K 41c923926e Make RazorCompileOnBuild=true
Fixes #1986
2018-03-05 11:29:44 -08:00
Pranav K 29bd5f49dd Fix build break 2018-03-02 10:05:44 -08:00
Pranav K 5bd650bdd1 Pack should pack symbol nupkg
* Update path calculation for BuiltProjectOutputGroupOutput to include full path. This matches
  the behavior of Microsoft.Common.targets.
* Add Razor symbols to DebugSymbolsProjectOutputGroupOutput

Fixes #2116
2018-03-02 07:45:24 -08:00
Ajay Bhargav Baaskaran a9dca60a10 Added support for AssemblyMetadata caching during build server TagHelper discovery 2018-03-01 13:08:56 -08:00
Pranav K 62df770c39 PreserveCompilationContext needs to be set only if a project has any Razor files
Fixes #2077
2018-02-28 11:45:20 -08:00
Pranav K f51ddf68a6 Add RazorGenerate items to UpToDateCheckInput
Fixes #2048
2018-02-27 15:01:27 -08:00
Pranav K aa21a6be6e
Use File.Open overload that overwrites file entirely in DiscoverCommand (#2110)
* Use File.Open overload that overwrites file entirely in DiscoverCommand

Re-enable TagHelper discovery incrementalism test

Fixes #2104
2018-02-26 10:22:29 -08:00
Ajay Bhargav Baaskaran 64c86634a8 Added a test to verify incremental TagHelper discovery 2018-02-22 17:15:58 -08:00
Pranav K 8938f6c8c2 Change the default extension for Razor views to .Views.dll 2018-02-21 11:48:31 -08:00
Pranav K 9a9a2cf66a Make content files work better in class library projects referencing Razor Sdk
* Include cshtml files as content when referencing Razor Sdk
* Exclude cshtml files added by default from being packed

Fixes #1980
2018-02-20 14:15:19 -08:00
Ajay Bhargav Baaskaran c293267421 Fixed unnecessary invocation of TagHelper target 2018-02-15 15:31:54 -08:00
Pranav K a13a0aa8c4
WebSdk transitions (#2078)
* WebSdk transitions

* Add a reference to Microsoft.Net.Sdk if it wasn't previously referenced
* Move PreserveCompilationContext in to our target
* Remove use of transition property
2018-02-15 15:09:05 -08:00
Ryan Nowak 56ead8118a Decouple Razor tools from MVC
Adds a loader (with shadow copying in server mode) based on the Roslyn
Analyzer loader design.

Adds some targets to the Razor SDK that we can use to compute the
configuration and extensions.

Passes all of the metadata through to the command line tools so they can
deal with extensions.
2018-02-15 13:31:31 -08:00
Pranav K 16bcd8871e WebSdk transitions
* Add a reference to Microsoft.Net.Sdk if it wasn't previously referenced
* Move PreserveCompilationContext in to our target
* Remove use of transition property
2018-02-15 12:08:18 -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
Ajay Bhargav Baaskaran 8b78b4f421 Cleaned up logging in build server 2018-02-07 23:52:54 -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
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
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 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
Ajay Bhargav Baaskaran 9244383ec7 Modified integration test infrastructure to test build server 2018-01-30 15:55:17 -08:00
Pranav K 13388ca6ae Make testapps run without deployment 2018-01-29 18:12:35 -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
Ryan Nowak 2d87bdf565
Add support for MvcPrecompilation settings (#1956)
* Add support for MvcPrecompilation settings

Adds support to the Razor SDK for various legacy features of the MVC
Precompilation tool.

- MvcRazorCompileOnPublish
- MvcRazorExcludeViewFilesFromPublish
- MvcRazorExcludeRefAssembliesFromPublish
- MvcRazorOutputPath
- MvcRazorEmbedViewSources
- MvcRazorFilesToCompile
2018-01-22 16:56:58 -08:00
Ryan Nowak eaa201703d Fix build break
We didn't have a test for the case where RazorCompileOnPublish is false
and Publish is being called. This is breaking the precompilation repo.
2018-01-17 18:12:24 -08:00
Ryan Nowak 0584fe3ecf Make RazorCompileOnPublish the default 2018-01-17 13:06:20 -08:00
Ryan Nowak e8af1141cb Attempt to fix Razor CI flakiness
We're seeing some test failures on the CI where the build has no output.
Sure enough, using Process.Exited is trap. It doesn't guarantee that all
of the output has been written when it's trigger.

This is a different approach that shouldn't suffer from the same
problem.
2018-01-16 17:18:44 -08:00
Ryan Nowak b5554a8038 Make Razor SDK support refs and views on publish
These are default behaviors for precompilation.
2018-01-14 11:43:01 -08:00
Ryan Nowak f0c3843a5b Implment support for publish 2018-01-12 21:11:28 -08:00
Ryan Nowak 07a63d2ddd Add tests for RazorCompile target
This target should be callable on its own without using Build so it
deserves a few tests.
2018-01-12 21:11:28 -08:00
Ryan Nowak e0d876deb9 Skip flaky test on OSX 2018-01-12 21:01:12 -08:00
Ryan Nowak 2555c5bab1 WIP 2018-01-12 19:05:46 -08:00
Ryan Nowak 5f501710aa Make Razor targets noop with no razor files 2018-01-11 13:59:25 -08:00
Ryan Nowak bb0aa9464a Add support and tests for Pack and P2P reference 2018-01-10 18:09:05 -08:00
Pranav K bf52e0dbf0 Add support for CopyBuildOutputToOutputDirectory and CopyOutputSymbolsToOutputDirectory
Fixes #1896
2018-01-07 19:16:46 -08:00