From 96dfb229e4829029b501d2879acf0bf9e3f31b9c Mon Sep 17 00:00:00 2001 From: Kevin Schneider Date: Thu, 9 May 2024 13:38:01 +0200 Subject: [PATCH] setup project --- .config/dotnet-tools.json | 12 +++ .fsdocs/cache | 6 ++ .github/workflows/build-and-test.yml | 66 ++++++++++++++ .github/workflows/deploy-gh-pages.yml | 32 +++++++ .gitignore | 3 + RELEASE_NOTES.md | 4 + TensorMath.sln | 54 ++++++++++++ build.cmd | 4 + build.sh | 6 ++ build/BasicTasks.fs | 37 ++++++++ build/Build.fs | 46 ++++++++++ build/DocumentationTasks.fs | 36 ++++++++ build/Helpers.fs | 28 ++++++ build/MessagePrompts.fs | 18 ++++ build/PackageTasks.fs | 65 ++++++++++++++ build/ProjectInfo.fs | 40 +++++++++ build/ReleaseTasks.fs | 86 +++++++++++++++++++ build/TestTasks.fs | 25 ++++++ build/build.fsproj | 33 +++++++ docs/index.ipynb | 50 +++++++++++ global.json | 6 ++ src/TensorMath/Library.fs | 5 ++ src/TensorMath/TensorMath.fsproj | 12 +++ tests/TensorMath.Tests/Program.fs | 1 + .../TensorMath.Tests/TensorMath.Tests.fsproj | 24 ++++++ tests/TensorMath.Tests/Tests.fs | 15 ++++ 26 files changed, 714 insertions(+) create mode 100644 .config/dotnet-tools.json create mode 100644 .fsdocs/cache create mode 100644 .github/workflows/build-and-test.yml create mode 100644 .github/workflows/deploy-gh-pages.yml create mode 100644 RELEASE_NOTES.md create mode 100644 TensorMath.sln create mode 100644 build.cmd create mode 100644 build.sh create mode 100644 build/BasicTasks.fs create mode 100644 build/Build.fs create mode 100644 build/DocumentationTasks.fs create mode 100644 build/Helpers.fs create mode 100644 build/MessagePrompts.fs create mode 100644 build/PackageTasks.fs create mode 100644 build/ProjectInfo.fs create mode 100644 build/ReleaseTasks.fs create mode 100644 build/TestTasks.fs create mode 100644 build/build.fsproj create mode 100644 docs/index.ipynb create mode 100644 global.json create mode 100644 src/TensorMath/Library.fs create mode 100644 src/TensorMath/TensorMath.fsproj create mode 100644 tests/TensorMath.Tests/Program.fs create mode 100644 tests/TensorMath.Tests/TensorMath.Tests.fsproj create mode 100644 tests/TensorMath.Tests/Tests.fs diff --git a/.config/dotnet-tools.json b/.config/dotnet-tools.json new file mode 100644 index 0000000..8de306d --- /dev/null +++ b/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "fsdocs-tool": { + "version": "20.0.0", + "commands": [ + "fsdocs" + ] + } + } +} \ No newline at end of file diff --git a/.fsdocs/cache b/.fsdocs/cache new file mode 100644 index 0000000..f4180a6 --- /dev/null +++ b/.fsdocs/cache @@ -0,0 +1,6 @@ +@·TupleOfTupleOfstringstringFSharpListOfTupleOfstringFSharpListOfstringFSharpOptionOfstringFSharpOptionOfstringFSharpOptionOfstringbooleanbooleanTupleOfFSharpOptionOfstringFSharpOptionOfstringFSharpListOfTupleOfParamKeystringIrqufEGn5F2dSckgBwVB7epaIz_P_S5UQ85F2dSckgFSharpListOfstringFSharpListOfTupleOfParamKeystringIrqufEGn5F2dSckgnFmJ5oRfTupleOfFSharpOptionOfstringArrayOfstringFSharpListOfstringdateTimeArrayOfdateTime0CngyMQD_ShTDFhl_P.http://schemas.datacontract.org/2004/07/System i)http://www.w3.org/2001/XMLSchema-instance@m_Item1@m_Item1™http://localhost:8901/@m_Item2™ +TensorMath@m_Item3 aDhttp://schemas.datacontract.org/2004/07/Microsoft.FSharp.Collections^head@m_Item1™hC:\Users\schne\source\repos\fslaborg\TensorMath\src\TensorMath\bin\Release\netstandard2.0\TensorMath.dll@m_Item2^head˜k-o:C:\Users\schne\source\repos\fslaborg\TensorMath\src\TensorMath\obj\Release\netstandard2.0\TensorMath.dll^tail^head™--debug:portable^tail^head™ --noframework^tail^head™--define:TRACE^tail^head™--define:RELEASE^tail^head™--define:NETSTANDARD^tail^head™--define:NETSTANDARD2_0^tail^head™"--define:NETSTANDARD1_0_OR_GREATER^tail^head™"--define:NETSTANDARD1_1_OR_GREATER^tail^head™"--define:NETSTANDARD1_2_OR_GREATER^tail^head™"--define:NETSTANDARD1_3_OR_GREATER^tail^head™"--define:NETSTANDARD1_4_OR_GREATER^tail^head™"--define:NETSTANDARD1_5_OR_GREATER^tail^head™"--define:NETSTANDARD1_6_OR_GREATER^tail^head™"--define:NETSTANDARD2_0_OR_GREATER^tail^head™/--doc:obj\Release\netstandard2.0\TensorMath.xml^tail^head™ --optimize+^tail^head˜X-r:C:\Users\schne\.nuget\packages\fsharp.core\8.0.200\lib\netstandard2.0\FSharp.Core.dll^tail^head™s-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\Microsoft.Win32.Primitives.dll^tail^head˜a-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\mscorlib.dll^tail^head™d-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\netstandard.dll^tail^head˜j-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.AppContext.dll^tail^head™v-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Collections.Concurrent.dll^tail^head˜k-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Collections.dll^tail^head™v-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Collections.NonGeneric.dll^tail^head˜w-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Collections.Specialized.dll^tail^head™z-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ComponentModel.Composition.dll^tail^head˜n-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ComponentModel.dll^tail^head™~-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ComponentModel.EventBasedAsync.dll^tail^head˜y-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ComponentModel.Primitives.dll^tail^head™|-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ComponentModel.TypeConverter.dll^tail^head˜g-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Console.dll^tail^head™d-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Core.dll^tail^head˜k-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Data.Common.dll^tail^head™d-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Data.dll^tail^head˜u-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.Contracts.dll^tail^head™q-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.Debug.dll^tail^head˜{-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.FileVersionInfo.dll^tail^head™s-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.Process.dll^tail^head˜v-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.StackTrace.dll^tail^head˜ƒ-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.TextWriterTraceListener.dll^tail^head™q-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.Tools.dll^tail^head˜w-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.TraceSource.dll^tail^head™s-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Diagnostics.Tracing.dll^tail^head˜_-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.dll^tail^head™g-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Drawing.dll^tail^head˜r-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Drawing.Primitives.dll^tail^head™o-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Dynamic.Runtime.dll^tail^head˜w-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Globalization.Calendars.dll^tail^head™m-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Globalization.dll^tail^head˜x-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Globalization.Extensions.dll^tail^head™n-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.Compression.dll^tail^head˜y-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.Compression.FileSystem.dll^tail^head™v-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.Compression.ZipFile.dll^tail^head˜b-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.dll^tail^head™m-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.FileSystem.dll^tail^head˜w-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.FileSystem.DriveInfo.dll^tail^head™x-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.FileSystem.Primitives.dll^tail^head˜u-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.FileSystem.Watcher.dll^tail^head™r-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.IsolatedStorage.dll^tail^head˜t-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.MemoryMappedFiles.dll^tail^head™h-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.Pipes.dll^tail^head˜x-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.IO.UnmanagedMemoryStream.dll^tail^head™d-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Linq.dll^tail^head˜p-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Linq.Expressions.dll^tail^head™m-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Linq.Parallel.dll^tail^head˜n-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Linq.Queryable.dll^tail^head™c-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.dll^tail^head˜h-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.Http.dll^tail^head™r-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.NameResolution.dll^tail^head˜v-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.NetworkInformation.dll^tail^head™h-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.Ping.dll^tail^head˜n-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.Primitives.dll^tail^head™l-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.Requests.dll^tail^head˜l-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.Security.dll^tail^head™k-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.Sockets.dll^tail^head˜w-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.WebHeaderCollection.dll^tail^head™u-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.WebSockets.Client.dll^tail^head˜n-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Net.WebSockets.dll^tail^head™h-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Numerics.dll^tail^head˜k-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ObjectModel.dll^tail^head™j-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Reflection.dll^tail^head˜u-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Reflection.Extensions.dll^tail^head™u-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Reflection.Primitives.dll^tail^head˜p-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Resources.Reader.dll^tail^head™y-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Resources.ResourceManager.dll^tail^head˜p-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Resources.Writer.dll^tail^head™€-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.CompilerServices.VisualC.dll^tail^head˜g-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.dll^tail^head™r-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Extensions.dll^tail^head˜o-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Handles.dll^tail^head™w-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.InteropServices.dll^tail^head˜Š-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.InteropServices.RuntimeInformation.dll^tail^head™p-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Numerics.dll^tail^head˜u-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Serialization.dll^tail^head˜€-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Serialization.Formatters.dll^tail^head™z-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Serialization.Json.dll^tail^head˜€-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Serialization.Primitives.dll^tail^head™y-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Runtime.Serialization.Xml.dll^tail^head˜o-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.Claims.dll^tail^head™€-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.Cryptography.Algorithms.dll^tail^head˜y-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.Cryptography.Csp.dll^tail^head˜~-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.Cryptography.Encoding.dll^tail^head˜€-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.Cryptography.Primitives.dll^tail^head˜†-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.Cryptography.X509Certificates.dll^tail^head™r-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.Principal.dll^tail^head˜u-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Security.SecureString.dll^tail^head™p-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ServiceModel.Web.dll^tail^head˜m-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Text.Encoding.dll^tail^head™x-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Text.Encoding.Extensions.dll^tail^head˜w-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Text.RegularExpressions.dll^tail^head™i-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Threading.dll^tail^head˜t-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Threading.Overlapped.dll^tail^head™o-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Threading.Tasks.dll^tail^head˜x-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Threading.Tasks.Parallel.dll^tail^head™p-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Threading.Thread.dll^tail^head˜t-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Threading.ThreadPool.dll^tail^head™o-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Threading.Timer.dll^tail^head˜l-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Transactions.dll^tail^head™j-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.ValueTuple.dll^tail^head˜c-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Web.dll^tail^head™g-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Windows.dll^tail^head˜c-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.dll^tail^head™h-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.Linq.dll^tail^head˜p-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.ReaderWriter.dll^tail^head™q-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.Serialization.dll^tail^head˜m-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.XDocument.dll^tail^head™o-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.XmlDocument.dll^tail^head˜q-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.XmlSerializer.dll^tail^head™i-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.XPath.dll^tail^head˜s-r:C:\Users\schne\.nuget\packages\netstandard.library\2.0.3\build\netstandard2.0\ref\System.Xml.XPath.XDocument.dll^tail^head™--target:library^tail^head™--warn:3^tail^head™--warnaserror:3239^tail^head™ --fullpaths^tail^head™ --flaterrors^tail^head™--highentropyva+^tail^head™--targetprofile:netstandard^tail^head™--nocopyfsharpcore^tail^head™--deterministic+^tail^head™--simpleresolution^tail^head.nil†^tail.nil†@m_Item3.nil† b=http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Core@m_Item4.nil† b=http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Core@m_Item5 b=http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Core_value™git@m_Item6…@m_Item7…@m_Rest@m_Item1.nil† b=http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Core@m_Item2.nil† b=http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Core@m_Item3^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™root@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-authors@m_Item2™ +TensorMath^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-collection-name@m_Item2™ +TensorMath^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-logo-src@m_Item2™ img/logo.png^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-favicon-src@m_Item2™img/favicon.ico^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™ fsdocs-theme@m_Item2™default^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-logo-link@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-project-url@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-tags@m_Item2^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-version@m_Item2™1.0.0^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™root@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-version@m_Item2™0.0.0^tail^head.nil†^tail.nil†^tail^head.nil†^tail.nil†@m_Item4 aDhttp://schemas.datacontract.org/2004/07/Microsoft.FSharp.Collections^head™YC:\Users\schne\source\repos\fslaborg\TensorMath\src\TensorMath\bin\Release\netstandard2.0^tail^head.nil†^tail.nil†@m_Item5 aDhttp://schemas.datacontract.org/2004/07/Microsoft.FSharp.Collections^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™root@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-authors@m_Item2™ +TensorMath^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-collection-name@m_Item2™ +TensorMath^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-logo-src@m_Item2™ img/logo.png^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-favicon-src@m_Item2™img/favicon.ico^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™ fsdocs-theme@m_Item2™default^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-logo-link@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-project-url@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-tags@m_Item2^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-version@m_Item2™1.0.0^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™root@m_Item2™http://localhost:8901/^tail^head@m_Item1 bDhttp://schemas.datacontract.org/2004/07/FSharp.Formatting.Templating_item™fsdocs-package-version@m_Item2™0.0.0^tail^head.nil†^tail.nil†@m_Item2@m_Item1 a=http://schemas.datacontract.org/2004/07/Microsoft.FSharp.Core^value™http://localhost:8901/@m_Item2 a9http://schemas.microsoft.com/2003/10/Serialization/Arrays^string™fsdocs-package-version^string™0.0.0@m_Item3 aDhttp://schemas.datacontract.org/2004/07/Microsoft.FSharp.Collections^head.nil†^tail.nil†@m_Item4—Áäš4-ÜH@m_Item5 a9http://schemas.microsoft.com/2003/10/Serialization/Arrays \ No newline at end of file diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml new file mode 100644 index 0000000..de838bf --- /dev/null +++ b/.github/workflows/build-and-test.yml @@ -0,0 +1,66 @@ +name: Build and test + +on: + push: + branches: [ main ] + paths: + - 'src/**' + - 'tests/**' + - 'build/**' + - '.github/**' + pull_request: + branches: [ main ] + paths: + - 'src/**' + - 'tests/**' + - 'build/**' + - '.github/**' + + +jobs: + + build-and-test-linux: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x.x + - name: make script executable + run: chmod u+x build.sh + - name: Build and test + working-directory: ./ + run: ./build.sh runtests + + build-and-test-windows: + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x.x + - name: Build and test + working-directory: ./ + run: ./build.cmd runtests + + build-and-test-macos: + + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x.x + - name: make script executable + run: chmod u+x build.sh + - name: Build and test + working-directory: ./ + run: ./build.sh runtests diff --git a/.github/workflows/deploy-gh-pages.yml b/.github/workflows/deploy-gh-pages.yml new file mode 100644 index 0000000..71d3d50 --- /dev/null +++ b/.github/workflows/deploy-gh-pages.yml @@ -0,0 +1,32 @@ +name: deploy-gh-pages + +on: + push: + branches: [ developer ] + paths: + - 'docs/**' + +jobs: + build-and-deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 8.x.x + - name: Restore tools + run: dotnet tool restore + - name: make script executable + run: chmod u+x build.sh + - name: Build example docs + run: ./build.sh buildDocs + - name: deploy + uses: JamesIves/github-pages-deploy-action@3.7.1 + with: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + BRANCH: gh-pages # The branch the action should deploy to. + FOLDER: ./output # The folder the action should deploy. + CLEAN: true # Automatically remove deleted files from the deploy branch \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8a30d25..a33e329 100644 --- a/.gitignore +++ b/.gitignore @@ -396,3 +396,6 @@ FodyWeavers.xsd # JetBrains Rider *.sln.iml +/tmp +/output +/pkg \ No newline at end of file diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000..adf807d --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,4 @@ +### 0.0.0 (Released 2024-5-9) +* Additions: + * Initial set up for RELEASE_Notes.md + diff --git a/TensorMath.sln b/TensorMath.sln new file mode 100644 index 0000000..e3f3a86 --- /dev/null +++ b/TensorMath.sln @@ -0,0 +1,54 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{5317FD43-7D2F-4F4F-8444-B6AA1285C4BD}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TensorMath", "src\TensorMath\TensorMath.fsproj", "{03276E48-6B47-463F-A5BC-59580A623ADB}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{BAA394CB-3D6F-4CE9-BAE8-56603DBE7793}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TensorMath.Tests", "tests\TensorMath.Tests\TensorMath.Tests.fsproj", "{6D6C1F8A-1AFE-4BEE-A073-24515FCC6460}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{7007FA68-0E95-42A0-B25C-A9BBA6071B34}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "build", "build\build.fsproj", "{D305E2AA-681F-47ED-87C8-7A9F6EA2F1A6}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".ci", ".ci", "{CD408BBB-CFDB-4889-AA66-6F0935B7AD18}" + ProjectSection(SolutionItems) = preProject + .github\workflows\build-and-test.yml = .github\workflows\build-and-test.yml + .github\workflows\deploy-gh-pages.yml = .github\workflows\deploy-gh-pages.yml + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {03276E48-6B47-463F-A5BC-59580A623ADB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {03276E48-6B47-463F-A5BC-59580A623ADB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {03276E48-6B47-463F-A5BC-59580A623ADB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {03276E48-6B47-463F-A5BC-59580A623ADB}.Release|Any CPU.Build.0 = Release|Any CPU + {6D6C1F8A-1AFE-4BEE-A073-24515FCC6460}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6D6C1F8A-1AFE-4BEE-A073-24515FCC6460}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6D6C1F8A-1AFE-4BEE-A073-24515FCC6460}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6D6C1F8A-1AFE-4BEE-A073-24515FCC6460}.Release|Any CPU.Build.0 = Release|Any CPU + {D305E2AA-681F-47ED-87C8-7A9F6EA2F1A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D305E2AA-681F-47ED-87C8-7A9F6EA2F1A6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D305E2AA-681F-47ED-87C8-7A9F6EA2F1A6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D305E2AA-681F-47ED-87C8-7A9F6EA2F1A6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {03276E48-6B47-463F-A5BC-59580A623ADB} = {5317FD43-7D2F-4F4F-8444-B6AA1285C4BD} + {6D6C1F8A-1AFE-4BEE-A073-24515FCC6460} = {BAA394CB-3D6F-4CE9-BAE8-56603DBE7793} + {D305E2AA-681F-47ED-87C8-7A9F6EA2F1A6} = {7007FA68-0E95-42A0-B25C-A9BBA6071B34} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {7A89F710-DE41-4B47-B450-17CCB1B3A0DC} + EndGlobalSection +EndGlobal diff --git a/build.cmd b/build.cmd new file mode 100644 index 0000000..97d967d --- /dev/null +++ b/build.cmd @@ -0,0 +1,4 @@ +@echo off +cls + +dotnet run --project ./build/build.fsproj %* \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..f33a768 --- /dev/null +++ b/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -eu +set -o pipefail + +dotnet run --project ./build/build.fsproj "$@" \ No newline at end of file diff --git a/build/BasicTasks.fs b/build/BasicTasks.fs new file mode 100644 index 0000000..c5be532 --- /dev/null +++ b/build/BasicTasks.fs @@ -0,0 +1,37 @@ +module BasicTasks + +open BlackFox.Fake +open Fake.IO +open Fake.DotNet +open Fake.IO.Globbing.Operators + +open ProjectInfo + +let clean = BuildTask.create "Clean" [] { + !! "src/**/bin" + ++ "src/**/obj" + ++ "tests/**/bin" + ++ "tests/**/obj" + ++ "pkg" + |> Shell.cleanDirs +} + + +let setPrereleaseTag = BuildTask.create "SetPrereleaseTag" [] { + printfn "Please enter pre-release package suffix" + let suffix = System.Console.ReadLine() + prereleaseSuffix <- suffix + prereleaseTag <- (sprintf "%s-%s" release.NugetVersion suffix) + isPrerelease <- true +} + +/// builds the solution file (dotnet build solution.sln) +let buildSolution = + BuildTask.create "BuildSolution" [ clean ] { + solutionFile + |> DotNet.build (fun p -> + { p with MSBuildParams = { p.MSBuildParams with DisableInternalBinLog = true }} + |> DotNet.Options.withCustomParams (Some "-tl") + ) + } + diff --git a/build/Build.fs b/build/Build.fs new file mode 100644 index 0000000..bd6b4bb --- /dev/null +++ b/build/Build.fs @@ -0,0 +1,46 @@ +open BlackFox.Fake +open System.IO +open Fake.Core +open Fake.DotNet +open Fake.IO +open Fake.IO.FileSystemOperators +open Fake.IO.Globbing.Operators +open Fake.Tools + +open Helpers + +initializeContext() + +open BasicTasks +open TestTasks +open PackageTasks +open DocumentationTasks +open ReleaseTasks + +/// Full release of nuget package, git tag, and documentation for the stable version. +let _release = + BuildTask.createEmpty + "Release" + [clean; buildSolution; runTests; pack; buildDocs; createTag; publishNuget; releaseDocs] + +/// Full release of nuget package, git tag, and documentation for the prerelease version. +let _preRelease = + BuildTask.createEmpty + "PreRelease" + [setPrereleaseTag; clean; buildSolution; runTests; packPrerelease; buildDocsPrerelease; createPrereleaseTag; publishNugetPrerelease; prereleaseDocs] + +/// Full release of nuget package for the prerelease version. +let _releaseNoDocs = + BuildTask.createEmpty + "ReleaseNoDocs" + [clean; buildSolution; runTests; pack; createTag; publishNuget;] + +/// Full release of nuget package for the prerelease version. +let _preReleaseNoDocs = + BuildTask.createEmpty + "PreReleaseNoDocs" + [setPrereleaseTag; clean; buildSolution; runTests; packPrerelease; createPrereleaseTag; publishNugetPrerelease] + +[] +let main args = + runOrDefault buildSolution args diff --git a/build/DocumentationTasks.fs b/build/DocumentationTasks.fs new file mode 100644 index 0000000..4c8a694 --- /dev/null +++ b/build/DocumentationTasks.fs @@ -0,0 +1,36 @@ +module DocumentationTasks + +open Helpers +open ProjectInfo +open BasicTasks + +open BlackFox.Fake + + +let buildDocs = BuildTask.create "BuildDocs" [buildSolution] { + printfn "building docs with stable version %s" stableVersionTag + runDotNet + (sprintf "fsdocs build --clean --properties Configuration=%s --parameters fsdocs-package-version %s" configuration stableVersionTag) + "./" +} + +let buildDocsPrerelease = BuildTask.create "BuildDocsPrerelease" [setPrereleaseTag; buildSolution] { + printfn "building docs with prerelease version %s" prereleaseTag + runDotNet + (sprintf "fsdocs build --clean --properties Configuration=%s --parameters fsdocs-package-version %s" configuration prereleaseTag) + "./" +} + +let watchDocs = BuildTask.create "WatchDocs" [buildSolution] { + printfn "watching docs with stable version %s" stableVersionTag + runDotNet + (sprintf "fsdocs watch --clean --properties Configuration=%s --parameters fsdocs-package-version %s" configuration stableVersionTag) + "./" +} + +let watchDocsPrerelease = BuildTask.create "WatchDocsPrerelease" [setPrereleaseTag; buildSolution] { + printfn "watching docs with prerelease version %s" prereleaseTag + runDotNet + (sprintf "fsdocs watch --clean --properties Configuration=%s --parameters fsdocs-package-version %s" configuration prereleaseTag) + "./" +} diff --git a/build/Helpers.fs b/build/Helpers.fs new file mode 100644 index 0000000..5dd1ed8 --- /dev/null +++ b/build/Helpers.fs @@ -0,0 +1,28 @@ +module Helpers + +open BlackFox.Fake +open Fake.Core +open Fake.DotNet + +let initializeContext () = + let execContext = Context.FakeExecutionContext.Create false "build.fsx" [ ] + Context.setExecutionContext (Context.RuntimeContext.Fake execContext) + +/// Executes a dotnet command in the given working directory +let runDotNet cmd workingDir = + let result = + DotNet.exec (DotNet.Options.withWorkingDirectory workingDir) cmd "" + if result.ExitCode <> 0 then failwithf "'dotnet %s' failed in %s" cmd workingDir + +let runOrDefault defaultTarget args = + Trace.trace (sprintf "%A" args) + try + match args with + | [| target |] -> Target.runOrDefault target + | arr when args.Length > 1 -> + Target.run 0 (Array.head arr) ( Array.tail arr |> List.ofArray ) + | _ -> BuildTask.runOrDefault defaultTarget + 0 + with e -> + printfn "%A" e + 1 \ No newline at end of file diff --git a/build/MessagePrompts.fs b/build/MessagePrompts.fs new file mode 100644 index 0000000..afa3708 --- /dev/null +++ b/build/MessagePrompts.fs @@ -0,0 +1,18 @@ +module MessagePrompts + +let prompt (msg:string) = + System.Console.Write(msg) + System.Console.ReadLine().Trim() + |> function | "" -> None | s -> Some s + |> Option.map (fun s -> s.Replace ("\"","\\\"")) + +let rec promptYesNo msg = + match prompt (sprintf "%s [Yn]: " msg) with + | Some "Y" | Some "y" -> true + | Some "N" | Some "n" -> false + | _ -> System.Console.WriteLine("Sorry, invalid answer"); promptYesNo msg + +let releaseMsg = """This will stage all uncommitted changes, push them to the origin and bump the release version to the latest number in the RELEASE_NOTES.md file. + Do you want to continue?""" + +let releaseDocsMsg = """This will push the docs to gh-pages. Remember building the docs prior to this. Do you want to continue?""" \ No newline at end of file diff --git a/build/PackageTasks.fs b/build/PackageTasks.fs new file mode 100644 index 0000000..0d45ad9 --- /dev/null +++ b/build/PackageTasks.fs @@ -0,0 +1,65 @@ +module PackageTasks + +open ProjectInfo + +open MessagePrompts +open BasicTasks +open TestTasks + +open BlackFox.Fake +open Fake.Core +open Fake.DotNet +open Fake.IO.Globbing.Operators + +open System.Text.RegularExpressions + + +let pack = BuildTask.create "Pack" [clean; buildSolution; runTests] { + if promptYesNo (sprintf "creating stable package with version %s OK?" stableVersionTag ) + then + !! "src/**/*.*proj" + -- "src/bin/*" + |> Seq.iter (Fake.DotNet.DotNet.pack (fun p -> + let msBuildParams = + {p.MSBuildParams with + Properties = ([ + "Version",stableVersionTag + "PackageReleaseNotes", (release.Notes |> String.concat "\r\n" ) + ] @ p.MSBuildParams.Properties) + DisableInternalBinLog = true + } + { + p with + MSBuildParams = msBuildParams + OutputPath = Some pkgDir + } + |> DotNet.Options.withCustomParams (Some "-tl") + )) + else failwith "aborted" +} + +let packPrerelease = BuildTask.create "PackPrerelease" [setPrereleaseTag; clean; buildSolution; runTests] { + if promptYesNo (sprintf "package tag will be %s OK?" prereleaseTag ) + then + !! "src/**/*.*proj" + -- "src/bin/*" + |> Seq.iter (Fake.DotNet.DotNet.pack (fun p -> + let msBuildParams = + {p.MSBuildParams with + Properties = ([ + "Version", prereleaseTag + "PackageReleaseNotes", (release.Notes |> String.toLines ) + ] @ p.MSBuildParams.Properties) + DisableInternalBinLog = true + } + { + p with + VersionSuffix = Some prereleaseSuffix + OutputPath = Some pkgDir + MSBuildParams = msBuildParams + } + |> DotNet.Options.withCustomParams (Some "-tl") + )) + else + failwith "aborted" +} diff --git a/build/ProjectInfo.fs b/build/ProjectInfo.fs new file mode 100644 index 0000000..9206f54 --- /dev/null +++ b/build/ProjectInfo.fs @@ -0,0 +1,40 @@ +module ProjectInfo + +open Fake.Core + + +let project = "TensorMath" + +let testProjects = + [ + "tests/TensorMath.Tests/TensorMath.Tests.fsproj" + ] + +let solutionFile = $"{project}.sln" + +let configuration = "Release" + +let gitOwner = "fslaborg" + +let gitHome = $"https://github.com/{gitOwner}" + +let projectRepo = $"https://github.com/{gitOwner}/{project}" + +let pkgDir = "pkg" + + +// Create RELEASE_NOTES.md if not existing. Or "release" would throw an error. +Fake.Extensions.Release.ReleaseNotes.ensure() + +let release = ReleaseNotes.load "RELEASE_NOTES.md" + +let stableVersion = SemVer.parse release.NugetVersion + +let stableVersionTag = (sprintf "%i.%i.%i" stableVersion.Major stableVersion.Minor stableVersion.Patch ) + +let mutable prereleaseSuffix = "" + +let mutable prereleaseTag = "" + +let mutable isPrerelease = false + diff --git a/build/ReleaseTasks.fs b/build/ReleaseTasks.fs new file mode 100644 index 0000000..d7f7005 --- /dev/null +++ b/build/ReleaseTasks.fs @@ -0,0 +1,86 @@ +module ReleaseTasks + +open MessagePrompts +open ProjectInfo +open BasicTasks +open TestTasks +open PackageTasks +open DocumentationTasks + +open BlackFox.Fake +open Fake.Core +open Fake.DotNet +open Fake.Api +open Fake.Tools +open Fake.IO +open Fake.IO.Globbing.Operators + +let createTag = BuildTask.create "CreateTag" [clean; buildSolution; runTests; pack] { + if promptYesNo (sprintf "tagging branch with %s OK?" stableVersionTag ) then + Git.Branches.tag "" stableVersionTag + Git.Branches.pushTag "" projectRepo stableVersionTag + else + failwith "aborted" +} + +let createPrereleaseTag = BuildTask.create "CreatePrereleaseTag" [setPrereleaseTag; clean; buildSolution; runTests; packPrerelease] { + if promptYesNo (sprintf "tagging branch with %s OK?" prereleaseTag ) then + Git.Branches.tag "" prereleaseTag + Git.Branches.pushTag "" projectRepo prereleaseTag + else + failwith "aborted" +} + +let publishNuget = BuildTask.create "PublishNuget" [clean; buildSolution; runTests; pack] { + let targets = (!! (sprintf "%s/*.*pkg" pkgDir )) + for target in targets do printfn "%A" target + let msg = sprintf "release package with version %s?" stableVersionTag + if promptYesNo msg then + let source = "https://api.nuget.org/v3/index.json" + let apikey = Environment.environVar "YOUR_KEY_HERE" + for artifact in targets do + let result = DotNet.exec id "nuget" (sprintf "push -s %s -k %s %s --skip-duplicate" source apikey artifact) + if not result.OK then failwith "failed to push packages" + else failwith "aborted" +} + +let publishNugetPrerelease = BuildTask.create "PublishNugetPrerelease" [clean; buildSolution; runTests; packPrerelease] { + let targets = (!! (sprintf "%s/*.*pkg" pkgDir )) + for target in targets do printfn "%A" target + let msg = sprintf "release package with version %s?" prereleaseTag + if promptYesNo msg then + let source = "https://api.nuget.org/v3/index.json" + let apikey = Environment.environVar "YOUR_KEY_HERE" + for artifact in targets do + let result = DotNet.exec id "nuget" (sprintf "push -s %s -k %s %s --skip-duplicate" source apikey artifact) + if not result.OK then failwith "failed to push packages" + else failwith "aborted" +} + +let releaseDocs = BuildTask.create "ReleaseDocs" [buildDocs] { + let msg = + sprintf "release docs for version %s?" + stableVersionTag + if promptYesNo msg then + Shell.cleanDir "temp" + Git.CommandHelper.runSimpleGitCommand "." (sprintf "clone %s temp/gh-pages --depth 1 -b gh-pages" projectRepo) |> ignore + Shell.copyRecursive "output" "temp/gh-pages" true |> printfn "%A" + Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" "add ." |> printfn "%s" + let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" stableVersionTag + Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s" + Git.Branches.push "temp/gh-pages" + else failwith "aborted" +} + +let prereleaseDocs = BuildTask.create "PrereleaseDocs" [buildDocsPrerelease] { + let msg = sprintf "release docs for version %s?" prereleaseTag + if promptYesNo msg then + Shell.cleanDir "temp" + Git.CommandHelper.runSimpleGitCommand "." (sprintf "clone %s temp/gh-pages --depth 1 -b gh-pages" projectRepo) |> ignore + Shell.copyRecursive "output" "temp/gh-pages" true |> printfn "%A" + Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" "add ." |> printfn "%s" + let cmd = sprintf """commit -a -m "Update generated documentation for version %s""" prereleaseTag + Git.CommandHelper.runSimpleGitCommand "temp/gh-pages" cmd |> printfn "%s" + Git.Branches.push "temp/gh-pages" + else failwith "aborted" +} diff --git a/build/TestTasks.fs b/build/TestTasks.fs new file mode 100644 index 0000000..d1f647a --- /dev/null +++ b/build/TestTasks.fs @@ -0,0 +1,25 @@ +module TestTasks + +open BlackFox.Fake +open Fake.DotNet + +open ProjectInfo +open BasicTasks + + +let runTests = BuildTask.create "RunTests" [clean; buildSolution] { + testProjects + |> Seq.iter (fun testProject -> + testProject + |> Fake.DotNet.DotNet.test (fun testParams -> + { testParams with + Logger = Some "console;verbosity=detailed" + Configuration = DotNet.BuildConfiguration.fromString configuration + NoBuild = true + MSBuildParams = { testParams.MSBuildParams with DisableInternalBinLog = true } + } + |> DotNet.Options.withCustomParams (Some "-tl") + ) + ) +} + diff --git a/build/build.fsproj b/build/build.fsproj new file mode 100644 index 0000000..448beec --- /dev/null +++ b/build/build.fsproj @@ -0,0 +1,33 @@ + + + + net8.0 + Exe + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/index.ipynb b/docs/index.ipynb new file mode 100644 index 0000000..26a3d73 --- /dev/null +++ b/docs/index.ipynb @@ -0,0 +1,50 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# TensorMath" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": { + "dotnet_interactive": { + "language": "fsharp" + }, + "polyglot_notebook": { + "kernelName": "fsharp" + } + }, + "outputs": [], + "source": [ + "let a = 42\n", + "\n", + "a" + ] + } + ], + "metadata": { + "kernelspec": { + "display_name": ".NET (F#)", + "language": "F#", + "name": ".net-fsharp" + }, + "polyglot_notebook": { + "kernelInfo": { + "defaultKernelName": "fsharp", + "items": [ + { + "aliases": [], + "languageName": "fsharp", + "name": "fsharp" + } + ] + } + } + }, + "nbformat": 4, + "nbformat_minor": 2 +} diff --git a/global.json b/global.json new file mode 100644 index 0000000..989a69c --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "version": "8.0.100", + "rollForward": "latestMinor" + } +} \ No newline at end of file diff --git a/src/TensorMath/Library.fs b/src/TensorMath/Library.fs new file mode 100644 index 0000000..58a485d --- /dev/null +++ b/src/TensorMath/Library.fs @@ -0,0 +1,5 @@ +namespace TensorMath + +module Say = + let hello name = + printfn "Hello %s" name diff --git a/src/TensorMath/TensorMath.fsproj b/src/TensorMath/TensorMath.fsproj new file mode 100644 index 0000000..c8d2ac8 --- /dev/null +++ b/src/TensorMath/TensorMath.fsproj @@ -0,0 +1,12 @@ + + + + netstandard2.0 + true + + + + + + + diff --git a/tests/TensorMath.Tests/Program.fs b/tests/TensorMath.Tests/Program.fs new file mode 100644 index 0000000..0695f84 --- /dev/null +++ b/tests/TensorMath.Tests/Program.fs @@ -0,0 +1 @@ +module Program = let [] main _ = 0 diff --git a/tests/TensorMath.Tests/TensorMath.Tests.fsproj b/tests/TensorMath.Tests/TensorMath.Tests.fsproj new file mode 100644 index 0000000..7f5e556 --- /dev/null +++ b/tests/TensorMath.Tests/TensorMath.Tests.fsproj @@ -0,0 +1,24 @@ + + + + net8.0 + + false + false + true + + + + + + + + + + + + + + + + diff --git a/tests/TensorMath.Tests/Tests.fs b/tests/TensorMath.Tests/Tests.fs new file mode 100644 index 0000000..3ad040e --- /dev/null +++ b/tests/TensorMath.Tests/Tests.fs @@ -0,0 +1,15 @@ +module Tests + +open System +open Xunit +open FsCheck.Xunit + +[] +let ``true is true`` () = + Assert.True(true) + +// a property-based test are parametrized test, which are tested with a range of random inputs. +// This can be helpful to find edge cases that you might not have thought of. +[] +let ``Boolean is true or false`` (b: bool) = + b = true || b = false \ No newline at end of file