From 9766abe367f5b817f88afff6cd4b3b317755a8e8 Mon Sep 17 00:00:00 2001 From: Ryan Butler Date: Sat, 8 Feb 2025 15:08:53 -0500 Subject: [PATCH] build(BouncyCastle): initial commit --- .github/workflows/csharp.yaml | 2 +- justfile | 12 +++++-- msbuild/Base128/justfile | 1 - .../BouncyCastle.Cryptography.dll.meta | 2 ++ msbuild/BouncyCastle/justfile | 32 +++++++++++++++++++ msbuild/BouncyCastle/package.json | 9 ++++++ msbuild/BouncyCastle/package.json.meta | 7 ++++ msbuild/SimpleBase/justfile | 1 - 8 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 msbuild/BouncyCastle/BouncyCastle.Cryptography.dll.meta create mode 100644 msbuild/BouncyCastle/justfile create mode 100644 msbuild/BouncyCastle/package.json create mode 100644 msbuild/BouncyCastle/package.json.meta diff --git a/.github/workflows/csharp.yaml b/.github/workflows/csharp.yaml index 7cdc332..5015b37 100644 --- a/.github/workflows/csharp.yaml +++ b/.github/workflows/csharp.yaml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: cachix/install-nix-action@v30 - name: Build UPM packages - run: nix develop -c just + run: nix develop -c just all - name: Upload artifacts uses: actions/upload-artifact@v4.4.0 with: diff --git a/justfile b/justfile index 49fe3a8..b117bbb 100644 --- a/justfile +++ b/justfile @@ -1,5 +1,13 @@ -default: all +default: + just --list -all: +all: base128 simplebase bouncycastle + +base128: just msbuild/Base128/ + +bouncycastle: + just msbuild/BouncyCastle/ + +simplebase: just msbuild/SimpleBase/ diff --git a/msbuild/Base128/justfile b/msbuild/Base128/justfile index 622393a..e35d522 100644 --- a/msbuild/Base128/justfile +++ b/msbuild/Base128/justfile @@ -1,7 +1,6 @@ git_repo := "https://github.com/Wojmik/Base128.git" git_ref := "Version_1.2.2" dll_name := "Base128.dll" -lib_name := "Base128" dotnet_framework := "netstandard2.1" csproj_relative_path := "Base128" / "Base128.csproj" out_dir := invocation_directory() / "build" diff --git a/msbuild/BouncyCastle/BouncyCastle.Cryptography.dll.meta b/msbuild/BouncyCastle/BouncyCastle.Cryptography.dll.meta new file mode 100644 index 0000000..fb08bdb --- /dev/null +++ b/msbuild/BouncyCastle/BouncyCastle.Cryptography.dll.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 28f5c36add9864ec18ac541eeccd17b2 \ No newline at end of file diff --git a/msbuild/BouncyCastle/justfile b/msbuild/BouncyCastle/justfile new file mode 100644 index 0000000..e010bc5 --- /dev/null +++ b/msbuild/BouncyCastle/justfile @@ -0,0 +1,32 @@ +git_repo := "https://github.com/bcgit/bc-csharp.git" +git_ref := "release-2.5.0" +dll_name := "BouncyCastle.Cryptography.dll" +dotnet_framework := "netstandard2.0" +csproj_relative_path := "crypto" / "src" / "BouncyCastle.Crypto.csproj" +out_dir := invocation_directory() / "build" + +working_dir := `mktemp -d` +repo_dir := working_dir / "repo" +dotnet_artifact_dir := working_dir / "dotnet_artifacts" +upm_contents_dir := working_dir / "upm_contents" +csproj_path := repo_dir / csproj_relative_path + +default: assemble_upm + +# Clean build outputs +clean: + rm -rf {{working_dir}} + +clone: + git clone --single-branch --branch {{git_ref}} {{git_repo}} {{repo_dir}} + +build: clone + dotnet build {{csproj_path}} --configuration Release -o {{dotnet_artifact_dir}} --framework {{dotnet_framework}} + +assemble_upm: clone build && clean + mkdir -p {{upm_contents_dir}} + cp {{dotnet_artifact_dir / dll_name}} {{upm_contents_dir}} + cp package.json {{upm_contents_dir}} + cp *.meta {{upm_contents_dir}} + mkdir -p {{out_dir}} + npm pack --pack-destination {{out_dir}} {{upm_contents_dir}} diff --git a/msbuild/BouncyCastle/package.json b/msbuild/BouncyCastle/package.json new file mode 100644 index 0000000..dd47575 --- /dev/null +++ b/msbuild/BouncyCastle/package.json @@ -0,0 +1,9 @@ +{ + "name": "org.basisvr.bouncycastle", + "version": "2.5.0", + "displayName": "BouncyCastle.Cryptography", + "description": "The Bouncy Castle Cryptography library", + "documentationUrl": "https://github.com/bcgit/bc-csharp", + "publishConfig": { "registry": "https://npm.pkg.github.com/@BasisVR" }, + "repository":"https://github.com/BasisVR/UpmBuilds" +} diff --git a/msbuild/BouncyCastle/package.json.meta b/msbuild/BouncyCastle/package.json.meta new file mode 100644 index 0000000..449b80a --- /dev/null +++ b/msbuild/BouncyCastle/package.json.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 9980c89aa539846a4aa60940ade1596a +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/msbuild/SimpleBase/justfile b/msbuild/SimpleBase/justfile index 830c37d..eb03470 100644 --- a/msbuild/SimpleBase/justfile +++ b/msbuild/SimpleBase/justfile @@ -1,7 +1,6 @@ git_repo := "https://github.com/ssg/SimpleBase.git" git_ref := "4.0.2" dll_name := "SimpleBase.dll" -lib_name := "SimpleBase" dotnet_framework := "netstandard2.1" csproj_relative_path := "src" / "SimpleBase.csproj" out_dir := invocation_directory() / "build"