-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
565 additions
and
565 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
<AssemblyName>MirrorSharp.AspNetCore.Demo.Library</AssemblyName> | ||
<RootNamespace>MirrorSharp.AspNetCore.Demo.Library</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AdditionalFiles Remove="PublicAPI.Shipped.txt" /> | ||
<AdditionalFiles Remove="PublicAPI.Unshipped.txt" /> | ||
</ItemGroup> | ||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<TargetFramework>netstandard2.1</TargetFramework> | ||
<IsPackable>false</IsPackable> | ||
<AssemblyName>MirrorSharp.AspNetCore.Demo.Library</AssemblyName> | ||
<RootNamespace>MirrorSharp.AspNetCore.Demo.Library</RootNamespace> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<AdditionalFiles Remove="PublicAPI.Shipped.txt" /> | ||
<AdditionalFiles Remove="PublicAPI.Unshipped.txt" /> | ||
</ItemGroup> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace MirrorSharp.AspNetCore.Demo.Library { | ||
public interface IScriptContext { | ||
string Arguments { get; } | ||
|
||
IReadOnlyList<string> Messages { get; } | ||
} | ||
using System.Collections.Generic; | ||
|
||
namespace MirrorSharp.AspNetCore.Demo.Library { | ||
public interface IScriptContext { | ||
string Arguments { get; } | ||
|
||
IReadOnlyList<string> Messages { get; } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
namespace MirrorSharp.AspNetCore.Demo.Library { | ||
public interface IScriptGlobals { | ||
IScriptContext Context { get; } | ||
} | ||
namespace MirrorSharp.AspNetCore.Demo.Library { | ||
public interface IScriptGlobals { | ||
IScriptContext Context { get; } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,41 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<AssemblyName>MirrorSharp.AspNetCore.Demo</AssemblyName> | ||
<RootNamespace>MirrorSharp.AspNetCore.Demo</RootNamespace> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Remove="wwwroot\package.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="wwwroot\package.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AspNetCore.Demo.Library\AspNetCore.Demo.Library.csproj" /> | ||
<ProjectReference Include="..\AspNetCore\AspNetCore.csproj" /> | ||
<ProjectReference Include="..\Common\Common.csproj" /> | ||
<ProjectReference Include="..\FSharp\FSharp.csproj" /> | ||
<ProjectReference Include="..\IL\IL.csproj" /> | ||
</ItemGroup> | ||
|
||
<Target Name="CopySdkReferenceAssemblies" AfterTargets="ResolveReferences"> | ||
<ItemGroup> | ||
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename)%(Extension)')" | ||
Link="@(Reference->'ref-assemblies\%(Filename)%(Extension)')" | ||
Condition="$([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard'"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename).xml')" | ||
Link="@(Reference->'ref-assemblies\%(Filename).xml')" | ||
Condition="($([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard') | ||
and Exists('%(RootDir)%(Directory)%(Filename).xml')"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
</Target> | ||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk.Web"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<AssemblyName>MirrorSharp.AspNetCore.Demo</AssemblyName> | ||
<RootNamespace>MirrorSharp.AspNetCore.Demo</RootNamespace> | ||
<IsPackable>false</IsPackable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Content Remove="wwwroot\package.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="wwwroot\package.json" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\AspNetCore.Demo.Library\AspNetCore.Demo.Library.csproj" /> | ||
<ProjectReference Include="..\AspNetCore\AspNetCore.csproj" /> | ||
<ProjectReference Include="..\Common\Common.csproj" /> | ||
<ProjectReference Include="..\FSharp\FSharp.csproj" /> | ||
<ProjectReference Include="..\IL\IL.csproj" /> | ||
</ItemGroup> | ||
|
||
<Target Name="CopySdkReferenceAssemblies" AfterTargets="ResolveReferences"> | ||
<ItemGroup> | ||
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename)%(Extension)')" | ||
Link="@(Reference->'ref-assemblies\%(Filename)%(Extension)')" | ||
Condition="$([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard'"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
<Content Include="@(Reference->'%(RootDir)%(Directory)%(Filename).xml')" | ||
Link="@(Reference->'ref-assemblies\%(Filename).xml')" | ||
Condition="($([System.String]::new('%(Filename)').StartsWith('System')) or '%(Filename)' == 'netstandard') | ||
and Exists('%(RootDir)%(Directory)%(Filename).xml')"> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</Content> | ||
</ItemGroup> | ||
</Target> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="../NuGet.Common.props" /> | ||
|
||
<PropertyGroup> | ||
<AssemblyName>MirrorSharp.AspNetCore</AssemblyName> | ||
<RootNamespace>MirrorSharp.AspNetCore</RootNamespace> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<VersionPrefix>4.0.0</VersionPrefix> | ||
<Description>MirrorSharp ASP.NET Core server. $(DescriptionSuffix)</Description> | ||
<PackageTags>Roslyn;CodeMirror</PackageTags> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<FrameworkReference Include="Microsoft.AspNetCore.App"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Common\Common.csproj" /> | ||
</ItemGroup> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<Import Project="../NuGet.Common.props" /> | ||
|
||
<PropertyGroup> | ||
<AssemblyName>MirrorSharp.AspNetCore</AssemblyName> | ||
<RootNamespace>MirrorSharp.AspNetCore</RootNamespace> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
<VersionPrefix>4.0.0</VersionPrefix> | ||
<Description>MirrorSharp ASP.NET Core server. $(DescriptionSuffix)</Description> | ||
<PackageTags>Roslyn;CodeMirror</PackageTags> | ||
<GenerateDocumentationFile>true</GenerateDocumentationFile> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<FrameworkReference Include="Microsoft.AspNetCore.App"/> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Common\Common.csproj" /> | ||
</ItemGroup> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,25 @@ | ||
using MirrorSharp.Advanced; | ||
using MirrorSharp.Internal; | ||
|
||
namespace MirrorSharp.IL.Advanced { | ||
/// <summary>Provides IL-related extensions to the <see cref="IWorkSession" />.</summary> | ||
public static class WorkSessionExtensions { | ||
/// <summary>Specifies whether the <see cref="IWorkSession" /> is using IL.</summary> | ||
/// <param name="session">The session</param> | ||
/// <returns><c>true</c> if the session is using IL; otherwise, <c>false</c></returns> | ||
// ReSharper disable once InconsistentNaming | ||
public static bool IsIL(this IWorkSession session) { | ||
Argument.NotNull(nameof(session), session); | ||
return session is WorkSession { LanguageSession: IILSession }; | ||
} | ||
|
||
/// <summary>Returns IL session associated with the <see cref="IWorkSession" />, if any; throws otherwise.</summary> | ||
/// <param name="session">The session</param> | ||
/// <returns><see cref="IILSession" /> if the session is using IL</returns> | ||
// ReSharper disable once InconsistentNaming | ||
public static IILSession IL(this IWorkSession session) { | ||
Argument.NotNull(nameof(session), session); | ||
return (IILSession)((WorkSession)session).LanguageSession; | ||
} | ||
} | ||
} | ||
using MirrorSharp.Advanced; | ||
using MirrorSharp.Internal; | ||
|
||
namespace MirrorSharp.IL.Advanced { | ||
/// <summary>Provides IL-related extensions to the <see cref="IWorkSession" />.</summary> | ||
public static class WorkSessionExtensions { | ||
/// <summary>Specifies whether the <see cref="IWorkSession" /> is using IL.</summary> | ||
/// <param name="session">The session</param> | ||
/// <returns><c>true</c> if the session is using IL; otherwise, <c>false</c></returns> | ||
// ReSharper disable once InconsistentNaming | ||
public static bool IsIL(this IWorkSession session) { | ||
Argument.NotNull(nameof(session), session); | ||
return session is WorkSession { LanguageSession: IILSession }; | ||
} | ||
|
||
/// <summary>Returns IL session associated with the <see cref="IWorkSession" />, if any; throws otherwise.</summary> | ||
/// <param name="session">The session</param> | ||
/// <returns><see cref="IILSession" /> if the session is using IL</returns> | ||
// ReSharper disable once InconsistentNaming | ||
public static IILSession IL(this IWorkSession session) { | ||
Argument.NotNull(nameof(session), session); | ||
return (IILSession)((WorkSession)session).LanguageSession; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
# Changelog | ||
|
||
## [0.2] - 2022-04-04 | ||
## [0.2-test-2021-04-02-1] - 2021-04-02 | ||
## [0.2-test-2021-04-01-1] - 2021-04-01 | ||
|
||
### Added | ||
- Target setting on IILSession | ||
|
||
### Changed | ||
- Updated to support MirrorSharp.Common 3.0.0 | ||
|
||
### Fixed | ||
- WorkSession.IsIL() check failing if WorkSession is a mock | ||
|
||
## [0.1] - 2021-08-31 | ||
|
||
### Added | ||
# Changelog | ||
|
||
## [0.2] - 2022-04-04 | ||
## [0.2-test-2021-04-02-1] - 2021-04-02 | ||
## [0.2-test-2021-04-01-1] - 2021-04-01 | ||
|
||
### Added | ||
- Target setting on IILSession | ||
|
||
### Changed | ||
- Updated to support MirrorSharp.Common 3.0.0 | ||
|
||
### Fixed | ||
- WorkSession.IsIL() check failing if WorkSession is a mock | ||
|
||
## [0.1] - 2021-08-31 | ||
|
||
### Added | ||
- Initial version: minimal set of code to support IL as input |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
using MirrorSharp.Internal; | ||
using MirrorSharp.Internal.Abstraction; | ||
|
||
namespace MirrorSharp.IL.Internal { | ||
// ReSharper disable once InconsistentNaming | ||
internal class ILLanguage : ILanguage { | ||
public static string Name = "IL"; | ||
|
||
string ILanguage.Name => Name; | ||
|
||
public ILanguageSessionInternal CreateSession(string text, ILanguageSessionExtensions services) | ||
=> new ILSession(text); | ||
} | ||
} | ||
using MirrorSharp.Internal; | ||
using MirrorSharp.Internal.Abstraction; | ||
|
||
namespace MirrorSharp.IL.Internal { | ||
// ReSharper disable once InconsistentNaming | ||
internal class ILLanguage : ILanguage { | ||
public static string Name = "IL"; | ||
|
||
string ILanguage.Name => Name; | ||
|
||
public ILanguageSessionInternal CreateSession(string text, ILanguageSessionExtensions services) | ||
=> new ILSession(text); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
namespace MirrorSharp.IL { | ||
/// <summary>MirrorSharp options for IL</summary> | ||
// ReSharper disable once InconsistentNaming | ||
public class MirrorSharpILOptions { | ||
|
||
internal MirrorSharpILOptions() { } | ||
} | ||
} | ||
namespace MirrorSharp.IL { | ||
/// <summary>MirrorSharp options for IL</summary> | ||
// ReSharper disable once InconsistentNaming | ||
public class MirrorSharpILOptions { | ||
|
||
internal MirrorSharpILOptions() { } | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#nullable enable | ||
MirrorSharp.IL.Advanced.IILSession | ||
MirrorSharp.IL.Advanced.WorkSessionExtensions | ||
MirrorSharp.IL.MirrorSharpILOptions | ||
MirrorSharp.MirrorSharpOptionsExtensions | ||
static MirrorSharp.MirrorSharpOptionsExtensions.EnableIL(this MirrorSharp.MirrorSharpOptions! options, System.Action<MirrorSharp.IL.MirrorSharpILOptions!>? setup = null) -> MirrorSharp.MirrorSharpOptions! | ||
static MirrorSharp.IL.Advanced.WorkSessionExtensions.IL(this MirrorSharp.Advanced.IWorkSession! session) -> MirrorSharp.IL.Advanced.IILSession! | ||
#nullable enable | ||
MirrorSharp.IL.Advanced.IILSession | ||
MirrorSharp.IL.Advanced.WorkSessionExtensions | ||
MirrorSharp.IL.MirrorSharpILOptions | ||
MirrorSharp.MirrorSharpOptionsExtensions | ||
static MirrorSharp.MirrorSharpOptionsExtensions.EnableIL(this MirrorSharp.MirrorSharpOptions! options, System.Action<MirrorSharp.IL.MirrorSharpILOptions!>? setup = null) -> MirrorSharp.MirrorSharpOptions! | ||
static MirrorSharp.IL.Advanced.WorkSessionExtensions.IL(this MirrorSharp.Advanced.IWorkSession! session) -> MirrorSharp.IL.Advanced.IILSession! | ||
static MirrorSharp.IL.Advanced.WorkSessionExtensions.IsIL(this MirrorSharp.Advanced.IWorkSession! session) -> bool |
Oops, something went wrong.