Skip to content

Commit

Permalink
chore: Add src, test, tools folder to solution
Browse files Browse the repository at this point in the history
  • Loading branch information
s2quake committed Jun 18, 2024
1 parent 645dd31 commit dc5cdf0
Show file tree
Hide file tree
Showing 15 changed files with 141 additions and 90 deletions.
12 changes: 8 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ commands:
steps:
- checkout
- concat_files:
glob: "*/*.csproj"
glob: "{src,test,tools}/*/*.csproj"
to: .combined-package-files.txt
- restore_cache:
keys:
Expand Down Expand Up @@ -105,14 +105,18 @@ commands:
root: .
paths:
- <<parameters.collect_tests_to>>
- "*/bin/"
- "*/obj/"
- "src/*/bin/"
- "src/*/obj/"
- "test/*/bin/"
- "test/*/obj/"
- "tools/*/bin/"
- "tools/*/obj/"

mono_build_base:
steps:
- checkout
- concat_files:
glob: "*/*.csproj"
glob: "{src,test,tools}/*/*.csproj"
to: .combined-package-files.txt
- restore_cache:
keys:
Expand Down
40 changes: 20 additions & 20 deletions .github/bin/constants.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
# shellcheck disable=SC2034
solution="Libplanet"
projects=(
"Libplanet"
"Libplanet.Action"
"Libplanet.Common"
"Libplanet.Crypto"
"Libplanet.Crypto.Secp256k1"
"Libplanet.Mocks"
"Libplanet.Net"
"Libplanet.Store"
"Libplanet.Store.Remote"
"Libplanet.Stun"
"Libplanet.Types"
"Libplanet.RocksDBStore"
"Libplanet.Analyzers"
"Libplanet.Tools"
"Libplanet.Explorer"
"Libplanet.Explorer.Executable"
"Libplanet.Explorer.Cocona"
"Libplanet.Extensions.Cocona"
"src/Libplanet"
"src/Libplanet.Action"
"src/Libplanet.Common"
"src/Libplanet.Crypto"
"src/Libplanet.Crypto.Secp256k1"
"src/Libplanet.Net"
"src/Libplanet.Store"
"src/Libplanet.Store.Remote"
"src/Libplanet.Stun"
"src/Libplanet.Types"
"src/Libplanet.RocksDBStore"
"test/Libplanet.Mocks"
"tools/Libplanet.Analyzers"
"tools/Libplanet.Tools"
"tools/Libplanet.Explorer"
"tools/Libplanet.Explorer.Executable"
"tools/Libplanet.Explorer.Cocona"
"tools/Libplanet.Extensions.Cocona"
)
configuration=Release
executables=(
"Libplanet.Tools"
"Libplanet.Explorer.Executable"
"tools/Libplanet.Tools"
"tools/Libplanet.Explorer.Executable"
)
npm_packages=(
"@planetarium/cli"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
dotnet-version: 6.0.x
- name: Run benchmark
run: dotnet run --project Libplanet.Benchmarks -c Release -- --exporters json --filter '*'
run: dotnet run --project tools/Libplanet.Benchmarks -c Release -- --exporters json --filter '*'

- name: Compare benchmark result
uses: planetarium/github-action-benchmark@v1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/yarn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,15 @@ jobs:
- if: runner.os != 'Windows'
run: |
set -ev
cd Libplanet.Tools/
cd tools/Libplanet.Tools/
bin/npm-test.sh "$LATEST_VERSION"
env:
LATEST_VERSION: ${{ steps.latest-tag.outputs.tag }}
- if: runner.os == 'Windows'
shell: pwsh
run: |
$ErrorActionPreference = "Stop"
cd Libplanet.Tools\
cd tools\Libplanet.Tools\
pwsh `
-ExecutionPolicy Bypass `
-File bin\npm-test.ps1 `
Expand Down
2 changes: 1 addition & 1 deletion @planetarium/cli
4 changes: 2 additions & 2 deletions @planetarium/tx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
"scripts": {
"build": "yarn && nanobundle build",
"prepack": "yarn && yarn build",
"dev": "yarn && dotnet build ../../Libplanet.Tools && vitest",
"test": "yarn && yarn run -T tsc -p tsconfig.json && dotnet build ../../Libplanet.Tools && vitest run",
"dev": "yarn && dotnet build ../../tools/Libplanet.Tools && vitest",
"test": "yarn && yarn run -T tsc -p tsconfig.json && dotnet build ../../tools/Libplanet.Tools && vitest run",
"coverage": "yarn && vitest run --coverage"
},
"repository": {
Expand Down
24 changes: 12 additions & 12 deletions @planetarium/tx/test/tx/signed.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { encodeSignedTx, signTx } from "../../src/tx/signed";
import { type UnsignedTx } from "../../src/tx/unsigned";
import { account1, address1 } from "./fixtures";
import { join } from "node:path";
import { RecordView, encode } from "@planetarium/bencodex";
import { execa } from "execa";
import { join } from "node:path";
import { describe, expect, test } from "vitest";
import { encodeSignedTx, signTx } from "../../src/tx/signed";
import { type UnsignedTx } from "../../src/tx/unsigned";
import { account1, address1 } from "./fixtures";

describe("signTx", () => {
test("UnsignedTx", async () => {
Expand All @@ -30,28 +30,28 @@ describe("signTx", () => {
minters: [
Buffer.from(
"47d082a115c63e7b58b1532d20e631538eafadde",
"hex",
"hex"
),
],
ticker: "NCG",
},
"text",
"text"
),
1000n,
],
recipient: Buffer.from(
"5a533067D0cBa77490268b26195EdB10B990143D",
"hex",
"hex"
),
sender: Buffer.from(
"111CB8E18c6D70f5032000c5739c5ac36E793EDB",
"hex",
"hex"
),
},
"text",
"text"
),
},
"text",
"text"
),
],
};
Expand All @@ -64,13 +64,13 @@ describe("signTx", () => {
"run",
"--no-build",
"--project",
join(__dirname, "..", "..", "..", "..", "Libplanet.Tools"),
join(__dirname, "..", "..", "..", "..", "tools", "Libplanet.Tools"),
"--",
"tx",
"analyze",
"-",
],
{ input: payload },
{ input: payload }
);
expect(JSON.parse(stdout)).toStrictEqual({
id: "49a645bb80fa96757009615ec33bc15a2e90e9121877de9f14de35b7d657a118",
Expand Down
22 changes: 11 additions & 11 deletions @planetarium/tx/test/tx/unsigned.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { encodeUnsignedTx } from "../../src/tx/unsigned";
import { key1 } from "./fixtures";
import { join } from "node:path";
import { RecordView, encode } from "@planetarium/bencodex";
import { execa } from "execa";
import { join } from "node:path";
import { expect, test } from "vitest";
import { encodeUnsignedTx } from "../../src/tx/unsigned";
import { key1 } from "./fixtures";

test("encodeUnsignedTx", async () => {
const encoded = encodeUnsignedTx({
Expand All @@ -28,25 +28,25 @@ test("encodeUnsignedTx", async () => {
new Uint8Array(
Buffer.from(
"47d082a115c63e7b58b1532d20e631538eafadde",
"hex",
),
"hex"
)
),
],
ticker: "NCG",
},
"text",
"text"
),
1000n,
],
recipient: new Uint8Array(
Buffer.from("5a533067D0cBa77490268b26195EdB10B990143D", "hex"),
Buffer.from("5a533067D0cBa77490268b26195EdB10B990143D", "hex")
),
sender: new Uint8Array(
Buffer.from("111CB8E18c6D70f5032000c5739c5ac36E793EDB", "hex"),
Buffer.from("111CB8E18c6D70f5032000c5739c5ac36E793EDB", "hex")
),
},
},
"text",
"text"
),
],
});
Expand All @@ -57,7 +57,7 @@ test("encodeUnsignedTx", async () => {
"run",
"--no-build",
"--project",
join(__dirname, "..", "..", "..", "..", "Libplanet.Tools"),
join(__dirname, "..", "..", "..", "..", "tools", "Libplanet.Tools"),
"--",
"tx",
"analyze",
Expand All @@ -66,7 +66,7 @@ test("encodeUnsignedTx", async () => {
],
{
input: Buffer.from(payload),
},
}
);
expect(JSON.parse(stdout)).toStrictEqual({
nonce: 123,
Expand Down
35 changes: 17 additions & 18 deletions Docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
"src": [
{
"files": [
"Libplanet/Libplanet.csproj",
"Libplanet.Action/Libplanet.Action.csproj",
"Libplanet.Common/Libplanet.Common.csproj",
"Libplanet.Crypto/Libplanet.Crypto.csproj",
"Libplanet.Crypto.Secp256k1/Libplanet.Crypto.Secp256k1.csproj",
"Libplanet.Explorer.Cocona/Libplanet.Explorer.Cocona.csproj",
"Libplanet.Extensions.Cocona/Libplanet.Extensions.Cocona.csproj",
"Libplanet.Mocks/Libplanet.Mocks.csproj",
"Libplanet.Net/Libplanet.Net.csproj",
"Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj",
"Libplanet.Store/Libplanet.Store.csproj",
"Libplanet.Store.Remote/Libplanet.Store.Remote.csproj",
"Libplanet.Stun/Libplanet.Stun.csproj",
"Libplanet.Types/Libplanet.Types.csproj"
"src/Libplanet/Libplanet.csproj",
"src/Libplanet.Action/Libplanet.Action.csproj",
"src/Libplanet.Common/Libplanet.Common.csproj",
"src/Libplanet.Crypto/Libplanet.Crypto.csproj",
"src/Libplanet.Crypto.Secp256k1/Libplanet.Crypto.Secp256k1.csproj",
"tools/Libplanet.Explorer.Cocona/Libplanet.Explorer.Cocona.csproj",
"tools/Libplanet.Extensions.Cocona/Libplanet.Extensions.Cocona.csproj",
"test/Libplanet.Mocks/Libplanet.Mocks.csproj",
"src/Libplanet.Net/Libplanet.Net.csproj",
"src/Libplanet.RocksDBStore/Libplanet.RocksDBStore.csproj",
"src/Libplanet.Store/Libplanet.Store.csproj",
"src/Libplanet.Store.Remote/Libplanet.Store.Remote.csproj",
"src/Libplanet.Stun/Libplanet.Stun.csproj",
"src/Libplanet.Types/Libplanet.Types.csproj"
],
"exclude": ["**/bin/**", "**/obj/**"],
"src": "../"
Expand Down Expand Up @@ -48,22 +48,22 @@
]
},
{
"src": "../Libplanet.Analyzers",
"src": "../tools/Libplanet.Analyzers",
"dest": "analyzer",
"files": [
"*.md",
"rules/*.md"
]
},
{
"src": "../Libplanet.Tools",
"src": "../tools/Libplanet.Tools",
"dest": "cli",
"files": [
"*.md"
]
},
{
"src": "../Libplanet.Explorer",
"src": "../tools/Libplanet.Explorer",
"dest": "explorer",
"files": [
"*.md"
Expand Down Expand Up @@ -111,7 +111,6 @@
"fileMetadataFiles": [],

"template": ["default"],
// "statictoc" has a bug that relative links with nested dirs in nav refer to incorrect destinations

"theme": ["theme"],
"postProcessors": [],
Expand Down
44 changes: 41 additions & 3 deletions Libplanet.sln
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Crypto", "src\Lib
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Types", "src\Libplanet.Types\Libplanet.Types.csproj", "{C7EFF544-391C-488F-A747-2663AFEED250}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Libplanet.Store.Remote", "src\Libplanet.Store.Remote\Libplanet.Store.Remote.csproj", "{CF31204A-12CF-43C0-9054-B9AF98EC83BD}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Store.Remote", "src\Libplanet.Store.Remote\Libplanet.Store.Remote.csproj", "{CF31204A-12CF-43C0-9054-B9AF98EC83BD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Libplanet.Store.Remote.Tests", "test\Libplanet.Store.Remote.Tests\Libplanet.Store.Remote.Tests.csproj", "{97F29346-636E-4BCA-B33D-6D0DB26A5AA6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Store.Remote.Tests", "test\Libplanet.Store.Remote.Tests\Libplanet.Store.Remote.Tests.csproj", "{97F29346-636E-4BCA-B33D-6D0DB26A5AA6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Libplanet.Mocks", "test\Libplanet.Mocks\Libplanet.Mocks.csproj", "{46C1A70D-D1DE-4173-A8C0-00F680F026E3}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Libplanet.Mocks", "test\Libplanet.Mocks\Libplanet.Mocks.csproj", "{46C1A70D-D1DE-4173-A8C0-00F680F026E3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{AC908E33-B856-4E23-9F81-B7F7C97A07F9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{B9C00FAF-36CF-463A-83FA-43E6B974AE2E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tools", "tools", "{88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -611,6 +617,38 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{4F5DB8F5-D0F4-454C-95A7-87F53E5D5E36} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{5C2B23E2-C286-412D-ADE1-F6796B7083DE} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{50E14C9A-3C2F-4A51-971F-6143952D0F1C} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{3BA7D9BE-EBBF-432E-9880-0E2D2C17FCF8} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{E010FB5E-0D68-4AF7-B632-5DB6B902F158} = {88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}
{A5DE942D-912D-4012-8493-1E958E5445F4} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{ADCBBAC0-0A87-45B7-BD31-314F136F74D4} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{A216C2F0-A9A6-4D7F-BF65-127EB80EA6A7} = {88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}
{5CEE1B93-3936-4E32-A414-522DCDCA26BB} = {88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}
{B48782B9-6FA9-4D18-8564-1849FF4CF40E} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{B41C8F1C-5BD2-43B9-A3CC-FC03DFE04E23} = {88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}
{BEDBC0F8-AD0A-44C3-9A53-C8EC4E631AF4} = {88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}
{48A7AC8E-2CB5-403B-8A18-11F493079619} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{B3170309-55AB-462C-9100-D77107799E82} = {88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}
{A43E44E5-F9C1-44BD-A593-419EC113117B} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{2E17A091-DC29-41FB-ABC8-767BD75FFB07} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{6D7A63C9-16AB-4B7E-B9C0-0956E1E02610} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{9F88C871-CB37-4A88-BACF-540AC253C202} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{B1A38DDE-5534-4625-A3F2-A585BA7A1198} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{8698E0C2-1A82-43E6-8A26-3D9A825CF574} = {88E7FAF4-CEEC-48B6-9114-71CFE3FC0F50}
{F782BC86-9CE6-4F69-8F77-710A399CB54F} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{763BAD3E-3244-4E8F-8182-2BF35774262A} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{2BC01C4C-288B-4768-BAD0-9BC441D82505} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{DDD598B2-005F-4CB2-B26B-A40CC0F9DE8E} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{5B2BF317-7315-431F-A854-488CD541F42E} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{896946A7-35AB-40D0-972C-CED7A448B97A} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{C7EFF544-391C-488F-A747-2663AFEED250} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{CF31204A-12CF-43C0-9054-B9AF98EC83BD} = {AC908E33-B856-4E23-9F81-B7F7C97A07F9}
{97F29346-636E-4BCA-B33D-6D0DB26A5AA6} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
{46C1A70D-D1DE-4173-A8C0-00F680F026E3} = {B9C00FAF-36CF-463A-83FA-43E6B974AE2E}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DB552D2A-94E1-4A1C-9F3E-E0097C6158CD}
EndGlobalSection
Expand Down
Loading

0 comments on commit dc5cdf0

Please sign in to comment.