Skip to content

Commit

Permalink
Monorepo restructure (#828)
Browse files Browse the repository at this point in the history
Restructuring files to bring some stuff (e.g. Directory.Build.props) out
of the repo root and consolidate it within individual component folders

Add README to each component
  • Loading branch information
SapiensAnatis authored May 22, 2024
1 parent c83530a commit 874966b
Show file tree
Hide file tree
Showing 31 changed files with 373 additions and 187 deletions.
2 changes: 1 addition & 1 deletion .csharpierignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
DragaliaAPI/DragaliaAPI.Database/Migrations/*
DragaliaAPI/DragaliaAPI.Database/Migrations/*
3 changes: 0 additions & 3 deletions .csharpierrc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ updates:
patterns:
- "Microsoft.EntityFrameworkCore*"
- package-ecosystem: "docker"
directory: "/DragaliaAPI/DragaliaAPI"
directory: "/DragaliaAPI"
schedule:
interval: "weekly"
- package-ecosystem: "docker"
directory: "/PhotonStateManager/DragaliaAPI.Photon.StateManager"
directory: "/PhotonStateManager"
schedule:
interval: "weekly"
25 changes: 0 additions & 25 deletions .github/workflows/missiondesigner.yaml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/publish-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
paths:
- DragaliaAPI/**
- Shared/**
- Directory.Build.props
- Directory.Packages.props

env:
Expand All @@ -19,7 +18,7 @@ jobs:
uses: ./.github/workflows/build.yaml
with:
ref: main
dockerfile: "DragaliaAPI/DragaliaAPI/Dockerfile"
dockerfile: "DragaliaAPI/Dockerfile"
image-name: "dragalia-api"
secrets: inherit
deploy:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/publish-statemanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ on:
paths:
- PhotonStateManager/**
- Shared/**
- Directory.Build.props
- Directory.Packages.props

env:
Expand All @@ -19,7 +18,7 @@ jobs:
uses: ./.github/workflows/build.yaml
with:
ref: main
dockerfile: "PhotonStateManager/DragaliaAPI.Photon.StateManager/Dockerfile"
dockerfile: "PhotonStateManager/Dockerfile"
image-name: "photon-state-manager"
secrets: inherit
deploy:
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ on:
paths:
- DragaliaAPI/**
- Shared/**
- Directory.Build.props
- Directory.Packages.props

jobs:
Expand All @@ -32,11 +31,11 @@ jobs:
"DragaliaAPI/DragaliaAPI.Test",
"DragaliaAPI/DragaliaAPI.Database.Test",
"DragaliaAPI/DragaliaAPI.Shared.Test",
"DragaliaAPI/DragaliaAPI.Shared.SourceGenerator.Test"
"DragaliaAPI/DragaliaAPI.Shared.SourceGenerator.Test",
]
uses: ./.github/workflows/test.yaml
with:
project: ${{ matrix.project }}
before-test: |
dotnet restore DragaliaAPI/DragaliaAPI.MissionDesigner/DragaliaAPI.MissionDesigner.csproj
dotnet restore DragaliaAPI/DragaliaAPI.MasterAssetConverter/DragaliaAPI.MasterAssetConverter.csproj
dotnet restore DragaliaAPI/DragaliaAPI.MasterAssetConverter/DragaliaAPI.MasterAssetConverter.csproj
14 changes: 0 additions & 14 deletions Directory.Build.props

This file was deleted.

2 changes: 0 additions & 2 deletions Directory.Build.targets

This file was deleted.

1 change: 0 additions & 1 deletion Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<PackageVersion Include="Hangfire.Core" Version="1.8.12"/>
<PackageVersion Include="Hangfire.Postgresql" Version="1.20.8"/>
<PackageVersion Include="JetBrains.Annotations" Version="2023.3.0"/>
<PackageVersion Include="MemoryPack" Version="1.20.5"/>
<PackageVersion Include="MessagePack" Version="2.5.140"/>
<PackageVersion Include="MessagePack.AspNetCoreMvcFormatter" Version="2.5.140"/>
<PackageVersion Include="MessagePackAnalyzer" Version="2.5.140"/>
Expand Down
29 changes: 16 additions & 13 deletions DragaliaAPI.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI", "DragaliaAPI\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Test", "DragaliaAPI\DragaliaAPI.Test\DragaliaAPI.Test.csproj", "{A1E6C76A-4D4F-427D-80AF-CF289CBBAF00}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{6E4BCC4D-1998-4135-A474-681EC6E6AF57}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BC72B633-A158-4169-9B47-3CB9C689A57E}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.env = .env
.env.default = .env.default
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
.config\dotnet-tools.json = .config\dotnet-tools.json
global.json = global.json
Expand All @@ -33,18 +28,17 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Database.Test",
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".github", ".github", "{1A23D473-87C4-40FB-8DF0-43F4B0FE7414}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build-manual.yaml = .github\workflows\build-manual.yaml
.github\workflows\build.yaml = .github\workflows\build.yaml
.github\workflows\deploy.yaml = .github\workflows\deploy.yaml
.github\workflows\integration-test.yaml = .github\workflows\integration-test.yaml
.github\workflows\lint.yaml = .github\workflows\lint.yaml
.github\workflows\missiondesigner.yaml = .github\workflows\missiondesigner.yaml
.github\workflows\publish-api.yaml = .github\workflows\publish-api.yaml
.github\workflows\publish-statemanager.yaml = .github\workflows\publish-statemanager.yaml
.github\workflows\test-api.yaml = .github\workflows\test-api.yaml
.github\workflows\test-report.yaml = .github\workflows\test-report.yaml
.github\workflows\test-statemanager.yaml = .github\workflows\test-statemanager.yaml
.github\workflows\test.yaml = .github\workflows\test.yaml
.github\workflows\build-manual.yaml = .github\workflows\build-manual.yaml
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Test.Utils", "DragaliaAPI\DragaliaAPI.Test.Utils\DragaliaAPI.Test.Utils.csproj", "{41916B7C-6304-4504-99C0-B24D23982F7E}"
Expand All @@ -54,6 +48,10 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.Plugin", "PhotonPlugin\DragaliaAPI.Photon.Plugin\DragaliaAPI.Photon.Plugin.csproj", "{D9AC51A5-38F6-4DD1-8839-9FE881396A6B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PhotonStateManager", "PhotonStateManager", "{8B4B2FE9-B1FC-44FC-BC49-0E277731A68A}"
ProjectSection(SolutionItems) = preProject
PhotonStateManager\Directory.Build.props = PhotonStateManager\Directory.Build.props
PhotonStateManager\Dockerfile = PhotonStateManager\Dockerfile
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Integration.Test", "DragaliaAPI\DragaliaAPI.Integration.Test\DragaliaAPI.Integration.Test.csproj", "{CA0AE7C5-2742-4FC9-B668-BC7459E4BCE5}"
EndProject
Expand All @@ -63,7 +61,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Photon.StateMan
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".husky", ".husky", "{7D333F35-F74C-4A63-AB6E-5F0EE4590ADB}"
ProjectSection(SolutionItems) = preProject
.husky\pre-commit = .husky\pre-commit
.husky\task-runner.json = .husky\task-runner.json
EndProjectSection
EndProject
Expand All @@ -74,10 +71,14 @@ EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{F6545B66-0303-4E4C-B872-7E89091885A8}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PhotonPlugin", "PhotonPlugin", "{5A97773C-C23E-4CFE-8B1F-15D8244D2134}"
ProjectSection(SolutionItems) = preProject
PhotonPlugin\Directory.Build.props = PhotonPlugin\Directory.Build.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DragaliaAPI", "DragaliaAPI", "{F0C76530-C14A-4601-829B-EE0F4C7E24E6}"
ProjectSection(SolutionItems) = preProject
DragaliaAPI\Directory.Build.props = DragaliaAPI\Directory.Build.props
DragaliaAPI\Dockerfile = DragaliaAPI\Dockerfile
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.MasterAssetConverter", "DragaliaAPI\DragaliaAPI.MasterAssetConverter\DragaliaAPI.MasterAssetConverter.csproj", "{F0DFB899-ADC2-407E-AB32-647BA1C4122C}"
Expand All @@ -86,7 +87,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tools", "Tools", "{18AB580B
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Shared.SourceGenerator", "DragaliaAPI\DragaliaAPI.Shared.SourceGenerator\DragaliaAPI.Shared.SourceGenerator.csproj", "{FD0F2BDF-715C-417D-9059-1F2EF8FA8901}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DragaliaAPI.Shared.SourceGenerator.Test", "DragaliaAPI\DragaliaAPI.Shared.SourceGenerator.Test\DragaliaAPI.Shared.SourceGenerator.Test.csproj", "{517FBE68-58A1-48DB-A798-13D6BDECF623}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DragaliaAPI.Shared.SourceGenerator.Test", "DragaliaAPI\DragaliaAPI.Shared.SourceGenerator.Test\DragaliaAPI.Shared.SourceGenerator.Test.csproj", "{517FBE68-58A1-48DB-A798-13D6BDECF623}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{AB163A1E-1339-4CFC-82AD-E59ECFADA3C2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -102,10 +105,6 @@ Global
{A1E6C76A-4D4F-427D-80AF-CF289CBBAF00}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1E6C76A-4D4F-427D-80AF-CF289CBBAF00}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1E6C76A-4D4F-427D-80AF-CF289CBBAF00}.Release|Any CPU.Build.0 = Release|Any CPU
{6E4BCC4D-1998-4135-A474-681EC6E6AF57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E4BCC4D-1998-4135-A474-681EC6E6AF57}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E4BCC4D-1998-4135-A474-681EC6E6AF57}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{6E4BCC4D-1998-4135-A474-681EC6E6AF57}.Release|Any CPU.Build.0 = Debug|Any CPU
{3B1A86CE-A656-453B-BC3F-EA42DF9E3FC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B1A86CE-A656-453B-BC3F-EA42DF9E3FC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B1A86CE-A656-453B-BC3F-EA42DF9E3FC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -166,6 +165,10 @@ Global
{517FBE68-58A1-48DB-A798-13D6BDECF623}.Debug|Any CPU.Build.0 = Debug|Any CPU
{517FBE68-58A1-48DB-A798-13D6BDECF623}.Release|Any CPU.ActiveCfg = Release|Any CPU
{517FBE68-58A1-48DB-A798-13D6BDECF623}.Release|Any CPU.Build.0 = Release|Any CPU
{AB163A1E-1339-4CFC-82AD-E59ECFADA3C2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB163A1E-1339-4CFC-82AD-E59ECFADA3C2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB163A1E-1339-4CFC-82AD-E59ECFADA3C2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB163A1E-1339-4CFC-82AD-E59ECFADA3C2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
23 changes: 17 additions & 6 deletions DragaliaAPI/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<Project>
<Import Project="$([MSBuild]::GetPathOfFileAbove('Directory.Build.props', '$(MSBuildThisFileDirectory)../'))" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<AnalysisLevel>latest-minimum</AnalysisLevel>
</PropertyGroup>

<PropertyGroup>
<!-- Define the TEST condition to allow test runs in release mode to access conditionally
compiled controllers. -->
<DefineConstants Condition="$(AUTOMATED_TESTING) == 'true'">TEST;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<MasterAssetResources>$(MSBuildThisFileDirectory)DragaliaAPI.Shared\Resources\</MasterAssetResources>
Expand All @@ -8,16 +19,16 @@

<Target Name="CopyApiMsgpackFiles" AfterTargets="Build" Condition="$(DependsOnApiMsgpackFiles) == 'true'">
<ItemGroup>
<MasterAssetMsgpackFiles Include="$(ApiOutputDirectory)Resources\**\*.msgpack"/>
<MasterAssetMsgpackFiles Include="$(ApiOutputDirectory)Resources\**\*.msgpack" />
</ItemGroup>
<Copy SourceFiles="@(MasterAssetMsgpackFiles)" DestinationFolder="$(OutDir)Resources\%(RecursiveDir)"/>
<Copy SourceFiles="@(MasterAssetMsgpackFiles)" DestinationFolder="$(OutDir)Resources\%(RecursiveDir)" />
</Target>

<Target Name="CleanMsgpackFiles" AfterTargets="Clean" Condition="$(DependsOnApiMsgpackFiles) == 'true'">
<ItemGroup>
<FilesToDelete Include="$(OutDir)Resources\**\*.msgpack"/>
<FilesToDelete Include="$(OutDir)Resources\**\*.msgpack" />
</ItemGroup>
<Delete Files="@(FilesToDelete)"/>
<Delete Files="@(FilesToDelete)" />
</Target>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM mcr.microsoft.com/dotnet/sdk:8.0.300 AS build
WORKDIR /src
COPY ["DragaliaAPI/DragaliaAPI.MissionDesigner/DragaliaAPI.MissionDesigner.csproj", "DragaliaAPI/DragaliaAPI.MissionDesigner/"]
COPY ["DragaliaAPI/DragaliaAPI.MasterAssetConverter/DragaliaAPI.MasterAssetConverter.csproj", "DragaliaAPI/DragaliaAPI.MasterAssetConverter/"]
COPY ["Directory.Build.props", "."]
COPY ["DragaliaAPI/Directory.Build.props", "."]
COPY ["Directory.Packages.props", "."]
COPY ["nuget.config", "."]
RUN dotnet restore "DragaliaAPI/DragaliaAPI.MissionDesigner/DragaliaAPI.MissionDesigner.csproj"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using DragaliaAPI.Shared.MasterAsset;
using DragaliaAPI.Shared.MasterAsset.Models;

namespace DragaliaAPI.MemoryPack;
namespace DragaliaAPI.MasterAssetConverter;

public static class AttributeHelper
{
Expand Down
2 changes: 1 addition & 1 deletion DragaliaAPI/DragaliaAPI.MasterAssetConverter/Program.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Diagnostics;
using System.Reflection;
using System.Text.Json;
using DragaliaAPI.MemoryPack;
using DragaliaAPI.MasterAssetConverter;
using DragaliaAPI.Shared.MasterAsset;
using DragaliaAPI.Shared.Serialization;
using MessagePack;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<LangVersion>12</LangVersion>
<IsPackable>false</IsPackable>
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
<IsRoslynComponent>true</IsRoslynComponent>
Expand Down
Loading

0 comments on commit 874966b

Please sign in to comment.