Skip to content

Commit 1b3015a

Browse files
Website install shim (#153)
* Add installer shim for 'Web Site's. Update nupkg authoring with readme's. * Ship it.
1 parent 919235a commit 1b3015a

17 files changed

+578
-15
lines changed

.nuget/NuGet.Config

+1-5
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
</solution>
66
<packageSources>
77
<clear />
8-
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
8+
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
99
</packageSources>
10-
<packageRestore>
11-
<!-- Disables command-line, automatic, and MSBuild-Integrated restore -->
12-
<add key="enabled" value="True" />
13-
</packageRestore>
1410
</configuration>

.nuget/NuGet.exe

632 KB
Binary file not shown.

README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ for an introduction to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
66

77
## Updates
88
+ #### Version 4.1.0 (preview1)
9+
- #### :warning: Drop install.ps1, Rely more on msbuild :warning:
10+
Nuget has moved on from install.ps1. We had one foot in the msbuild camp before, and one foot still in the install.ps1 camp. Time to just jump in with both feet. See the 'RoslynRegisterInConfig' setting description below.
11+
12+
<u>**Moving fully to an msbuild/targets-based model will break project-less ASP.Net "Web Sites."**</u> The old install.ps1 way of doing things was becoming less tenable as NuGet continued to evolve. The switch to msbuild/targets was an easy choice. But "Web Site" projects have very limited support in msbuild. We have created a new package that brings back the 'install.ps1' functionality of the 3.X releases _only for WebSites._ It is called [Microsoft.CodeDom.Providers.DotNetCompilerPlatform.WebSites](https://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform.WebSites).
13+
914
- #### Refreshed current compilers
1015
In keeping with the new versioning scheme for this project, the version has been revved to 4.1 to match the version of the compilers included.
1116

@@ -15,9 +20,6 @@ for an introduction to Microsoft.CodeDom.Providers.DotNetCompilerPlatform.
1520
- #### .Net >= 4.7.2
1621
As a result of not keeping older compilers packaged in this project, we can no longer support versions before 4.7.2 because compiler versions 3.0 and newer only support 4.7.2+.
1722

18-
- #### Drop install.ps1, Rely more on msbuild
19-
Nuget has moved on from install.ps1. We had one foot in the msbuild camp before, and one foot still in the install.ps1 camp. Time to just jump in with both feet. See the 'RoslynRegisterInConfig' setting description below.
20-
2123
+ #### Version 3.11.0 (preview1)
2224
- #### Refreshed compilers
2325
In keeping with the new versioning scheme for this project, the version has been revved to 3.11 to match the version of the compilers included.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),RoslynCodeProvider.sln))\tools\RoslynCodeProvider.settings.targets" />
4+
<PropertyGroup>
5+
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
6+
<NuGetPackageId>$(MSBuildProjectName)</NuGetPackageId>
7+
<NuSpecFile>$(MSBuildProjectName).nuspec</NuSpecFile>
8+
<NuGetPackSymbols>false</NuGetPackSymbols>
9+
<IsPackage>true</IsPackage>
10+
</PropertyGroup>
11+
<ItemGroup>
12+
<NuGetContentProject Include="$(RepositoryRoot)\src\Microsoft.CodeDom.Providers.DotNetCompilerPlatform\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.csproj" />
13+
<NuGetContent Include="Content\web.config.install.xdt">
14+
<Destination>content\net472\web.config.install.xdt</Destination>
15+
</NuGetContent>
16+
<NuGetContent Include="Content\web.config.uninstall.xdt">
17+
<Destination>content\net472\web.config.uninstall.xdt</Destination>
18+
</NuGetContent>
19+
<NuGetContent Include="tools\*.ps1" Condition="'$(SignAssembly)' != 'true'">
20+
<Destination>tools</Destination>
21+
</NuGetContent>
22+
<NuGetContent Include="tools\signed\*.ps1" Condition="'$(SignAssembly)' == 'true'">
23+
<Destination>tools</Destination>
24+
</NuGetContent>
25+
<NuGetContent Include="Readme.md">
26+
<Destination>docs\Readme.md</Destination>
27+
</NuGetContent>
28+
<NuGetContent Include="..\icons\*">
29+
<Destination>icons</Destination>
30+
</NuGetContent>
31+
</ItemGroup>
32+
<Import Project="$(RepositoryRoot)Tools\NuGetProj.targets"/>
33+
<Target Name="SignPowerShellScript" Condition=" '$(SignAssembly)' == 'true' " AfterTargets="BeforeBuild">
34+
<ItemGroup>
35+
<OriginalScriptFiles Include="$(MSBuildThisFileDirectory)\tools\*.ps1" />
36+
</ItemGroup>
37+
<Copy SourceFiles="@(OriginalScriptFiles)" DestinationFolder="$(MSBuildThisFileDirectory)\tools\signed" SkipUnchangedFiles="true" />
38+
<ItemGroup>
39+
<ScriptFilesToSign Include="$(MSBuildThisFileDirectory)\tools\signed\*.ps1">
40+
<Authenticode>Microsoft400</Authenticode>
41+
</ScriptFilesToSign>
42+
</ItemGroup>
43+
<SignFiles Files="@(ScriptFilesToSign)" Type="$(SignType)" BinariesDirectory="$(MSBuildThisFileDirectory)\tools\signed"
44+
IntermediatesDirectory="$(MSBuildThisFileDirectory)\tools" ESRPSigning="$(ESRPSigning)" UseBearerToken="$(UseBearerToken)" />
45+
</Target>
46+
<Target Name="AfterBuild">
47+
<PropertyGroup>
48+
<OutDir>$(PackageOutputDir)</OutDir>
49+
</PropertyGroup>
50+
<ItemGroup>
51+
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
52+
<Authenticode>NuGet</Authenticode>
53+
</FilesToSign>
54+
</ItemGroup>
55+
</Target>
56+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
3+
<metadata>
4+
<id>$NuGetPackageId$</id>
5+
<title>WebSite Installer for CodeDOM Providers for .NET Compiler Platform ("Roslyn")</title>
6+
<version>$NuGetPackageVersion$</version>
7+
<authors>Microsoft</authors>
8+
<owners>Microsoft</owners>
9+
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
10+
<description>An installer shim to get "Roslyn" CodeDOM providers included in project-less "Web Site" builds.
11+
12+
This package was built from the source at $GitCommitLink$
13+
</description>
14+
<summary>WebSite Shim for CodeDOM providers that use the new .NET Compiler Platform ("Roslyn") compiler as a service APIs.</summary>
15+
<language>en-US</language>
16+
<projectUrl>https://github.com/aspnet/RoslynCodeDomProvider</projectUrl>
17+
<repository type="git" url="https://github.com/aspnet/RoslynCodeDomProvider" commit="$GitCommit$"/>
18+
<icon>icons\dotnet.png</icon>
19+
<readme>docs\Readme.md</readme>
20+
<license type="expression">MIT</license>
21+
<requireLicenseAcceptance>true</requireLicenseAcceptance>
22+
<tags>Roslyn CodeDOM Compiler CSharp VB.Net ASP.NET WebSite</tags>
23+
24+
<dependencies>
25+
<dependency id="Microsoft.CodeDom.Providers.DotNetCompilerPlatform" version="[$NuGetPackageVersion$]" />
26+
</dependencies>
27+
28+
</metadata>
29+
</package>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Web Site integration for 4.X DotNetCompilerPlatform CodeDom Provider
2+
This is a support package to enable proper integration of the 4.X series of the [Microsoft.CodeDom.Providers.DotNetCompilerPlatform](https://www.nuget.org/packages/Microsoft.CodeDom.Providers.DotNetCompilerPlatform) package with project-less "Web Sites." This package does not contain any libraries or providers of it's own. It simply restores the old 'install.ps1' nuget functionality to its tightly coupled 'DotNetCompilerPlatform' package dependency. Powershell installation was the only way to integrate with "Web Sites" which have very limited msbuild support.
3+
4+
This package has an exact dependency on the _DotNetCompilerPlatform_ package of the same version.
5+
6+
This package will fail to install on non-"Web Site" projects.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
3+
4+
<!-- If system.codedom tag is absent -->
5+
<system.codedom xdt:Transform="InsertIfMissing">
6+
</system.codedom>
7+
8+
<!-- If compilers tag is absent -->
9+
<system.codedom>
10+
<compilers xdt:Transform="InsertIfMissing" />
11+
</system.codedom>
12+
13+
<!-- If a .cs compiler is already present, the existing entry needs to be removed before inserting the new entry -->
14+
<system.codedom>
15+
<compilers>
16+
<compiler
17+
extension=".cs"
18+
xdt:Transform="Remove"
19+
xdt:Locator="Match(extension)" />
20+
</compilers>
21+
</system.codedom>
22+
23+
<!-- If a .vb compiler is already present, the existing entry needs to be removed before inserting the new entry -->
24+
<system.codedom>
25+
<compilers>
26+
<compiler
27+
extension=".vb"
28+
xdt:Transform="Remove"
29+
xdt:Locator="Match(extension)" />
30+
</compilers>
31+
</system.codedom>
32+
33+
</configuration>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
3+
<appSettings>
4+
<add key="aspnet:RoslynCompilerLocation" value="roslyn" xdt:Transform="Remove" xdt:Locator="Condition(@key='aspnet:RoslynCompilerLocation' and @value='roslyn')" />
5+
</appSettings>
6+
<appSettings xdt:Transform="Remove" xdt:Locator="Condition(count(child::*) = 0)">
7+
</appSettings>
8+
<system.codedom>
9+
<compilers xdt:Transform="Remove" xdt:Locator="Condition(count(child::*) = 0)" />
10+
</system.codedom>
11+
<system.codedom xdt:Transform="Remove" xdt:Locator="Condition(count(child::*) = 0)" />
12+
</configuration>

0 commit comments

Comments
 (0)