Skip to content

Commit

Permalink
accord-netGH-318: Adding support for targetting .NET Standard 2.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarsouza committed Jun 1, 2017
1 parent f99af2a commit 4780e21
Show file tree
Hide file tree
Showing 164 changed files with 19,527 additions and 22,600 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
bin
obj

.vs
*.user
*.pidb
*.suo
Expand Down
14 changes: 14 additions & 0 deletions Setup/Accord.Setup (NETStandard).csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Accord.Setup</AssemblyName>
<RootNamespace>Accord.Setup</RootNamespace>
<Configurations>Debug</Configurations>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

</Project>
22 changes: 20 additions & 2 deletions Setup/Scripts/UpdateVersion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public static string GetVersionText(string major, string minor, string rev, stri

public static void Replace(string frameworkRootPath)
{


string version = File.ReadAllText(Path.Combine(frameworkRootPath, "Version.txt"));
string[] parts;
parts = version.Split('-');
Expand All @@ -52,6 +50,7 @@ public static void Replace(string frameworkRootPath)
Console.WriteLine("Updating source files with version number {0}.{1}.{2}.{3}{4}", major, minor, rev, build, tag);

replaceAssemblyInfo(frameworkRootPath, tag, major, minor, rev, build);
replaceNetStandardTargets(frameworkRootPath, tag, major, minor, rev, build);
replaceDocumentation(frameworkRootPath, major, minor, rev);
}

Expand Down Expand Up @@ -79,5 +78,24 @@ private static void replaceAssemblyInfo(string frameworkRootPath, string tag, st
File.WriteAllText(file.FullName, contents);
}
}

