Commit Graph

47 Commits

Author SHA1 Message Date
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
Pranav K 1849056093 Add support for running tests using desktop msbuild 2018-01-05 12:52:01 -08:00
Ryan Nowak 6fc028afb0 Attempt to fix travis again 2018-01-02 16:45:32 -08:00
Ryan Nowak 2717cf8e77 Fix #1893 - fix formatting of RazorCompile 2018-01-02 10:54:59 -08:00
Pranav K 3ae601e4df
Prevent type name collisions when file hierarchy + namespace is identical (#1881)
* Prevent type name collisions when file hierarchy + namespace is identical
2018-01-02 09:41:10 -08:00
Pranav K bd03c16ee7 Ensure test apps use the same SDK as Razor 2017-12-22 07:34:22 -08:00
Pranav K 14fc427068 Make RazorCodeGen track file renames \ deletes
Fixes #1810
2017-12-22 07:13:53 -08:00
Ryan Nowak 3f948ad3c5
Verify support for reporting errors using MSBuild (#1867)
* Verify support for reporting errors using MSBuild
* Verifies that CSC errors get mapped to the right place

Resolves #1850
2017-12-20 16:08:35 -08:00
Ryan Nowak 2c27272e4d Adding a basic test for RazorGenerate
Lotsa cleanup
2017-12-20 12:27:57 -08:00
Ryan Nowak 06c2cf31d4 Hardcode Debug in test 2017-12-18 14:15:30 -08:00
Ryan Nowak 5425c69df6 Use path.combine instead 2017-12-18 13:28:14 -08:00
Ryan Nowak a3fef5eeaa Adds support for Razor compilation at build-time
This PR adds two new tools as well as a tasks project. None of these
projects produce a package and they ship as part of
Microsoft.AspNetCore.Razor.Design. For now this is a 'fat' package that
contains all of the dependencies, but we plan to strip them out in the
future.

The support for compilation at build-time will start as **off** by
default. The immediate goal here is to get this to flow through the
build so that we can test it as part of the inner loop effort. We will
enable this feature by default once we've done more thorough testing.

Since this is mostly a code dump, I plan to address blocking and minor
feedback only. If there are design issues that are non-critical, I will
open follow up items.

The next step will be to start adding more detailed tests.
2017-12-18 13:01:14 -08:00
Ryan Nowak 1962989ffc Implement a .Design package and some testing for MSBuild
This is the first step in adding support for Razor compilation at build
time. Additional steps will complete this by adding tag helper
discovery, code generation and finally a call to CsC.

I want to get this in now to get the package into the build system and
to lay down the general infrastructure for testing.

---

The strategy for testing here is to use checked in projects that have
everything Razor needs to compile code. We already have shims for the
APIs Razor uses by default in this repo and I'm using them in the
project.

The test infrastructure creates a temporary directory, copies the
project, and fixes up a few small things to cooperate with outputs we've
already built so that the test can use the new versions of Razor bits
built from this repo.

We can then call various MSBuild targets and verify the files on disk. I
envision tests that verify incrementalism as well as the basic E2E.

We will test the E2E in general in other places, since it's part of the
new default experience. This repo will test things at a higher level of
detail, but in slightly artifical scenarios.
2017-12-13 15:06:10 -08:00