Skip to content

Commit cf70569

Browse files
authored
Update to enable building Net8.0 projects (#816)
1 parent b258368 commit cf70569

File tree

7 files changed

+48
-26
lines changed

7 files changed

+48
-26
lines changed

.github/workflows/main.yml

+17-5
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,26 @@ jobs:
1010
build:
1111
runs-on: windows-latest
1212
steps:
13-
- name: Setup dotnet
13+
- name: 'Setup dotnet 6 / 7 / 8'
1414
uses: actions/setup-dotnet@v3
1515
with:
1616
dotnet-version: |
1717
6.0.x
1818
7.0.x
19+
8.0.x
1920
20-
- name: Install DotNet workloads
21+
- name: 'Setup Java JDK 11'
22+
uses: actions/[email protected]
23+
with:
24+
distribution: 'microsoft'
25+
java-version: '11'
26+
27+
- name: 'Add MSBuild to PATH'
28+
uses: microsoft/[email protected]
29+
with:
30+
vs-prerelease: true
31+
32+
- name: 'Install DotNet workloads'
2133
shell: bash
2234
run: |
2335
dotnet workload install android ios tvos macos maui maccatalyst
@@ -38,11 +50,11 @@ jobs:
3850
- name: 'Restore and Compile ReactiveUI Projects'
3951
run: ./build.cmd Compile
4052

41-
- name: Build Website
53+
- name: 'Build Website'
4254
run: ./build.cmd BuildWebsite
4355

44-
- name: Deploy netlify
45-
if: ${{ github.event_name != 'pull_request' }}
56+
- name: 'Deploy netlify'
57+
if: ${{ github.event_name != 'pull_request' }}
4658
run: |
4759
npm install -g netlify-cli
4860
netlify deploy --auth=${{ secrets.NETLIFY_DEPLOY_KEY }} --site=${{ secrets.NETLIFY_SITE_ID }} --prod --dir=reactiveui/_site

README.md

+18-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
![Build website](https://github.com/reactiveui/website/workflows/Build%20website/badge.svg)
44

5-
This is the ReactiveUI website. It's a static site generated by [DocFx](https://dotnet.github.io/docfx/index.html).
5+
This is the source code for the [ReactiveUI](https://www.reactiveui.net/) website. It's a static site generated by [DocFx](https://dotnet.github.io/docfx/index.html).
66

77
## Contributing
88

@@ -11,11 +11,23 @@ This is the ReactiveUI website. It's a static site generated by [DocFx](https://
1111
2. Create a new branch, if needed
1212
3. Clone the project
1313
4. In order to build and host the docs do the following:
14-
- **Windows**
15-
-- Open command prompt at the repository root folder and run `docfx reactiveui/docfx.json --serve`
16-
5. Wait several minutes while it installs dependencies and initializes (approx 35 mins). It is ready when you see `Hit Ctrl-C to exit`
14+
**Windows** -- Open command prompt and install the following tools:
15+
- the DocFx tool `dotnet tool update -g docfx`
16+
- the Nuke tool `dotnet tool install Nuke.GlobalTool --global`
17+
18+
- Open command prompt at the repository root folder, ensure that you have installed the DocFx tool and then run `docfx reactiveui/docfx.json --serve`
19+
20+
5. Wait several minutes while it installs dependencies and initializes (approx 5 mins). It is ready when you see `Hit Ctrl-C to exit`
1721
6. Browse the website on `localhost:8080`
22+
---
23+
24+
To build the entire Website we use `Nuke Build` you will need to install the tool so that you can run command line nuke commands using `dotnet tool install Nuke.GlobalTool --global`.
1825

19-
To build the entire Website we use `Nuke Build` you will need to install the tool so that you can run command line nuke commands.
20-
Once installed from the command prompt execute `Nuke` this will download and build the sources for the API section of the website.
26+
---
27+
Once installed from the command prompt execute `Nuke` this will download and build the sources for the API section of the website, this takes around 35 minutes to compile and build the website with the API sections.
28+
29+
---
2130
Once complete you can either execute `docfx reactiveui/docfx.json --serve` to run the site OR `Nuke BuildWebsite` to build the API only.
31+
32+
---
33+
If you have generated the API section and wish to remove it on your local machine to enable the website to compile faster, run `nuke clean` and then run `docfx reactiveui/docfx.json --serve`

build/Build.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ class Build : NukeBuild
4747
.Executes(() =>
4848
{
4949
// Restore ReactiveUI Projects
50-
RxUIAPIDirectory.GetSources(reactiveui, RxUIProjects);
50+
RxUIAPIDirectory.GetSources(RootDirectory, reactiveui, RxUIProjects);
5151

5252
// Restore Reactive Marbles Projects
53-
RxMAPIDirectory.GetSources(reactivemarbles, DynamicData);
53+
RxMAPIDirectory.GetSources(RootDirectory, reactivemarbles, DynamicData);
5454
});
5555

5656
Target Compile => _ => _

build/Configuration.cs

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
using System;
21
using System.ComponentModel;
3-
using System.Linq;
42
using Nuke.Common.Tooling;
53

64
[TypeConverter(typeof(TypeConverter<Configuration>))]
75
public class Configuration : Enumeration
86
{
9-
public static Configuration Debug = new Configuration { Value = nameof(Debug) };
10-
public static Configuration Release = new Configuration { Value = nameof(Release) };
7+
public static Configuration Debug = new() { Value = nameof(Debug) };
8+
public static Configuration Release = new() { Value = nameof(Release) };
119

12-
public static implicit operator string(Configuration configuration)
13-
{
14-
return configuration.Value;
15-
}
10+
public static implicit operator string(Configuration configuration) => configuration.Value;
1611
}

build/SourceFetcher.cs

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Net.Http;
77
using System.Threading;
88
using System.Threading.Tasks;
9+
using Nuke.Common;
910
using Nuke.Common.IO;
1011
using Polly;
1112

@@ -16,12 +17,12 @@ internal static class SourceFetcher
1617
private static readonly object _lockConsoleObject = new();
1718
private static readonly object _lockWorkloadObject = new();
1819

19-
public static void GetSources(this AbsolutePath fileSystem, string owner, params string[] repositories)
20+
public static void GetSources(this AbsolutePath fileSystem, AbsolutePath rootDirectory, string owner, params string[] repositories)
2021
{
21-
FetchGitHubZip(fileSystem, owner, repositories, "external", true, true);
22+
FetchGitHubZip(fileSystem, rootDirectory, owner, repositories, "external", true, true);
2223
}
2324

24-
private static void FetchGitHubZip(AbsolutePath fileSystem, string owner, string[] repositories, string outputFolder, bool fetchNuGet, bool useSrc)
25+
private static void FetchGitHubZip(AbsolutePath fileSystem, AbsolutePath rootDirectory, string owner, string[] repositories, string outputFolder, bool fetchNuGet, bool useSrc)
2526
{
2627
var zipCache = fileSystem / "zip";
2728
zipCache.CreateDirectory();
@@ -88,6 +89,8 @@ await waitAndRetry.ExecuteAsync(async () =>
8889

8990
if (fetchNuGet)
9091
{
92+
var directory = useSrc ? finalPath / $"{repository}-main" / "src" : finalPath;
93+
File.Copy(rootDirectory / "global.json", directory / "global.json", true);
9194
WorkflowRestore(owner, repository, finalPath, useSrc);
9295
FetchNuGet(owner, repository, finalPath, useSrc);
9396
}

build/_build.csproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>

global.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"sdk": {
3-
"version": "7.0.400",
3+
"version": "8.0.10",
44
"rollForward": "latestMinor"
55
},
66
"msbuild-sdks": {

0 commit comments

Comments
 (0)