private static void replaceNetStandardTargets(string frameworkRootPath, string tag, string major, string minor, string rev, string build)
{
string targetsFile = Path.Combine(frameworkRootPath, "Sources", "Version.targets");

var sb = new StringBuilder();

sb.AppendLine("<Project>");
sb.AppendLine(" <PropertyGroup>");
sb.AppendLine(string.Format(" <Copyright>Copyright (c) Accord.NET authors, 2009-{0}</Copyright>", DateTime.Now.Year));
sb.AppendLine(" <Version>3.5.0</Version>");
sb.AppendLine(string.Format(" <AssemblyVersion>{0}.{1}.{2}</AssemblyVersion>", major, minor, rev));
sb.AppendLine(string.Format(" <AssemblyInformationalVersion>{0}.{1}.{2}{3}</AssemblyInformationalVersion>", major, minor, rev, tag));
sb.AppendLine(string.Format(" <FileVersion>{0}.{1}.{2}.{3}</FileVersion>", major, minor, rev, build));
sb.AppendLine(" </PropertyGroup>");
sb.AppendLine("</Project>");

File.WriteAllText(targetsFile, sb.ToString());
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Accord.Audio.DirectSound</AssemblyName>
<RootNamespace>Accord.Audio.DirectSound</RootNamespace>
</PropertyGroup>

<Import Project="$(SolutionDir)Accord.NET (NETStandard).targets" />

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0</DefineConstants>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<OutputPath>$(SolutionDir)..\Debug\</OutputPath>
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard|AnyCPU'">
<DefineConstants>TRACE;RELEASE;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SharpDX" Version="4.0.1" />
<PackageReference Include="SharpDX.DirectSound" Version="4.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Accord.Audio\Accord.Audio (NETStandard).csproj" />
</ItemGroup>

</Project>
25 changes: 25 additions & 0 deletions Sources/Accord.Audio/Accord.Audio (NETStandard).csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Accord.DataSets</AssemblyName>
<RootNamespace>Accord.DataSets</RootNamespace>
</PropertyGroup>

<Import Project="$(SolutionDir)Accord.NET (NETStandard).targets" />

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0</DefineConstants>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<OutputPath>$(SolutionDir)..\Debug\</OutputPath>
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard|AnyCPU'">
<DefineConstants>TRACE;RELEASE;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\Accord.Math.Core\Accord.Math.Core (NETStandard).csproj" />
<ProjectReference Include="..\Accord.Math\Accord.Math (NETStandard).csproj" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions Sources/Accord.Audio/ComplexFilters/Base/IComplexFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
namespace Accord.Audio.ComplexFilters
{
using System;
using AForge;
using AForge.Math;

/// <summary>
/// Audio processing filter, which operates with Fourier transformed
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/ComplexFilters/CombFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Accord.Audio.ComplexFilters
{
using Accord.Audio;
using Accord.Audio.Generators;
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace Accord.Audio.ComplexFilters
{
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/ComplexFilters/EnvelopeFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Accord.Audio.ComplexFilters
{
using System;
using Accord.Audio;
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
77 changes: 0 additions & 77 deletions Sources/Accord.Audio/Filters/SignalConverter.cs

This file was deleted.

1 change: 0 additions & 1 deletion Sources/Accord.Audio/Filters/WaveRectifier.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
namespace Accord.Audio.Filters
{
using System.Collections.Generic;
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/Generators/ImpulseGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
namespace Accord.Audio.Generators
{
using System;
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/Signals/ComplexSignal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ namespace Accord.Audio
using System;
using System.Runtime.InteropServices;
using Accord.Math;
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/Signals/Signal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Accord.Audio
{
using System;
using System.Runtime.InteropServices;
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
3 changes: 1 addition & 2 deletions Sources/Accord.Audio/Tools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,9 @@ namespace Accord.Audio
{
using System;
using System.Runtime.InteropServices;
using AForge.Math;
using Accord.Math;
using System.Collections.Generic;
using System.Numerics;
using Accord.Math;

/// <summary>
/// Tool functions for audio processing.
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/UnsafeTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ namespace Accord.Audio
{
using System;
using System.Runtime.InteropServices;
using AForge.Math;
using Accord.Math;
using System.Collections.Generic;
using System.Numerics;
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/Windows/IWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
namespace Accord.Audio.Windows
{
using System;
using AForge.Math;

/// <summary>
/// Spectral Window
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/Windows/RectangularWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace Accord.Audio.Windows
{
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
1 change: 0 additions & 1 deletion Sources/Accord.Audio/Windows/WindowBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

namespace Accord.Audio.Windows
{
using AForge.Math;
using System.Numerics;

/// <summary>
Expand Down
29 changes: 29 additions & 0 deletions Sources/Accord.Audition/Accord.Audition (NETStandard).csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>Accord.Audition</AssemblyName>
<RootNamespace>Accord.Audition</RootNamespace>
</PropertyGroup>

<Import Project="$(SolutionDir)Accord.NET (NETStandard).targets" />


<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0</DefineConstants>
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
<OutputPath>$(SolutionDir)..\Debug\</OutputPath>
<DocumentationFile></DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='netstandard|AnyCPU'">
<DefineConstants>TRACE;RELEASE;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Accord.Audio\Accord.Audio (NETStandard).csproj" />
<ProjectReference Include="..\Accord.Core\Accord.Core (NETStandard).csproj" />
<ProjectReference Include="..\Accord.MachineLearning\Accord.MachineLearning (NETStandard).csproj" />
<ProjectReference Include="..\Accord.Math.Core\Accord.Math.Core (NETStandard).csproj" />
<ProjectReference Include="..\Accord.Math\Accord.Math (NETStandard).csproj" />
<ProjectReference Include="..\Accord.Statistics\Accord.Statistics (NETStandard).csproj" />
</ItemGroup>

</Project>
17 changes: 17 additions & 0 deletions Sources/Accord.Controls.Audio/Accord.NS.Controls.Audio.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
<Compile Remove="Properties\VersionInfo.cs" />
</ItemGroup>

</Project>
17 changes: 17 additions & 0 deletions Sources/Accord.Controls.Imaging/Accord.NS.Controls.Imaging.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
<Compile Remove="Properties\VersionInfo.cs" />
</ItemGroup>

</Project>
17 changes: 17 additions & 0 deletions Sources/Accord.Controls.Statistics/Accord.NS.Controls.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
<DefineConstants>TRACE;DEBUG;NETSTANDARD2_0</DefineConstants>
</PropertyGroup>

<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
<Compile Remove="Properties\VersionInfo.cs" />
</ItemGroup>

</Project>
Loading

0 comments on commit 4780e21

Please sign in to comment.