Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"cake.tool": {
"version": "2.2.0",
"commands": [
"dotnet-cake"
]
}
}
}
7 changes: 3 additions & 4 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ jobs:
with:
# TODO install all targeted .NET versions then test against all of them
dotnet-version: 6.0.104
- name: Build
# MSBuildCommunityTasks doesn't play well with .NET 6 so skip all that
run: dotnet build --configuration Pro -p:DRBuildMode=coreonly -p:SkipCopyToBuild=true
- name: Restore
run: dotnet tool restore
- name: Test
run: dotnet test -p:DRBuildMode=coreonly -p:SkipCopyToBuild=true
run: dotnet cake --target Test --configuration Pro --core-only
8 changes: 4 additions & 4 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.104
- name: Build
run: dotnet build --configuration Pro -p:DRBuildMode=coreonly -p:SkipCopyToBuild=true
- name: Restore
run: dotnet tool restore
- name: Test
run: dotnet test -p:DRBuildMode=coreonly -p:SkipCopyToBuild=true
# TODO create GitHub release, this might require moving away from MSBuildTasks due to no .NET Core support
run: dotnet cake --target Test --configuration Pro --core-only
# TODO create GitHub release
# TODO pack unitypackage using somehting like https://github.com/FatihBAKIR/UnityPacker
5 changes: 0 additions & 5 deletions .props

This file was deleted.

110 changes: 0 additions & 110 deletions .targets

This file was deleted.

1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.12.0-prerelease
30 changes: 28 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
To build the DarkRift 2 solution *you must have Microsoft Visual Studio 2022* installed. The Community edition is fine for open source projects, and is easily attained from https://visualstudio.microsoft.com/vs/community/
DarkRift is build using [Cake](https://cakebuild.net/). To create a full build of DarkRift run `dotnet cake` (you will need to run `dotnet tool restore` the first time).

This command will:
- Build DarkRift
- Create neatly organized packages in `./Build`
- Test DR

You will need the .NET 6 SDK to build DarkRift.

For editing DarkRift we recommend using Microsoft Visual Studio 2022 although other editors will work.

## Cake Tasks
The following tasks are defined in `build.cake`:
- `Clean` - Cleans the `./Build` directory
- `Build` - Builds DarkRift
- `Test` (default) - Builds and tests DarkRift
- `InstallInCLITool` - Builds and installs a dev version of DarkRift into the DarkRift CLI tool as version `dev`. This is useful for easy local testing

The following arguments can be passed to the build script:
- `--target <task>` - choose the task to run (see list above)
- `--configuration <configuration>` - the configuration of DR to build (see below section)
- `--core-only` - only build for .NET Core, this can get around issues building .NET Framework applications such as on Linux

For example:
```bash
dotnet cake --target InstallInCLITool --configuration Pro
```

## Configurations

Expand All @@ -25,4 +51,4 @@ If you're looking to manually copy assemblies into your Unity assets, you should

If you're an existing DarkRift 2 user, there's a decent chance you will want to reproduce the Free or Pro .unitypackage DarkRift 2 used to ship with in order to stick with the way DR2 in your Assets folder is organized. Even as a new user, a .unitypackage can be a practical way install the typical DarkRift version into your Unity project if you don't intend to make changes.

*TODO: Fix package building in post_release.sh and write guide for how to export packages*
*TODO: Fix package building in post_release.sh and write guide for how to export packages*
5 changes: 1 addition & 4 deletions DarkRift.Client/DarkRift.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import global props (must be done here for Version to have effect on class libraries) -->
<Import Project="$(SolutionDir).props" />

<PropertyGroup>
<TargetFrameworks Condition=" '$(DRBuildMode)' != 'coreonly' ">net3.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DRBuildMode)' == 'coreonly' ">netstandard2.0</TargetFrameworks>
Expand All @@ -26,4 +23,4 @@
<ProjectReference Include="..\DarkRift\DarkRift.csproj" />
</ItemGroup>

</Project>
</Project>
6 changes: 0 additions & 6 deletions DarkRift.Server.Console/DarkRift.Server.Console.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import global props -->
<Import Project="$(SolutionDir).props" />

<PropertyGroup>
<TargetFrameworks Condition=" '$(DRBuildMode)' != 'coreonly' ">net4.0;netcoreapp2.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DRBuildMode)' == 'coreonly' ">netcoreapp2.0;netcoreapp3.1;net5.0;net6.0</TargetFrameworks>
Expand Down Expand Up @@ -39,7 +36,4 @@
<ProjectReference Include="..\DarkRift.Server\DarkRift.Server.csproj" />
<ProjectReference Include="..\DarkRift\DarkRift.csproj" />
</ItemGroup>

<Import Project="$(SolutionDir).targets" Condition="'$(SkipCopyToBuild)' != 'true'" />

</Project>
3 changes: 0 additions & 3 deletions DarkRift.Server.Testing/DarkRift.Server.Testing.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import global props (must be done here for Version to have effect on class libraries) -->
<Import Project="$(SolutionDir).props" />

<PropertyGroup>
<TargetFrameworks Condition=" '$(DRBuildMode)' != 'coreonly' ">net4.5;net6.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DRBuildMode)' == 'coreonly' ">net6.0</TargetFrameworks>
Expand Down
5 changes: 1 addition & 4 deletions DarkRift.Server/DarkRift.Server.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import global props (must be done here for Version to have effect on class libraries) -->
<Import Project="$(SolutionDir).props" />

<PropertyGroup>
<TargetFrameworks Condition=" '$(DRBuildMode)' != 'coreonly' ">net3.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DRBuildMode)' == 'coreonly' ">netstandard2.0</TargetFrameworks>
Expand All @@ -26,4 +23,4 @@
<ProjectReference Include="..\DarkRift.Client\DarkRift.Client.csproj" />
<ProjectReference Include="..\DarkRift\DarkRift.csproj" />
</ItemGroup>
</Project>
</Project>
3 changes: 0 additions & 3 deletions DarkRift.SystemTesting/DarkRift.SystemTesting.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import global props (must be done here for Version to have effect on class libraries) -->
<Import Project="$(SolutionDir).props" />

<PropertyGroup>
<TargetFrameworks>net6.0</TargetFrameworks>
<Configurations>Debug;Free;Pro</Configurations>
Expand Down
3 changes: 0 additions & 3 deletions DarkRift.Testing/DarkRift.Testing.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import global props (must be done here for Version to have effect on class libraries) -->
<Import Project="$(SolutionDir).props" />

<PropertyGroup>
<TargetFrameworks Condition=" '$(DRBuildMode)' != 'coreonly' ">net4.5;net6.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DRBuildMode)' == 'coreonly' ">net6.0</TargetFrameworks>
Expand Down
5 changes: 1 addition & 4 deletions DarkRift/DarkRift.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<!-- Import global props (must be done here for Version to have effect on class libraries) -->
<Import Project="$(SolutionDir).props" />

<PropertyGroup>
<TargetFrameworks Condition=" '$(DRBuildMode)' != 'coreonly' ">net3.5;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DRBuildMode)' == 'coreonly' ">netstandard2.0</TargetFrameworks>
Expand All @@ -22,4 +19,4 @@
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<DefineConstants>DEBUG;TRACE;PRO</DefineConstants>
</PropertyGroup>
</Project>
</Project>
Loading