• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    C#
  • License
    MIT License
  • Created about 5 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SlnMerge merges the solution files when generating solution file by Unity Editor.

GitHub Actions Releases

SlnMerge

SlnMerge merges the solutions when creating solution file by Unity Editor.

日本語

Table of Contents

Works with

  • Unity 2018.4.5f1 + Windows 10 and macOS 10.15
  • Microsoft Visual Studio 2019
  • JetBrains Rider 2019.2

How to use

1. Install SlnMerge

Method 1. Copy src/Editor/SlnMerge.cs to Assets/Editor in your Unity project.

Clone this repository and copy those files.

Method 2. Add the package via git from Package Manager

If you are using Unity 2019.1 or later, you can use Package Manager to install a package via git.

https://github.com/Cysharp/SlnMerge.git?path=src

2. Create ProjectName.sln.mergesettings and configure a target solution.

Create a setting XML file named <ProjectName>.sln.mergesettings.

For example, when the project name is MyUnityApp, Unity Editor generates MyUnityApp.sln. You need to create MyUnityApp.sln.mergesettings.

<SlnMergeSettings>
    <MergeTargetSolution>..\MyUnityApp.Server.sln</MergeTargetSolution>
</SlnMergeSettings>

You can specify the target solution to merge by MergeTargetSolution element.

NOTE: If you don't have the settings, SlnMerge uses ProjectName.Merge.sln as a target.

Settings

