Skip to content

Commit

Permalink
Revert code-gen updates
Browse files Browse the repository at this point in the history
  • Loading branch information
louthy committed Feb 18, 2020
1 parent f0d99f3 commit 8d64696
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 843 deletions.
78 changes: 42 additions & 36 deletions LanguageExt.CodeGen/LanguageExt.CodeGen.csproj
@@ -1,41 +1,47 @@
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build">
<Project Sdk="Microsoft.NET.Sdk" DefaultTargets="Build">

<PropertyGroup>
<PackageVersion>3.3.51</PackageVersion>
<PackageId>LanguageExt.CodeGen</PackageId>
<Title>LanguageExt.CodeGen</Title>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<Authors>Paul Louth</Authors>
<Summary>Functional language code-generation for C#</Summary>
<Copyright>Copyright (c) Paul Louth. All rights reserved.</Copyright>
<Description>Design and build-time code-gen for lenses and immutable With functions</Description>
<PackageTags>C#, Functional, Language Extension, Lenses, Records, Monad, Option, Either, Reader, Writer, State, List, Set, Map, Queue, Memo, Memoization, Immutable, Lambda, Pattern Matching, Tuple</PackageTags>
<PackageIconUrl>https://github.com/louthy/language-ext/blob/master/Images/lang-ext-small.png?raw=true</PackageIconUrl>
<PackageProjectUrl>https://github.com/louthy/language-ext</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/louthy/language-ext/blob/master/LICENSE.md</PackageLicenseUrl>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DocumentationFile></DocumentationFile>
<OutputType>library</OutputType>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<NoWarn>1701;1702;1705;IDE1006;CS1591;CS1573;CS1712;CS1570;CS1711;CS1572;CS1587</NoWarn>

</PropertyGroup>
<PropertyGroup>
<RoslynCodeGenVersion>0.6.1</RoslynCodeGenVersion>
</PropertyGroup>

<!--<Sdk Name="CodeGeneration.Roslyn.Plugin.Sdk" Version="0.7.5-alpha" />-->

<ItemGroup>
<PackageReference Include="CodeGeneration.Roslyn" Version="0.7.5-alpha" />
</ItemGroup>
<PropertyGroup>
<PackageVersion>3.4.7</PackageVersion>
<PackageId>LanguageExt.CodeGen</PackageId>
<Title>LanguageExt.CodeGen</Title>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<LangVersion>8.0</LangVersion>
<Authors>Paul Louth</Authors>
<Summary>Functional language code-generation for C#</Summary>
<Copyright>Copyright (c) Paul Louth. All rights reserved.</Copyright>
<Description>Design and build-time code-gen for records, unions, lenses and immutable With functions</Description>
<PackageTags>C#, Functional, Language Extension, Lenses, Records, Unions, Monad, Option, Either, Reader, Writer, State, List, Set, Map, Queue, Memo, Memoization, Immutable, Lambda, Pattern Matching, Tuple</PackageTags>
<PackageIconUrl>https://github.com/louthy/language-ext/blob/master/Images/lang-ext-small.png?raw=true</PackageIconUrl>
<PackageProjectUrl>https://github.com/louthy/language-ext</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/louthy/language-ext/blob/master/LICENSE.md</PackageLicenseUrl>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<DocumentationFile></DocumentationFile>
<OutputType>library</OutputType>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<FileVersion>3.0.0.0</FileVersion>
<NoWarn>1701;1702;1705;IDE1006;CS1591;CS1573;CS1712;CS1570;CS1711;CS1572;CS1587</NoWarn>

<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>

<ItemGroup>
<Compile Remove="obj\**" />
<EmbeddedResource Remove="obj\**" />
<None Remove="obj\**" />
</ItemGroup>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CodeGeneration.Roslyn" Version="$(RoslynCodeGenVersion)" />
</ItemGroup>

<ItemGroup>
<Compile Include="**\*.cs" />
<EmbeddedResource Include="**\*.resx" />
</ItemGroup>

<ItemGroup>
<Compile Remove="obj\**" />
<EmbeddedResource Remove="obj\**" />
<None Remove="obj\**" />
</ItemGroup>

