mirror of
https://github.com/Smaug123/dotnet-classical-ciphers
synced 2025-10-11 07:28:39 +00:00
Compare commits
28 Commits
5abcedaab4
...
main
Author | SHA1 | Date | |
---|---|---|---|
|
3b66a93917 | ||
|
d20e8469ea | ||
|
1926623522 | ||
|
2c3e3c7cad | ||
|
545c9bef20 | ||
|
538ad7d5ef | ||
|
e2769f93e3 | ||
|
f93d2bc10c | ||
|
aebe13db6e | ||
|
3536662096 | ||
|
e2b8b5f460 | ||
|
e94533562d | ||
|
6cec8dc5c4 | ||
|
79ac61e1ef | ||
|
9e290778e7 | ||
|
6be9aa182f | ||
|
4caa1940a1 | ||
|
8d97fe40e0 | ||
|
095f9bcec1 | ||
|
46f9611f46 | ||
|
816029857c | ||
|
66e4125288 | ||
|
1e45372487 | ||
|
049635035f | ||
|
2674257cbf | ||
|
b3805fbd16 | ||
|
71f0289341 | ||
|
f65b765dc0 |
@@ -3,7 +3,7 @@
|
|||||||
"isRoot": true,
|
"isRoot": true,
|
||||||
"tools": {
|
"tools": {
|
||||||
"fantomas": {
|
"fantomas": {
|
||||||
"version": "6.0.1",
|
"version": "6.3.4",
|
||||||
"commands": [
|
"commands": [
|
||||||
"fantomas"
|
"fantomas"
|
||||||
]
|
]
|
||||||
|
@@ -1,41 +1,40 @@
|
|||||||
root=true
|
root=true
|
||||||
|
|
||||||
[*]
|
[*]
|
||||||
charset=utf-8
|
charset=utf-8
|
||||||
end_of_line=crlf
|
trim_trailing_whitespace=true
|
||||||
trim_trailing_whitespace=true
|
insert_final_newline=true
|
||||||
insert_final_newline=true
|
indent_style=space
|
||||||
indent_style=space
|
indent_size=4
|
||||||
indent_size=4
|
|
||||||
|
# ReSharper properties
|
||||||
# ReSharper properties
|
resharper_xml_indent_size=2
|
||||||
resharper_xml_indent_size=2
|
resharper_xml_max_line_length=100
|
||||||
resharper_xml_max_line_length=100
|
resharper_xml_tab_width=2
|
||||||
resharper_xml_tab_width=2
|
|
||||||
|
[*.{csproj,fsproj,sqlproj,targets,props,ts,tsx,css,json}]
|
||||||
[*.{csproj,fsproj,sqlproj,targets,props,ts,tsx,css,json}]
|
indent_style=space
|
||||||
indent_style=space
|
indent_size=2
|
||||||
indent_size=2
|
|
||||||
|
[*.{fs,fsi}]
|
||||||
[*.{fs,fsi}]
|
fsharp_bar_before_discriminated_union_declaration=true
|
||||||
fsharp_bar_before_discriminated_union_declaration=true
|
fsharp_space_before_uppercase_invocation=true
|
||||||
fsharp_space_before_uppercase_invocation=true
|
fsharp_space_before_class_constructor=true
|
||||||
fsharp_space_before_class_constructor=true
|
fsharp_space_before_member=true
|
||||||
fsharp_space_before_member=true
|
fsharp_space_before_colon=true
|
||||||
fsharp_space_before_colon=true
|
fsharp_space_before_semicolon=true
|
||||||
fsharp_space_before_semicolon=true
|
fsharp_multiline_bracket_style=aligned
|
||||||
fsharp_multiline_bracket_style=aligned
|
fsharp_newline_between_type_definition_and_members=true
|
||||||
fsharp_newline_between_type_definition_and_members=true
|
fsharp_align_function_signature_to_indentation=true
|
||||||
fsharp_align_function_signature_to_indentation=true
|
fsharp_alternative_long_member_definitions=true
|
||||||
fsharp_alternative_long_member_definitions=true
|
fsharp_multi_line_lambda_closing_newline=true
|
||||||
fsharp_multi_line_lambda_closing_newline=true
|
fsharp_experimental_keep_indent_in_branch=true
|
||||||
fsharp_experimental_keep_indent_in_branch=true
|
fsharp_max_value_binding_width=80
|
||||||
fsharp_max_value_binding_width=80
|
fsharp_max_record_width=0
|
||||||
fsharp_max_record_width=0
|
max_line_length=120
|
||||||
max_line_length=120
|
end_of_line=lf
|
||||||
end_of_line=lf
|
|
||||||
|
[*.{appxmanifest,build,dtd,nuspec,xaml,xamlx,xoml,xsd}]
|
||||||
[*.{appxmanifest,build,dtd,nuspec,xaml,xamlx,xoml,xsd}]
|
indent_style=space
|
||||||
indent_style=space
|
indent_size=2
|
||||||
indent_size=2
|
tab_width=2
|
||||||
tab_width=2
|
|
||||||
|
32
.github/dependabot.yml
vendored
32
.github/dependabot.yml
vendored
@@ -1,20 +1,12 @@
|
|||||||
# To get started with Dependabot version updates, you'll need to specify which
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
# package ecosystems to update and where the package manifests are located.
|
# package ecosystems to update and where the package manifests are located.
|
||||||
# Please see the documentation for all configuration options:
|
# Please see the documentation for all configuration options:
|
||||||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
|
||||||
version: 2
|
version: 2
|
||||||
updates:
|
updates:
|
||||||
|
|
||||||
- package-ecosystem: "github-actions"
|
- package-ecosystem: "github-actions"
|
||||||
directory: "/"
|
directory: "/"
|
||||||
schedule:
|
schedule:
|
||||||
interval: "weekly"
|
interval: "weekly"
|
||||||
|
|
||||||
- package-ecosystem: "nuget"
|
|
||||||
directory: "/"
|
|
||||||
schedule:
|
|
||||||
interval: "weekly"
|
|
||||||
ignore:
|
|
||||||
# Target the lowest version of FSharp.Core, for max compat
|
|
||||||
- dependency-name: "FSharp.Core"
|
|
||||||
|
200
.github/workflows/dotnet.yaml
vendored
200
.github/workflows/dotnet.yaml
vendored
@@ -1,97 +1,103 @@
|
|||||||
name: .NET
|
name: .NET
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DOTNET_NOLOGO: true
|
DOTNET_NOLOGO: true
|
||||||
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
DOTNET_CLI_TELEMETRY_OPTOUT: true
|
||||||
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
|
||||||
NUGET_XMLDOC_MODE: ''
|
NUGET_XMLDOC_MODE: ''
|
||||||
DOTNET_MULTILEVEL_LOOKUP: 0
|
DOTNET_MULTILEVEL_LOOKUP: 0
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
config:
|
config:
|
||||||
- Release
|
- Release
|
||||||
- Debug
|
- Debug
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0 # so that NerdBank.GitVersioning has access to history
|
fetch-depth: 0 # so that NerdBank.GitVersioning has access to history
|
||||||
- name: Setup .NET
|
- name: Install Nix
|
||||||
uses: actions/setup-dotnet@v3
|
uses: cachix/install-nix-action@v31
|
||||||
with:
|
with:
|
||||||
dotnet-version: 7.0.x
|
extra_nix_config: |
|
||||||
- name: Restore dependencies
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
run: dotnet restore
|
- name: Restore dependencies
|
||||||
- name: Build
|
run: nix develop --command dotnet restore
|
||||||
run: dotnet build --no-restore --configuration ${{matrix.config}}
|
- name: Build
|
||||||
- name: Test
|
run: nix develop --command dotnet build --no-restore --configuration ${{matrix.config}}
|
||||||
run: dotnet test --no-build --verbosity normal --configuration ${{matrix.config}}
|
- name: Test
|
||||||
|
run: nix develop --command dotnet test --no-build --verbosity normal --configuration ${{matrix.config}}
|
||||||
build-nix:
|
|
||||||
runs-on: ubuntu-latest
|
build-nix:
|
||||||
steps:
|
runs-on: ubuntu-latest
|
||||||
- name: Checkout
|
steps:
|
||||||
uses: actions/checkout@v3
|
- name: Checkout
|
||||||
- name: Install Nix
|
uses: actions/checkout@v5
|
||||||
uses: cachix/install-nix-action@v20
|
- name: Install Nix
|
||||||
with:
|
uses: cachix/install-nix-action@v31
|
||||||
extra_nix_config: |
|
with:
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
extra_nix_config: |
|
||||||
- name: Build
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
run: nix build
|
- name: Build
|
||||||
|
run: nix build
|
||||||
check-dotnet-format:
|
- name: Reproducibility check
|
||||||
runs-on: ubuntu-latest
|
run: nix build --rebuild
|
||||||
steps:
|
|
||||||
- name: Checkout
|
check-dotnet-format:
|
||||||
uses: actions/checkout@v3
|
runs-on: ubuntu-latest
|
||||||
- name: Install Nix
|
steps:
|
||||||
uses: cachix/install-nix-action@v20
|
- name: Checkout
|
||||||
with:
|
uses: actions/checkout@v5
|
||||||
extra_nix_config: |
|
- name: Install Nix
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
uses: cachix/install-nix-action@v31
|
||||||
- name: Run Fantomas
|
with:
|
||||||
run: nix run .#fantomas -- --check .
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
check-nix-format:
|
- name: Run Fantomas
|
||||||
runs-on: ubuntu-latest
|
run: nix run .#fantomas -- --check .
|
||||||
steps:
|
|
||||||
- name: Checkout
|
check-nix-format:
|
||||||
uses: actions/checkout@v3
|
runs-on: ubuntu-latest
|
||||||
- name: Install Nix
|
steps:
|
||||||
uses: cachix/install-nix-action@v20
|
- name: Checkout
|
||||||
with:
|
uses: actions/checkout@v5
|
||||||
extra_nix_config: |
|
- name: Install Nix
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
uses: cachix/install-nix-action@v31
|
||||||
- name: Run Alejandra
|
with:
|
||||||
run: nix develop --command alejandra --check .
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
linkcheck:
|
- name: Run Alejandra
|
||||||
name: Check links
|
run: nix develop --command alejandra --check .
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
linkcheck:
|
||||||
- uses: actions/checkout@master
|
name: Check links
|
||||||
- name: Install Nix
|
runs-on: ubuntu-latest
|
||||||
uses: cachix/install-nix-action@v20
|
steps:
|
||||||
with:
|
- uses: actions/checkout@master
|
||||||
extra_nix_config: |
|
- name: Install Nix
|
||||||
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
uses: cachix/install-nix-action@v31
|
||||||
- name: Run link checker
|
with:
|
||||||
run: nix develop --command markdown-link-check README.md
|
extra_nix_config: |
|
||||||
|
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
|
||||||
all-required-checks-complete:
|
- name: Run link checker
|
||||||
needs: [check-dotnet-format, check-nix-format, build, build-nix, linkcheck]
|
run: nix develop --command markdown-link-check README.md
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
all-required-checks-complete:
|
||||||
- run: echo "All required checks complete."
|
if: ${{ always() }}
|
||||||
|
needs: [check-dotnet-format, check-nix-format, build, build-nix, linkcheck]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: Smaug123/all-required-checks-complete-action@05b40a8c47ef0b175ea326e9abb09802cb67b44e
|
||||||
|
with:
|
||||||
|
needs-context: ${{ toJSON(needs) }}
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -9,3 +9,4 @@ riderModule.iml
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
result
|
result
|
||||||
.profile*
|
.profile*
|
||||||
|
.direnv/
|
||||||
|
@@ -1,29 +1,29 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<IsPackable>false</IsPackable>
|
<IsPackable>false</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="String.fs" />
|
<Compile Include="String.fs" />
|
||||||
<Compile Include="Examples.fs" />
|
<Compile Include="Examples.fs" />
|
||||||
<Compile Include="TestMonoalphabetic.fs" />
|
<Compile Include="TestMonoalphabetic.fs" />
|
||||||
<Compile Include="TestCaesar.fs" />
|
<Compile Include="TestCaesar.fs" />
|
||||||
<Compile Include="TestAffine.fs" />
|
<Compile Include="TestAffine.fs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="FsUnit" Version="5.2.0" />
|
<PackageReference Include="FsUnit" Version="5.3.0" />
|
||||||
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.6.0" />
|
||||||
<PackageReference Include="NUnit" Version="3.13.3" />
|
<PackageReference Include="NUnit" Version="3.13.3" />
|
||||||
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
|
<PackageReference Include="NUnit3TestAdapter" Version="4.4.2" />
|
||||||
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
|
<PackageReference Include="NUnit.Analyzers" Version="3.6.1" />
|
||||||
<PackageReference Include="coverlet.collector" Version="3.2.0" />
|
<PackageReference Include="coverlet.collector" Version="6.0.0" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\CipherSuite\CipherSuite.fsproj" />
|
<ProjectReference Include="..\CipherSuite\CipherSuite.fsproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net7.0</TargetFramework>
|
<TargetFramework>net8.0</TargetFramework>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
@@ -7,7 +7,7 @@
|
|||||||
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
|
<DisableImplicitNuGetFallbackFolder>true</DisableImplicitNuGetFallbackFolder>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.128" PrivateAssets="all" />
|
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133" PrivateAssets="all" />
|
||||||
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
|
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="All" />
|
||||||
<SourceLinkGitHubHost Include="github.com" ContentUrl="https://raw.githubusercontent.com" />
|
<SourceLinkGitHubHost Include="github.com" ContentUrl="https://raw.githubusercontent.com" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
30
flake.lock
generated
30
flake.lock
generated
@@ -1,12 +1,15 @@
|
|||||||
{
|
{
|
||||||
"nodes": {
|
"nodes": {
|
||||||
"flake-utils": {
|
"flake-utils": {
|
||||||
|
"inputs": {
|
||||||
|
"systems": "systems"
|
||||||
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1667395993,
|
"lastModified": 1710146030,
|
||||||
"narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=",
|
"narHash": "sha256-SZ5L6eA7HJ/nmkzGG7/ISclqe6oZdOZTNoesiInkXPQ=",
|
||||||
"owner": "numtide",
|
"owner": "numtide",
|
||||||
"repo": "flake-utils",
|
"repo": "flake-utils",
|
||||||
"rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f",
|
"rev": "b1d9ab70662946ef0850d488da1c9019f3a9752a",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -17,11 +20,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1671548329,
|
"lastModified": 1717112898,
|
||||||
"narHash": "sha256-OrC6R6zihRjFqdKFF3/vD3bkz44poONSII8ncre1Wh0=",
|
"narHash": "sha256-7R2ZvOnvd9h8fDd65p0JnB7wXfUvreox3xFdYWd1BnY=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "ba6ba2b90096dc49f448aa4d4d783b5081b1cc87",
|
"rev": "6132b0f6e344ce2fe34fc051b72fb46e34f668e0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -35,6 +38,21 @@
|
|||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"systems": {
|
||||||
|
"locked": {
|
||||||
|
"lastModified": 1681028828,
|
||||||
|
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
|
||||||
|
"type": "github"
|
||||||
|
},
|
||||||
|
"original": {
|
||||||
|
"owner": "nix-systems",
|
||||||
|
"repo": "default",
|
||||||
|
"type": "github"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"root": "root",
|
"root": "root",
|
||||||
|
39
flake.nix
39
flake.nix
@@ -7,7 +7,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
self,
|
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
...
|
...
|
||||||
@@ -17,8 +16,8 @@
|
|||||||
projectFile = "./CipherSuite/CipherSuite.fsproj";
|
projectFile = "./CipherSuite/CipherSuite.fsproj";
|
||||||
testProjectFile = "./CipherSuite.Test/CipherSuite.Test.fsproj";
|
testProjectFile = "./CipherSuite.Test/CipherSuite.Test.fsproj";
|
||||||
pname = "dotnet-cipher-suite";
|
pname = "dotnet-cipher-suite";
|
||||||
dotnet-sdk = pkgs.dotnet-sdk_7;
|
dotnet-sdk = pkgs.dotnet-sdk_8;
|
||||||
dotnet-runtime = pkgs.dotnetCorePackages.runtime_7_0;
|
dotnet-runtime = pkgs.dotnetCorePackages.runtime_8_0;
|
||||||
version = "0.1";
|
version = "0.1";
|
||||||
dotnetTool = toolName: toolVersion: sha256:
|
dotnetTool = toolName: toolVersion: sha256:
|
||||||
pkgs.stdenvNoCC.mkDerivation rec {
|
pkgs.stdenvNoCC.mkDerivation rec {
|
||||||
@@ -41,45 +40,17 @@
|
|||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
packages = {
|
packages = {
|
||||||
fantomas = dotnetTool "fantomas" "6.0.1" "sha256-TNAkurZ0NYI2Tkr99ms9MdAMLLKCQzemx5zHo/hDOTo=";
|
fantomas = dotnetTool "fantomas" (builtins.fromJSON (builtins.readFile ./.config/dotnet-tools.json)).tools.fantomas.version (builtins.head (builtins.filter (elem: elem.pname == "fantomas") ((import ./nix/deps.nix) {fetchNuGet = x: x;}))).sha256;
|
||||||
fetchDeps = let
|
|
||||||
flags = [];
|
|
||||||
runtimeIds = ["win-x64"] ++ map (system: pkgs.dotnetCorePackages.systemToDotnetRid system) dotnet-sdk.meta.platforms;
|
|
||||||
in
|
|
||||||
pkgs.writeShellScriptBin "fetch-${pname}-deps" (builtins.readFile (pkgs.substituteAll {
|
|
||||||
src = ./nix/fetchDeps.sh;
|
|
||||||
pname = pname;
|
|
||||||
binPath = pkgs.lib.makeBinPath [pkgs.coreutils dotnet-sdk (pkgs.nuget-to-nix.override {inherit dotnet-sdk;})];
|
|
||||||
projectFiles = toString (pkgs.lib.toList projectFile);
|
|
||||||
testProjectFiles = toString (pkgs.lib.toList testProjectFile);
|
|
||||||
rids = pkgs.lib.concatStringsSep "\" \"" runtimeIds;
|
|
||||||
packages = dotnet-sdk.packages;
|
|
||||||
storeSrc = pkgs.srcOnly {
|
|
||||||
src = ./.;
|
|
||||||
pname = pname;
|
|
||||||
version = version;
|
|
||||||
};
|
|
||||||
}));
|
|
||||||
default = pkgs.buildDotnetModule {
|
default = pkgs.buildDotnetModule {
|
||||||
pname = pname;
|
inherit pname version projectFile testProjectFile dotnet-sdk dotnet-runtime;
|
||||||
name = "cipher-suite";
|
name = "cipher-suite";
|
||||||
version = version;
|
|
||||||
src = ./.;
|
src = ./.;
|
||||||
projectFile = projectFile;
|
|
||||||
nugetDeps = ./nix/deps.nix;
|
nugetDeps = ./nix/deps.nix;
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
dotnet-sdk = dotnet-sdk;
|
|
||||||
dotnet-runtime = dotnet-runtime;
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
devShell = pkgs.mkShell {
|
devShell = pkgs.mkShell {
|
||||||
buildInputs = with pkgs; [
|
buildInputs = [dotnet-sdk];
|
||||||
(with dotnetCorePackages;
|
|
||||||
combinePackages [
|
|
||||||
dotnet-sdk_7
|
|
||||||
dotnetPackages.Nuget
|
|
||||||
])
|
|
||||||
];
|
|
||||||
packages = [
|
packages = [
|
||||||
pkgs.alejandra
|
pkgs.alejandra
|
||||||
pkgs.nodePackages.markdown-link-check
|
pkgs.nodePackages.markdown-link-check
|
||||||
|
109
nix/deps.nix
109
nix/deps.nix
@@ -1,20 +1,50 @@
|
|||||||
# This file was automatically generated by passthru.fetch-deps.
|
# This file was automatically generated by passthru.fetch-deps.
|
||||||
# Please don't edit it manually, your changes might get overwritten!
|
# Please dont edit it manually, your changes might get overwritten!
|
||||||
{fetchNuGet}: [
|
{fetchNuGet}: [
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "coverlet.collector";
|
pname = "coverlet.collector";
|
||||||
version = "3.2.0";
|
version = "6.0.0";
|
||||||
sha256 = "1qxpv8v10p5wn162lzdm193gdl6c5f81zadj8h889dprlnj3g8yr";
|
sha256 = "12j34vrkmph8lspbafnqmfnj2qvysz1jcrks2khw798s6dwv0j90";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "fantomas";
|
||||||
|
version = "6.3.4";
|
||||||
|
sha256 = "1bf57pzvl0i1bgic2vf08mqlzzbd5kys1ip9klrhm4f155ksm9fm";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "FSharp.Core";
|
pname = "FSharp.Core";
|
||||||
version = "7.0.0";
|
version = "8.0.300";
|
||||||
sha256 = "1pgk3qk9p1s53wvja17744x4bf7zs3a3wf0dmxi66w1w06z7i85x";
|
sha256 = "158xxr9hnhz2ibyzzp2d249angvxfc58ifflm4g3hz8qx9zxaq04";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "FsUnit";
|
pname = "FsUnit";
|
||||||
version = "5.2.0";
|
version = "5.3.0";
|
||||||
sha256 = "0l4n453slnynp8x372618yx6gjwywfai1dyl4m5iyw87d0iam7q3";
|
sha256 = "0fqjada5fysqfhqsxj9dxc849dckfn1256ra9yafx9w7npihaffa";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.AspNetCore.App.Ref";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "19pjhnx49srxp1qwknc390gapc44019wy4adz9caxpryw0ch4l1x";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.AspNetCore.App.Runtime.linux-arm64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "0i8mhcy09lmjqhzqmwvp0n5qkizdqin3vap206b2ad28yl6963wz";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.AspNetCore.App.Runtime.linux-x64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "1zypq8jgk9z3kn3mmkdijvc9h65iyy7gaif9p0vhnylmvvm89jzp";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.AspNetCore.App.Runtime.osx-arm64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "1dqilsqwwymy7fq2pnvjggn5mfvizqsisla0c36w53mg6xx7vn78";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.AspNetCore.App.Runtime.osx-x64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "1jmg7sxjnsmaa7ag6bgyhndlhvibswcmnrw0n6sr6crw2y0in2a3";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "Microsoft.Build.Tasks.Git";
|
pname = "Microsoft.Build.Tasks.Git";
|
||||||
@@ -23,13 +53,58 @@
|
|||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "Microsoft.CodeCoverage";
|
pname = "Microsoft.CodeCoverage";
|
||||||
version = "17.5.0";
|
version = "17.6.0";
|
||||||
sha256 = "0briw00gb5bz9k9kx00p6ghq47w501db7gb6ig5zzmz9hb8lw4a4";
|
sha256 = "02s98d8nwz5mg4mymcr86qdamy71a29g2091xg452czmd3s3x2di";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "Microsoft.NET.Test.Sdk";
|
pname = "Microsoft.NET.Test.Sdk";
|
||||||
version = "17.5.0";
|
version = "17.6.0";
|
||||||
sha256 = "00gz2i8kx4mlq1ywj3imvf7wc6qzh0bsnynhw06z0mgyha1a21jy";
|
sha256 = "1bnwpwg7k72z06027ip4yi222863r8sv14ck9nj8h64ckiw2r256";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Host.linux-arm64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "1dv4vk07a7kj53sk1nf63h51swzk9yl4j7jdvkc5w2v0z5a186hm";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Host.linux-x64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "0jcfmaq4ckcpywwxm1ack9xa001aic8pn85ggglidxgcfdr6mpzd";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Host.osx-arm64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "0xyc0mdd7nnmc9wjzq8nxwrqagmiqxds8qwghr2rgxw55b9slc33";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Host.osx-x64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "1srx048x6nv88s308bfn2vsg9gyqvzmgn4xlzknm9yr89c5pm96q";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Ref";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "1z9zfzccqn6yh9mcqrkiidjagzmnk4blrralzb8q0b7mnf1b1ww9";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Runtime.linux-arm64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "0m30aykrzl48i8589qn8z89hm9p1yl71cdigv1f09fmwb7c6jfm3";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Runtime.linux-x64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "12zgh8pvbdl99zs0rq5ajbl91r976i47hdrrvxl2hbsxl2ws3brs";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Runtime.osx-arm64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "08gs703rz3agmisy3vsdnyv5lyc32qb8kvfljzszbyqlaf5cxhd1";
|
||||||
|
})
|
||||||
|
(fetchNuGet {
|
||||||
|
pname = "Microsoft.NETCore.App.Runtime.osx-x64";
|
||||||
|
version = "7.0.19";
|
||||||
|
sha256 = "1lwnwxscza5m7pk83fwjz5r9kms3ybag2rl07f3gqp3b203iyyxx";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "Microsoft.NETCore.Platforms";
|
pname = "Microsoft.NETCore.Platforms";
|
||||||
@@ -48,18 +123,18 @@
|
|||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "Microsoft.TestPlatform.ObjectModel";
|
pname = "Microsoft.TestPlatform.ObjectModel";
|
||||||
version = "17.5.0";
|
version = "17.6.0";
|
||||||
sha256 = "0qkjyf3ky6xpjg5is2sdsawm99ka7fzgid2bvpglwmmawqgm8gls";
|
sha256 = "1rz22chnis11dwjrqrcvvmfw80fi2a7756a7ahwy6jlnr250zr61";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "Microsoft.TestPlatform.TestHost";
|
pname = "Microsoft.TestPlatform.TestHost";
|
||||||
version = "17.5.0";
|
version = "17.6.0";
|
||||||
sha256 = "17g0k3r5n8grba8kg4nghjyhnq9w8v0w6c2nkyyygvfh8k8x9wh3";
|
sha256 = "16vpicp4q2kbpgr3qwpsxg7srabxqszx23x6smjvvrvz7qmr5v8i";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "Nerdbank.GitVersioning";
|
pname = "Nerdbank.GitVersioning";
|
||||||
version = "3.6.128";
|
version = "3.6.133";
|
||||||
sha256 = "1ip5qlhssfhx7q6gjnx7syvwc9m1bf4ikd17z5cbn9l257465hrj";
|
sha256 = "1cdw8krvsnx0n34f7fm5hiiy7bs6h3asvncqcikc0g46l50w2j80";
|
||||||
})
|
})
|
||||||
(fetchNuGet {
|
(fetchNuGet {
|
||||||
pname = "NETStandard.Library";
|
pname = "NETStandard.Library";
|
||||||
|
@@ -1,73 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
# This file was adapted from
|
|
||||||
# https://github.com/NixOS/nixpkgs/blob/b981d811453ab84fb3ea593a9b33b960f1ab9147/pkgs/build-support/dotnet/build-dotnet-module/default.nix#L173
|
|
||||||
set -euo pipefail
|
|
||||||
export PATH="@binPath@"
|
|
||||||
for arg in "$@"; do
|
|
||||||
case "$arg" in
|
|
||||||
--keep-sources|-k)
|
|
||||||
keepSources=1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--help|-h)
|
|
||||||
echo "usage: $0 [--keep-sources] [--help] <output path>"
|
|
||||||
echo " <output path> The path to write the lockfile to. A temporary file is used if this is not set"
|
|
||||||
echo " --keep-sources Don't remove temporary directories upon exit, useful for debugging"
|
|
||||||
echo " --help Show this help message"
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
tmp=$(mktemp -td "@pname@-tmp-XXXXXX")
|
|
||||||
export tmp
|
|
||||||
HOME=$tmp/home
|
|
||||||
exitTrap() {
|
|
||||||
test -n "${ranTrap-}" && return
|
|
||||||
ranTrap=1
|
|
||||||
if test -n "${keepSources-}"; then
|
|
||||||
echo -e "Path to the source: $tmp/src\nPath to the fake home: $tmp/home"
|
|
||||||
else
|
|
||||||
rm -rf "$tmp"
|
|
||||||
fi
|
|
||||||
# Since mktemp is used this will be empty if the script didnt succesfully complete
|
|
||||||
if ! test -s "$depsFile"; then
|
|
||||||
rm -rf "$depsFile"
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
trap exitTrap EXIT INT TERM
|
|
||||||
dotnetRestore() {
|
|
||||||
local -r project="${1-}"
|
|
||||||
local -r rid="$2"
|
|
||||||
dotnet restore "${project-}" \
|
|
||||||
-p:ContinuousIntegrationBuild=true \
|
|
||||||
-p:Deterministic=true \
|
|
||||||
--packages "$tmp/nuget_pkgs" \
|
|
||||||
--runtime "$rid" \
|
|
||||||
--no-cache \
|
|
||||||
--force
|
|
||||||
}
|
|
||||||
declare -a projectFiles=( @projectFiles@ )
|
|
||||||
declare -a testProjectFiles=( @testProjectFiles@ )
|
|
||||||
export DOTNET_NOLOGO=1
|
|
||||||
export DOTNET_CLI_TELEMETRY_OPTOUT=1
|
|
||||||
depsFile=$(realpath "${1:-$(mktemp -t "@pname@-deps-XXXXXX.nix")}")
|
|
||||||
mkdir -p "$tmp/nuget_pkgs"
|
|
||||||
storeSrc="@storeSrc@"
|
|
||||||
src="$tmp/src"
|
|
||||||
cp -rT "$storeSrc" "$src"
|
|
||||||
chmod -R +w "$src"
|
|
||||||
cd "$src"
|
|
||||||
echo "Restoring project..."
|
|
||||||
rids=("@rids@")
|
|
||||||
for rid in "${rids[@]}"; do
|
|
||||||
(( ${#projectFiles[@]} == 0 )) && dotnetRestore "" "$rid"
|
|
||||||
for project in "${projectFiles[@]-}" "${testProjectFiles[@]-}"; do
|
|
||||||
dotnetRestore "$project" "$rid"
|
|
||||||
done
|
|
||||||
done
|
|
||||||
echo "Successfully restored project"
|
|
||||||
echo "Writing lockfile..."
|
|
||||||
echo -e "# This file was automatically generated by passthru.fetch-deps.\n# Please don't edit it manually, your changes might get overwritten!\n" > "$depsFile"
|
|
||||||
nuget-to-nix "$tmp/nuget_pkgs" "@packages@" >> "$depsFile"
|
|
||||||
echo "Successfully wrote lockfile to $depsFile"
|
|
Reference in New Issue
Block a user