Skip to content

Updated to Roslyn 2.6.0 #207

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

Merged
merged 5 commits into from
Dec 9, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Dotnet.Script.Core/Dotnet.Script.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>A cross platform library allowing you to run C# (CSX) scripts from a project.json dependency definition file and with support for debugging. Based on Roslyn.</Description>
<VersionPrefix>0.16.0</VersionPrefix>
<VersionPrefix>0.17.0</VersionPrefix>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, we just go straight to 0.17.0 👍

<Authors>filipw</Authors>
<TargetFramework>netstandard2.0</TargetFramework>
<AssemblyName>Dotnet.Script.Core</AssemblyName>
Expand Down Expand Up @@ -31,8 +31,8 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.4.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.6.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.3" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
<PackageReference Include="System.Reflection.Metadata" Version="1.5.0" />
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
Expand Down
6 changes: 0 additions & 6 deletions src/Dotnet.Script.Core/ScriptCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ public class ScriptCompiler

static ScriptCompiler()
{
// reset default scripting mode to latest language version to enable C# 7.1 features
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Always good to get rid of some reflection hacks 👍

// this is not needed once https://github.com/dotnet/roslyn/pull/21331 ships
var csharpScriptCompilerType = typeof(CSharpScript).GetTypeInfo().Assembly.GetType("Microsoft.CodeAnalysis.CSharp.Scripting.CSharpScriptCompiler");
var parseOptionsField = csharpScriptCompilerType?.GetField("s_defaultOptions", BindingFlags.Static | BindingFlags.NonPublic);
parseOptionsField?.SetValue(null, new CSharpParseOptions(LanguageVersion.Latest, kind: SourceCodeKind.Script));

// force Roslyn to use ReferenceManager for the first time
Task.Run(() =>
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
<RepositoryUrl>https://github.com/filipw/dotnet-script.git</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>script;csx;csharp;roslyn;nuget</PackageTags>
<Version>0.3.0</Version>
<Version>0.4.0</Version>
<Description>A MetadataReferenceResolver that allows inline nuget references to be specified in script(csx) files.</Description>
<Authors>dotnet-script</Authors>
<Company>dotnet-script</Company>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.6.0" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyModel" Version="2.0.3" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 👍

</ItemGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Dotnet.Script.Extras/Dotnet.Script.Extras.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Scripting" Version="2.6.0" />
<PackageReference Include="System.Collections.Immutable" Version="1.4.0" />
</ItemGroup>

Expand Down
6 changes: 6 additions & 0 deletions src/Dotnet.Script.Tests/ScriptExecutionTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ public static void ShouldHandleIssue204()
Assert.Contains("System.Net.WebProxy", result.output);
}

[Fact]
public void ShouldHandleCSharp72()
{
var result = Execute(Path.Combine("CSharp72", "CSharp72.csx"));
Assert.Contains("hi", result.output);
}

private static (string output, int exitCode) Execute(string fixture, params string[] arguments)
{
Expand Down
2 changes: 2 additions & 0 deletions src/Dotnet.Script.Tests/TestFixtures/CSharp72/CSharp72.csx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
private protected string foo = "hi";
Console.WriteLine(foo);
4 changes: 2 additions & 2 deletions src/Dotnet.Script/Dotnet.Script.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<Description>Dotnet CLI tool allowing you to run C# (CSX) scripts.</Description>
<VersionPrefix>0.16.1</VersionPrefix>
<VersionPrefix>0.17.0</VersionPrefix>
<Authors>filipw</Authors>
<TargetFramework>netcoreapp2.0</TargetFramework>
<DebugType>portable</DebugType>
Expand Down Expand Up @@ -30,7 +30,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.4.0" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.0" />
<PackageReference Include="Microsoft.Extensions.CommandLineUtils" Version="1.1.1" />
</ItemGroup>

Expand Down