</Project>
36 changes: 19 additions & 17 deletions LanguageExt.Core/DataTypes/EitherAsync/EitherAsync.cs
Expand Up @@ -31,9 +31,10 @@ namespace LanguageExt
/// <typeparam name="R">Right</typeparam>
[Serializable]
public struct EitherAsync<L, R> :
#if NETCORE
IAsyncEnumerable<R>,
#endif
// TODO: Re-add when we move to netstandard2.1
//#if NETCORE
// IAsyncEnumerable<R>,
//#endif
IEitherAsync
{
public readonly static EitherAsync<L, R> Bottom = new EitherAsync<L, R>();
Expand Down Expand Up @@ -1746,20 +1747,21 @@ public async Task<Unit> MatchAsync(Func<R, Task> RightAsync, Func<L, Task> LeftA
Bind(a => bind(a).Bind(b => EitherAsync<L, V>.Right(project(a, b))));


#if NETCORE
/// <summary>
/// Enumerate asynchronously
/// </summary>
[Pure]
public async IAsyncEnumerator<R> GetAsyncEnumerator(CancellationToken cancellationToken = default)
{
var data = await Data;
if (data.State == EitherStatus.IsRight)
{
yield return data.Right;
}
}
#endif
// TODO: Re-add when we move to netstandard2.1
//#if NETCORE
// /// <summary>
// /// Enumerate asynchronously
// /// </summary>
// [Pure]
// public async IAsyncEnumerator<R> GetAsyncEnumerator(CancellationToken cancellationToken = default)
// {
// var data = await Data;
// if (data.State == EitherStatus.IsRight)
// {
// yield return data.Right;
// }
// }
//#endif
}

/// <summary>
Expand Down
36 changes: 19 additions & 17 deletions LanguageExt.Core/DataTypes/OptionAsync/OptionAsync.cs
Expand Up @@ -30,9 +30,10 @@ namespace LanguageExt
/// </summary>
/// <typeparam name="A">Bound value</typeparam>
public struct OptionAsync<A> :
#if NETCORE
IAsyncEnumerable<A>,
#endif
// TODO: Re-add when we move to netstandard2.1
//#if NETCORE
// IAsyncEnumerable<A>,
//#endif
IOptionalAsync
{
internal readonly Task<(bool IsSome, A Value)> data;
Expand Down Expand Up @@ -1241,19 +1242,20 @@ async Task<OptionCase<A>> GetCase()
public OptionAsync<Func<B, Func<C, D>>> ParMap<B, C, D>(Func<A, B, C, D> func) =>
Map(curry(func));

#if NETCORE
/// <summary>
/// Enumerate asynchronously
/// </summary>
[Pure]
public async IAsyncEnumerator<A> GetAsyncEnumerator(CancellationToken cancellationToken = default)
{
var (isSome, value) = await Data;
if(isSome)
{
yield return value;
}
}
#endif
// TODO: Re-add when we move to netstandard2.1
//#if NETCORE
// /// <summary>
// /// Enumerate asynchronously
// /// </summary>
// [Pure]
// public async IAsyncEnumerator<A> GetAsyncEnumerator(CancellationToken cancellationToken = default)
// {
// var (isSome, value) = await Data;
// if(isSome)
// {
// yield return value;
// }
// }
//#endif
}
}
11 changes: 6 additions & 5 deletions LanguageExt.Core/LanguageExt.Core.csproj
@@ -1,6 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
<NetStandardVersion>netstandard2.0</NetStandardVersion>
</PropertyGroup>
<PropertyGroup Label="Configuration">
<NoWarn>1701;1702;1705;IDE1006;CS1591;CS1573;CS1712;CS1570;CS1711;CS1572;CS1587</NoWarn>
Expand All @@ -9,11 +10,11 @@
<PropertyGroup Label="Configuration" Condition="'$(TargetFramework)' == 'net46'">
<DefineConstants>NETFX</DefineConstants>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(TargetFramework)' == 'netstandard2.1'">
<PropertyGroup Label="Configuration" Condition="'$(TargetFramework)' == '$(NetStandardVersion)'">
<DefineConstants>NETCORE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<PackageVersion>3.3.51</PackageVersion>
<PackageVersion>3.4.7</PackageVersion>
<PackageId>LanguageExt.Core</PackageId>
<Title>LanguageExt.Core</Title>
<Authors>Paul Louth</Authors>
Expand All @@ -24,7 +25,7 @@
<PackageIcon>lang-ext-small.png</PackageIcon>
<PackageProjectUrl>https://github.com/louthy/language-ext</PackageProjectUrl>
<PackageLicenseUrl>https://github.com/louthy/language-ext/blob/master/LICENSE.md</PackageLicenseUrl>
<TargetFrameworks>net461;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net461;$(NetStandardVersion)</TargetFrameworks>
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
<OutputType>library</OutputType>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
Expand Down Expand Up @@ -54,7 +55,7 @@
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.1'">
<ItemGroup Condition="'$(TargetFramework)' == '$(NetStandardVersion)'">
<PackageReference Include="System.Diagnostics.Contracts" Version="4.3.0" />
<PackageReference Include="System.Globalization.Extensions">
<Version>4.3.0</Version>
Expand Down
6 changes: 3 additions & 3 deletions LanguageExt.FSharp/LanguageExt.FSharp.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
Expand All @@ -7,8 +7,8 @@
<NoWarn>1701;1702;1705;IDE1006;CS1591;CS1573;CS1712;CS1570;CS1711;CS1572;CS1587</NoWarn>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net461</TargetFrameworks>
<PackageVersion>3.3.51</PackageVersion>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<PackageVersion>3.4.7</PackageVersion>
<PackageId>LanguageExt.FSharp</PackageId>
<Title>LanguageExt.FSharp</Title>
<Authors>Paul Louth</Authors>
Expand Down
6 changes: 3 additions & 3 deletions LanguageExt.Parsec/LanguageExt.Parsec.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
Expand All @@ -7,8 +7,8 @@
<DefineConstants>CONTRACTS_FULL</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net461</TargetFrameworks>
<PackageVersion>3.3.51</PackageVersion>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<PackageVersion>3.4.7</PackageVersion>
<PackageId>LanguageExt.Parsec</PackageId>
<Title>LanguageExt.Parsec</Title>
<Authors>Paul Louth</Authors>
Expand Down
6 changes: 3 additions & 3 deletions LanguageExt.Rx/LanguageExt.Rx.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup Label="Configuration" Condition="'$(Configuration)'=='Debug'">
<DefineConstants>TRACE;DEBUG</DefineConstants>
</PropertyGroup>
Expand All @@ -7,8 +7,8 @@
<DefineConstants>CONTRACTS_FULL</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net461</TargetFrameworks>
<PackageVersion>3.3.51</PackageVersion>
<TargetFrameworks>netstandard2.0;net461</TargetFrameworks>
<PackageVersion>3.4.7</PackageVersion>
<PackageId>LanguageExt.Rx</PackageId>
<Title>LanguageExt.Rx</Title>
<Authors>Paul Louth</Authors>
Expand Down
11 changes: 6 additions & 5 deletions LanguageExt.Tests/LanguageExt.Tests.csproj
@@ -1,19 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.0;net461</TargetFrameworks>
<TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
<FileVersion>3.0.0.0</FileVersion>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<LangVersion>8.0</LangVersion>
<RoslynCodeGenVersion>0.6.1</RoslynCodeGenVersion>
</PropertyGroup>
<ItemGroup>
<DotNetCliToolReference Include="dotnet-codegen" Version="0.7.5-alpha" />
<DotNetCliToolReference Include="dotnet-codegen" Version="$(RoslynCodeGenVersion)" />
</ItemGroup>
<ItemGroup>
<None Remove="LanguageExt.Tests.nuget.props" />
<None Remove="LanguageExt.Tests.project.lock.json" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CodeGeneration.Roslyn.BuildTime" Version="0.7.5-alpha">
<PackageReference Include="CodeGeneration.Roslyn.BuildTime" Version="$(RoslynCodeGenVersion)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand All @@ -32,7 +33,7 @@
<PackageReference Include="Microsoft.CSharp" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LanguageExt.CodeGen\LanguageExt.CodeGen.csproj" OutputItemType="CodeGenerationRoslynPlugin" PrivateAssets="all"/>
<ProjectReference Include="..\LanguageExt.CodeGen\LanguageExt.CodeGen.csproj" PrivateAssets="all" />
<ProjectReference Include="..\LanguageExt.Core\LanguageExt.Core.csproj" />
<ProjectReference Include="..\LanguageExt.FSharp\LanguageExt.FSharp.csproj" />
<ProjectReference Include="..\LanguageExt.Parsec\LanguageExt.Parsec.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion Samples/Records/Records.csproj
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Samples/RecordsNetCore/RecordsNetCore.csproj
@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
Expand Down

0 comments on commit 8d64696

Please sign in to comment.