New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Command-line interface #872
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ti/dotvvm into feature/selenium-generator
…generator executable files
…ti/dotvvm into feature/selenium-generator
…ti/dotvvm into feature/selenium-generator
…rsion to fixed 9.0
Finally, I have tested the compiler against the net461 framework and it works. Also, I have checked all files that are directly part of DotVVM.Framework or DotVVM.Core assembly. All seem good to me. |
quigamdev
approved these changes
May 20, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Builds off of #775.)
This is a major-ish rewrite of the command-line interface and the stand-alone compiler executable. It tries to bring them closer to style of the SDK's dotnet executable.
The Compiler executable is no longer embedded into the DotVVM NuGet package anymore. Instead, DotVVM.CommandLine itself includes two builds of the Compiler, one for .NET Framework and one for .NET Core (and .NET 5).
In addition to that, the Compiler is now able to load the compiled project's assembly correctly (i.e. with all its dependencies) using AppDomain and DependencyContext magics.
However, not everything has been solved. The Compiler is still not actually a compiler. It's more of a linter really, since even though it can create an assembly for each page it can't merge them together. None of the IL merging tools I tried work, so I conclude that to get this to work, we'll have to make some changes in DotVVM.Framework.
The process of the CLI's
lint
command goes a little something like this:a. If this is the netcoreapp3.1 Compiler, use DependencyContext and AssemblyLoadContext to load the assembly with its dependencies.
b. If this is the net461 Compiler, create a new AppDomain with the project's app.config (thus loading its dependencies first). If an assembly resolution fails, the original AppDomain is used in the AssemblyResolve event.
c. Create a DotvvmConfiguration
d. Compile all views and markup controls more-or-less the same way DotVVM does at runtime.