The mergesettings file has the following settings:

  • Disabled: Disable SlnMerge (default: false)
  • MergeTargetSolution: Path of the solution you want to merge
  • NestedProjects: Specify the projects to nest. Usually used as a solution folder
    • NestedProject/FolderPath: Folder path on solution (created if it doesn't exist; mutally exclusive with FolderGuid)
    • NestedProject/FolderGuid: GUID of folder on solution (mutally exclusive with FolderPath)
    • NestedProject/ProjectName: Project name (mutally exclusive with ProjectGuid)
      • Wildcard is available (?, *)
    • NestedProject/ProjectGuid: Project GUID (mutally exclusive with ProjectName)
  • ProjectConflictResolution: Processing strategy when a solution contains a project with the same name (PreserveAll, PreserveUnity, PreserveOverlay)
    • PreserveAll: Preserve all projects (both Unity generated projects and original projects)
    • PreserveUnity: Preserve Unity generated projects. (discard original project in a overlay solution)
    • PreserveOverlay: Preserve original projects in a overlay solution. (discard Unity generated projects from a merged solution)

Add projects to solution folders

You can use NestedProjects settings to move projects to solution folders. When a solution folder doesn't exist, SlnMerge will add the solution folder to the solution automatically. But, you need to define a solution folder as SolutionFolder in mergesettings.

<SlnMergeSettings>
    <MergeTargetSolution>..\ChatApp.Server.sln</MergeTargetSolution>
    <SolutionFolders>
        <!-- Define a solution folder named 'Unity' with GUID -->
        <SolutionFolder FolderPath="Unity" Guid="{55739033-89BA-48AE-B482-843AFD452468}"/>
    </SolutionFolders>
    <NestedProjects>
        <NestedProject ProjectName="Assembly-CSharp" FolderPath="Unity" />
        <NestedProject ProjectName="Assembly-CSharp-Editor" FolderPath="Unity" />
    </NestedProjects>
</SlnMergeSettings>

Troubleshooting

Always regenerate the solution file, and Visual Studio displays a conflict dialog.

  1. Close Unity Editor.
  2. Delete .csproj and .sln are generated by Unity Editor.
  3. Reopen the project in Unity Editor

If a merge target solution has a project with the same name in the Unity generated solution, you can use use ProjectConflictResolution option to fix the conflict in a 3-way.

  1. Preserve all projects (by default)
  2. Preserve the project in the merge target solution
  3. Preserve the project in the Unity generated solution

License

MIT License

More Repositories

1

UniTask

Provides an efficient allocation free async/await integration for Unity.
C#
8,201
star
2

MagicOnion

Unified Realtime/API framework for .NET platform and Unity.
C#
3,838
star
3

MemoryPack

Zero encoding extreme performance binary serializer for C# and Unity.
C#
3,288
star
4

R3

The new future of dotnet/reactive and UniRx.
C#
2,177
star
5

ZString

Zero Allocation StringBuilder for .NET and Unity.
C#
2,060
star
6

ConsoleAppFramework

Zero Dependency, Zero Overhead, Zero Reflection, Zero Allocation, AOT Safe CLI Framework powered by C# Source Generator.
C#
1,635
star
7

MasterMemory

Embedded Typed Readonly In-Memory Document Database for .NET and Unity.
C#
1,521
star
8

MessagePipe

High performance in-memory/distributed messaging pipeline for .NET and Unity.
C#
1,406
star
9

Ulid

Fast .NET C# Implementation of ULID for .NET and Unity.
C#
1,314
star
10

ZLogger

Zero Allocation Text/Structured Logger for .NET with StringInterpolation and Source Generator, built on top of a Microsoft.Extensions.Logging.
C#
1,262
star
11

SimdLinq

Drop-in replacement of LINQ aggregation operations extremely faster with SIMD.
C#
775
star
12

csbindgen

Generate C# FFI from Rust for automatically brings native code and C native library to .NET and Unity.
Rust
688
star
13

ObservableCollections

High performance observable collections and synchronized views, for WPF, Blazor, Unity.
C#
559
star
14

ProcessX

Simplify call an external process with the async streams in C# 8.0.
C#
453
star
15

YetAnotherHttpHandler

YetAnotherHttpHandler brings the power of HTTP/2 (and gRPC) to Unity and .NET Standard.
C#
354
star
16

UnitGenerator

C# Source Generator to create value-object, inspired by units of measure.
C#
330
star
17

RuntimeUnitTestToolkit

CLI/GUI Frontend of Unity Test Runner to test on any platform.
C#
300
star
18

AlterNats

An alternative high performance NATS client for .NET.
C#
284
star
19

NativeMemoryArray

Utilized native-memory backed array for .NET and Unity - over the 2GB limitation and support the modern API(IBufferWriter, ReadOnlySequence, scatter/gather I/O, etc...).
C#
276
star
20

StructureOfArraysGenerator

Structure of arrays source generator to make CPU Cache and SIMD friendly data structure for high-performance code in .NET and Unity.
C#
262
star
21

MagicPhysX

.NET PhysX 5 binding to all platforms(win, osx, linux) for 3D engine, deep learning, dedicated server of gaming.
Rust
258
star
22

PrivateProxy

Source Generator and .NET 8 UnsafeAccessor based high-performance strongly-typed private accessor for unit testing and runtime.
C#
239
star
23

KcpTransport

KcpTransport is a Pure C# implementation of RUDP for high-performance real-time network communication
C#
237
star
24

LogicLooper

A library for building server application using loop-action programming model on .NET.
C#
237
star
25

DFrame

Distributed load testing framework for .NET and Unity.
C#
223
star
26

Utf8StreamReader

Utf8 based StreamReader for high performance text processing.
C#
208
star
27

LitJWT

Lightweight, Fast JWT(JSON Web Token) implementation for .NET.
C#
199
star
28

Claudia

Unofficial Anthropic Claude API client for .NET.
C#
162
star
29

CsprojModifier

CsprojModifier performs additional processing when Unity Editor generates the .csproj.
C#
154
star
30

Utf8StringInterpolation

Successor of ZString; UTF8 based zero allocation high-peformance String Interpolation and StringBuilder.
C#
153
star
31

ValueTaskSupplement

Append supplemental methods(WhenAny, WhenAll, Lazy) to ValueTask.
C#
135
star
32

Kokuban

Simplifies styling strings in the terminal for .NET application.
C#
123
star
33

GrpcWebSocketBridge

Yet Another gRPC over HTTP/1 using WebSocket implementation, primarily targets .NET platform.
C#
76
star
34

WebSerializer

Convert Object into QueryString/FormUrlEncodedContent for C# HttpClient REST Request.
C#
65
star
35

RandomFixtureKit

Fill random/edge-case value to target type for unit testing, supports both .NET Standard and Unity.
C#
46
star
36

Actions

41
star
37

DocfxTemplate

Patchworked DocFX v2 template for Cysharp
JavaScript
7
star
38

Multicaster

A framework for transparently invoking multiple instances or clients.
C#
5
star
39

com.unity.ide.visualstudio-backport

Backport of com.unity.ide.visualstudio to before Unity 2019.4.21
C#
1
star