Skip to content
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

Started using Roslyn 3.0.0-beta (scripting) #78

Merged
merged 4 commits into from
Apr 7, 2017

Conversation

seesharper
Copy link
Collaborator

Removed the DebugScriptRunner.
Think we still need to specify UTF8

<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
<add key="Roslyn nightly builds" value="https://dotnet.myget.org/F/roslyn/api/v3/index.json" />
Copy link
Member

Choose a reason for hiding this comment

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

we should not be using the nightly build feed. I'd rather internalize the DLLs so that we can publish a nuget package

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

By internalizing you mean that we should keep the Roslyn dll's in the repo?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Regardless how to distribute, we still ned to bring in the 3.0.0 dll's from somewhere before we create the NuGet package?

Copy link
Member

Choose a reason for hiding this comment

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

yeah in scriptcs I just copied the DLLs into the lib folder and included them into the created nuget package scriptcs/scriptcs@44f666e

Alternatively, but I'd like to avoid it, we can take Roslyn 3 from myget and publish on nuget under a different name and reference that 😎

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Going for the lib folder approach. Do you know what we have to do in csproj to include these files in the NuGet package?

Copy link
Member

Choose a reason for hiding this comment

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

something like this should work

  <ItemGroup>
    <Content Include="$(OutputPath)\Microsoft.CodeAnalysis.CSharp.Scripting.dll">
      <PackagePath>lib/netstandard1.6/</PackagePath>
      <Pack>true</Pack>
    </Content>
  </ItemGroup>

@@ -81,16 +81,16 @@ private static void RunScript(string file, string config, bool debugMode, IEnume
}

var directory = Path.IsPathRooted(file) ? Path.GetDirectoryName(file) : Path.GetDirectoryName(Path.Combine(Directory.GetCurrentDirectory(), file));
var sourceText = SourceText.From(new FileStream(file, FileMode.Open));
var context = new ScriptContext(sourceText, directory, config, args, file);
var sourceText = SourceText.From(new FileStream(file, FileMode.Open),Encoding.UTF8);
Copy link
Member

Choose a reason for hiding this comment

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

you should not hardcode the encoding. SourceText.From(stream) will internally try to detect encoding using BOM and if it's not found, it will fallback to UTF8 automatically


if (!string.IsNullOrWhiteSpace(context.FilePath))
{
opts = opts.WithFilePath(context.FilePath);
opts = opts.WithFilePath(context.FilePath).WithFileEncoding(Encoding.UTF8);
Copy link
Member

Choose a reason for hiding this comment

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

@filipw
Copy link
Member

filipw commented Apr 5, 2017

thanks a lot! just have a few comments

@@ -11,10 +11,26 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>0.2.0</Version>
Copy link
Member

Choose a reason for hiding this comment

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

this is not needed, there is already a <VersionPrefix />

@@ -18,12 +18,35 @@
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<GenerateAssemblyCompanyAttribute>false</GenerateAssemblyCompanyAttribute>
<GenerateAssemblyProductAttribute>false</GenerateAssemblyProductAttribute>
<Version>0.11.0</Version>
Copy link
Member

Choose a reason for hiding this comment

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

this is not needed, there is already a <VersionPrefix />

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@seesharper sure, I see you've fixed it. Mine was just a tangential comment.

@filipw
Copy link
Member

filipw commented Apr 7, 2017

looks good, can you please just fix the version and we merge it

@filipw
Copy link
Member

filipw commented Apr 7, 2017

thanks a lot

@filipw filipw merged commit 38aed01 into dotnet-script:master Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants