Skip to content

Commit

Permalink
Merge pull request #2988 from moreal/remove-libplanet-submodule
Browse files Browse the repository at this point in the history
Remove libplanet submodule
  • Loading branch information
moreal authored Nov 7, 2024
2 parents 020a494 + e51e19f commit 9b29c18
Show file tree
Hide file tree
Showing 22 changed files with 130 additions and 130 deletions.
18 changes: 14 additions & 4 deletions .Lib9c.Benchmarks/Lib9c.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,24 @@
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
</ItemGroup>

<ItemGroup Condition="!'$(UseLocalLibplanet)'">
<PackageReference Include="Libplanet" Version="$(LibplanetVersion)" />
<PackageReference Include="Libplanet.RocksDBStore" Version="$(LibplanetVersion)" />
<PackageReference Include="Libplanet.Crypto.Secp256k1" Version="$(LibplanetVersion)" />
<PackageReference Include="Libplanet.Mocks" Version="$(LibplanetVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalLibplanet)'">
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet.Crypto.Secp256k1\Libplanet.Crypto.Secp256k1.csproj" />
<ProjectReference Include="$(LibplanetDirectory)\test\Libplanet.Mocks\Libplanet.Mocks.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\.Lib9c.Tests\Lib9c.Tests.csproj" />
<ProjectReference Include="..\.Libplanet\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
<ProjectReference Include="..\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\Lib9c.csproj" />
<ProjectReference Include="..\Lib9c.Policy\Lib9c.Policy.csproj" />
<ProjectReference Include="..\Libplanet.Crypto.Secp256k1\Libplanet.Crypto.Secp256k1.csproj" />
<ProjectReference Include="..\.Libplanet\test\Libplanet.Mocks\Libplanet.Mocks.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 8 additions & 1 deletion .Lib9c.Tests/Lib9c.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,14 @@
<ProjectReference Include="..\Lib9c\Lib9c.csproj" />
<ProjectReference Include="..\Lib9c.Utils\Lib9c.Utils.csproj" />
<ProjectReference Include="..\Lib9c.MessagePack\Lib9c.MessagePack.csproj" />
<ProjectReference Include="..\.Libplanet\test\Libplanet.Mocks\Libplanet.Mocks.csproj" />
</ItemGroup>

<ItemGroup Condition="!'$(UseLocalLibplanet)'">
<PackageReference Include="Libplanet.Mocks" Version="$(LibplanetVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalLibplanet)'">
<ProjectReference Include="$(LibplanetDirectory)\test\Libplanet.Mocks\Libplanet.Mocks.csproj" />
</ItemGroup>

<ItemGroup Condition=" '$(Configuration)' != 'DevEx' ">
Expand Down
9 changes: 8 additions & 1 deletion .Lib9c.Tools/Lib9c.Tools.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,18 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\.Libplanet\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
<ProjectReference Include="..\Lib9c\Lib9c.csproj" />
<ProjectReference Include="..\Lib9c.DevExtensions\Lib9c.DevExtensions.csproj" />
</ItemGroup>

<ItemGroup Condition="!'$(UseLocalLibplanet)'">
<PackageReference Include="Libplanet.RocksDBStore" Version="$(LibplanetVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalLibplanet)'">
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Cocona.Lite" Version="1.5.0" />
<PackageReference Include="Serilog" Version="2.10.0" />
Expand Down
1 change: 0 additions & 1 deletion .Libplanet
Submodule .Libplanet deleted from 46cff6
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,12 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ItemGroup Condition="!'$(UseLocalLibplanet)'">
<PackageReference Include="Libplanet" Version="$(LibplanetVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalLibplanet)'">
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet\Libplanet.csproj" />
</ItemGroup>

</Project>
2 changes: 0 additions & 2 deletions .github/workflows/lib9c_plugin_build_and_push_s3.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.400
Expand Down
19 changes: 19 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,22 @@ jobs:
- uses: actions/checkout@v4
- name: Check typos
uses: crate-ci/[email protected]

local-libplanet:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check LibplanetDirectory is empty
run: grep -q '<LibplanetDirectory></LibplanetDirectory>' Directory.Build.props

no-submodules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check if there is submodule
run: |
set -ev
count=$(git submodule status | wc -l)
if [ "$count" -gt 0 ]; then
exit 1
fi
9 changes: 0 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Check if .Libplanet refers to a tagged commit
if: |
github.event_name == 'push' && (
Expand Down Expand Up @@ -58,8 +56,6 @@ jobs:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.400
Expand All @@ -68,7 +64,6 @@ jobs:
set -e
sed -i -E 's|<TargetFramework>.*</TargetFramework>|<TargetFramework>netstandard2.1</TargetFramework>|' Lib9c*/*.csproj
sed -i -E 's|(<TargetFramework.+>).*(</TargetFramework>)|\1netstandard2.1\2|' .Libplanet/Directory.Build.props
sed -i -E 's|<ImplicitUsings>.*</ImplicitUsings>|<ImplicitUsings>disable</ImplicitUsings>|' Lib9c*/*.csproj Libplanet*/*.csproj
sed -i -E 's|\[MaybeNullWhen\(false\)] out TValue value|out TValue value|' Lib9c/TableData/Sheet.cs
sed -i -E 's|public bool TryGetValue\(TKey key, out TValue value, bool throwException\)|public bool TryGetValue\(TKey key, out TValue? value, bool throwException\)|' Lib9c/TableData/Sheet.cs
Expand All @@ -79,8 +74,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'
- name: Setup .NET Core
uses: actions/setup-dotnet@v3
with:
Expand All @@ -105,8 +98,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Check if a new tag refers a merge commit
if: github.ref_type == 'tag'
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
fetch-tags: true
- name: Dotnet Setup
uses: actions/setup-dotnet@v4
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.400
Expand Down
4 changes: 0 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Git Sumbodule Update
run: git submodule update --init --recursive
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule ".Libplanet"]
path = .Libplanet
url = https://github.com/planetarium/libplanet.git
6 changes: 6 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,3 +111,9 @@ This branch naming rule is not forced but highly recommended to recognize which
- date (e.g., YYYYMMDD)
- revision (e.g., some digits)
- related base version (e.g., v200210)

### Work with your local [Libplanet]

If you want to work with your local [Libplanet], you can fill `LibplanetDirectory` property in `Directory.Build.props` file.

When making a pull request, please do not include the `LibplanetDirectory` change.
18 changes: 18 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Project>
<PropertyGroup>
<LibplanetVersion>5.3.2-alpha.1</LibplanetVersion>

<!-- Fill with Libplanet's absolute path to debug with local Libplanet.
Example: $(MSBuildThisFileDirectory).Libplanet -->
<LibplanetDirectory></LibplanetDirectory>
</PropertyGroup>

<PropertyGroup>
<UseLocalLibplanet Condition="Exists('$(LibplanetDirectory)')">true</UseLocalLibplanet>
<UseLocalLibplanet Condition=" '$(UseLocalLibplanet)' == '' ">false</UseLocalLibplanet>
</PropertyGroup>

<Target Name="NoticeBuildingWithLocalLibplanet" BeforeTargets="BeforeBuild;BeforeRebuild">
<Message Importance="high" Text="Libplanet is being used as the local repository." Condition="$(UseLocalLibplanet)" />
</Target>
</Project>
8 changes: 6 additions & 2 deletions Lib9c.Abstractions/Lib9c.Abstractions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
<VersionPrefix>1.19.0</VersionPrefix>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ItemGroup Condition="!'$(UseLocalLibplanet)'">
<PackageReference Include="Libplanet" Version="$(LibplanetVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalLibplanet)'">
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet\Libplanet.csproj" />
</ItemGroup>

</Project>
15 changes: 12 additions & 3 deletions Lib9c.DevExtensions/Lib9c.DevExtensions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,22 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\.Libplanet\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
<ProjectReference Include="..\.Libplanet\src\Libplanet.Stun\Libplanet.Stun.csproj" />
<ProjectReference Include="..\.Libplanet\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="..\Lib9c\Lib9c.csproj" />
<ProjectReference Include="..\Lib9c.Policy\Lib9c.Policy.csproj" />
</ItemGroup>

<ItemGroup Condition="!'$(UseLocalLibplanet)'">
<PackageReference Include="Libplanet" Version="$(LibplanetVersion)" />
<PackageReference Include="Libplanet.Stun" Version="$(LibplanetVersion)" />
<PackageReference Include="Libplanet.RocksDBStore" Version="$(LibplanetVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalLibplanet)'">
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet\Libplanet.csproj" />
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet.Stun\Libplanet.Stun.csproj" />
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet.RocksDBStore\Libplanet.RocksDBStore.csproj" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Cocona.Core" Version="1.5.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
Expand Down
8 changes: 7 additions & 1 deletion Lib9c.Proposer/Lib9c.Proposer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@

<ItemGroup>
<ProjectReference Include="..\Lib9c\Lib9c.csproj" />
<ProjectReference Include="..\.Libplanet\src\Libplanet.Net\Libplanet.Net.csproj" />
</ItemGroup>

<ItemGroup Condition="!'$(UseLocalLibplanet)'">
<PackageReference Include="Libplanet.Net" Version="$(LibplanetVersion)" />
</ItemGroup>

<ItemGroup Condition="'$(UseLocalLibplanet)'">
<ProjectReference Include="$(LibplanetDirectory)\src\Libplanet.Net\Libplanet.Net.csproj" />
</ItemGroup>
</Project>
Loading

0 comments on commit 9b29c18

Please sign in to comment.