Skip to content

Commit 9bf4ac9

Browse files
committed
Release 3.0.0 (MudBlazor v8 support)
1 parent ec6e1dd commit 9bf4ac9

File tree

10 files changed

+114
-159
lines changed

10 files changed

+114
-159
lines changed

.github/workflows/codeql.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@ jobs:
3838
build-mode: manual
3939

4040
steps:
41+
- name: Setup dotnet
42+
uses: actions/setup-dotnet@v4
43+
with:
44+
dotnet-version: |
45+
9.0.x
4146
- name: Checkout repository
4247
uses: actions/checkout@v4
4348
with:

.github/workflows/continuous.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,16 @@ jobs:
2323
name: ubuntu-latest
2424
runs-on: ubuntu-latest
2525
steps:
26-
- uses: actions/checkout@v3
26+
- uses: actions/checkout@v4
2727
with:
2828
fetch-depth: 0
29+
- name: Setup dotnet
30+
uses: actions/setup-dotnet@v4
31+
with:
32+
dotnet-version: |
33+
9.0.x
2934
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
30-
uses: actions/cache@v3
35+
uses: actions/cache@v4
3136
with:
3237
path: |
3338
.nuke/temp
@@ -36,7 +41,7 @@ jobs:
3641
- name: 'Run: Compile, Pack'
3742
run: ./build.cmd Compile Pack
3843
- name: 'Publish: packages'
39-
uses: actions/upload-artifact@v3
44+
uses: actions/upload-artifact@v4
4045
with:
4146
name: packages
4247
path: artifacts/packages

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,16 @@ jobs:
2626
name: ubuntu-latest
2727
runs-on: ubuntu-latest
2828
steps:
29-
- uses: actions/checkout@v3
29+
- uses: actions/checkout@v4
3030
with:
3131
fetch-depth: 0
32+
- name: Setup dotnet
33+
uses: actions/setup-dotnet@v4
34+
with:
35+
dotnet-version: |
36+
9.0.x
3237
- name: 'Cache: .nuke/temp, ~/.nuget/packages'
33-
uses: actions/cache@v3
38+
uses: actions/cache@v4
3439
with:
3540
path: |
3641
.nuke/temp
@@ -42,7 +47,7 @@ jobs:
4247
NugetKey: ${{ secrets.NUGET_KEY }}
4348
GithubToken: ${{ secrets.GITHUB_TOKEN }}
4449
- name: 'Publish: packages'
45-
uses: actions/upload-artifact@v3
50+
uses: actions/upload-artifact@v4
4651
with:
4752
name: packages
4853
path: artifacts/packages

.nuke/build.schema.json

Lines changed: 78 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,66 @@
11
{
22
"$schema": "http://json-schema.org/draft-04/schema#",
3-
"$ref": "#/definitions/build",
4-
"title": "Build Schema",
53
"definitions": {
6-
"build": {
7-
"type": "object",
4+
"Host": {
5+
"type": "string",
6+
"enum": [
7+
"AppVeyor",
8+
"AzurePipelines",
9+
"Bamboo",
10+
"Bitbucket",
11+
"Bitrise",
12+
"GitHubActions",
13+
"GitLab",
14+
"Jenkins",
15+
"Rider",
16+
"SpaceAutomation",
17+
"TeamCity",
18+
"Terminal",
19+
"TravisCI",
20+
"VisualStudio",
21+
"VSCode"
22+
]
23+
},
24+
"ExecutableTarget": {
25+
"type": "string",
26+
"enum": [
27+
"Clean",
28+
"Compile",
29+
"Pack",
30+
"Push",
31+
"PushGithubNuget",
32+
"Restore",
33+
"VerifyFormat"
34+
]
35+
},
36+
"Verbosity": {
37+
"type": "string",
38+
"description": "",
39+
"enum": [
40+
"Verbose",
41+
"Normal",
42+
"Minimal",
43+
"Quiet"
44+
]
45+
},
46+
"NukeBuild": {
847
"properties": {
9-
"Configuration": {
10-
"type": "string",
11-
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
12-
"enum": [
13-
"Debug",
14-
"Release"
15-
]
16-
},
1748
"Continue": {
1849
"type": "boolean",
1950
"description": "Indicates to continue a previously failed build attempt"
2051
},
21-
"GithubToken": {
22-
"type": "string",
23-
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
24-
},
2552
"Help": {
2653
"type": "boolean",
2754
"description": "Shows the help text for this build assembly"
2855
},
2956
"Host": {
30-
"type": "string",
3157
"description": "Host for execution. Default is 'automatic'",
32-
"enum": [
33-
"AppVeyor",
34-
"AzurePipelines",
35-
"Bamboo",
36-
"Bitbucket",
37-
"Bitrise",
38-
"GitHubActions",
39-
"GitLab",
40-
"Jenkins",
41-
"Rider",
42-
"SpaceAutomation",
43-
"TeamCity",
44-
"Terminal",
45-
"TravisCI",
46-
"VisualStudio",
47-
"VSCode"
48-
]
58+
"$ref": "#/definitions/Host"
4959
},
5060
"NoLogo": {
5161
"type": "boolean",
5262
"description": "Disables displaying the NUKE logo"
5363
},
54-
"NugetApiUrl": {
55-
"type": "string"
56-
},
57-
"NugetKey": {
58-
"type": "string",
59-
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
60-
},
6164
"Partition": {
6265
"type": "string",
6366
"description": "Partition to use on CI"
@@ -81,49 +84,53 @@
8184
"type": "array",
8285
"description": "List of targets to be skipped. Empty list skips all dependencies",
8386
"items": {
84-
"type": "string",
85-
"enum": [
86-
"Clean",
87-
"Compile",
88-
"Pack",
89-
"Push",
90-
"PushGithubNuget",
91-
"Restore",
92-
"VerifyFormat"
93-
]
87+
"$ref": "#/definitions/ExecutableTarget"
9488
}
9589
},
96-
"Solution": {
97-
"type": "string",
98-
"description": "Path to a solution file that is automatically loaded"
99-
},
10090
"Target": {
10191
"type": "array",
10292
"description": "List of targets to be invoked. Default is '{default_target}'",
10393
"items": {
104-
"type": "string",
105-
"enum": [
106-
"Clean",
107-
"Compile",
108-
"Pack",
109-
"Push",
110-
"PushGithubNuget",
111-
"Restore",
112-
"VerifyFormat"
113-
]
94+
"$ref": "#/definitions/ExecutableTarget"
11495
}
11596
},
11697
"Verbosity": {
117-
"type": "string",
11898
"description": "Logging verbosity during build execution. Default is 'Normal'",
99+
"$ref": "#/definitions/Verbosity"
100+
}
101+
}
102+
}
103+
},
104+
"allOf": [
105+
{
106+
"properties": {
107+
"Configuration": {
108+
"type": "string",
109+
"description": "Configuration to build - Default is 'Debug' (local) or 'Release' (server)",
119110
"enum": [
120-
"Minimal",
121-
"Normal",
122-
"Quiet",
123-
"Verbose"
111+
"Debug",
112+
"Release"
124113
]
114+
},
115+
"GithubToken": {
116+
"type": "string",
117+
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
118+
},
119+
"NugetApiUrl": {
120+
"type": "string"
121+
},
122+
"NugetKey": {
123+
"type": "string",
124+
"default": "Secrets must be entered via 'nuke :secrets [profile]'"
125+
},
126+
"Solution": {
127+
"type": "string",
128+
"description": "Path to a solution file that is automatically loaded"
125129
}
126130
}
131+
},
132+
{
133+
"$ref": "#/definitions/NukeBuild"
127134
}
128-
}
135+
]
129136
}

build/Build.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
using Nuke.Common.Utilities.Collections;
1313
using Serilog;
1414
using static Nuke.Common.EnvironmentInfo;
15-
using static Nuke.Common.IO.FileSystemTasks;
1615
using static Nuke.Common.IO.PathConstruction;
1716
using static Nuke.Common.Tools.DotNet.DotNetTasks;
1817

build/_build.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<OutputType>Exe</OutputType>
5-
<TargetFramework>net8.0</TargetFramework>
5+
<TargetFramework>net9.0</TargetFramework>
66
<RootNamespace></RootNamespace>
77
<NoWarn>CS0649;CS0169;CA1050;CA1822;CA2211;IDE1006</NoWarn>
88
<NukeRootDirectory>..</NukeRootDirectory>
@@ -12,7 +12,7 @@
1212
</PropertyGroup>
1313

1414
<ItemGroup>
15-
<PackageReference Include="Nuke.Common" Version="8.0.0" />
15+
<PackageReference Include="Nuke.Common" Version="9.0.4" />
1616
</ItemGroup>
1717

1818
</Project>

src/MudBlazor.ThemeManager/Extensions/Extension.cs

Lines changed: 4 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,11 @@ internal static class Extension
99

1010
public static MudTheme DeepClone(this MudTheme source)
1111
{
12-
// TODO: Needs this to be done https://github.com/MudBlazor/MudBlazor/pull/9434
13-
//var themeType = typeof(MudTheme);
14-
//var serializeStr = JsonSerializer.Serialize(source, themeType, ThemeSerializerContext);
15-
//var copyObj = (MudTheme?)JsonSerializer.Deserialize(serializeStr, themeType, ThemeSerializerContext);
12+
var themeType = typeof(MudTheme);
13+
var serializeStr = JsonSerializer.Serialize(source, themeType, ThemeSerializerContext);
14+
var copyObj = (MudTheme?)JsonSerializer.Deserialize(serializeStr, themeType, ThemeSerializerContext);
1615

17-
//return copyObj;
18-
19-
// Code below is a workaround for the above issue
20-
21-
return new MudTheme
22-
{
23-
PaletteDark = source.PaletteDark.DeepClone() ?? new PaletteDark(),
24-
PaletteLight = source.PaletteLight.DeepClone() ?? new PaletteLight(),
25-
Shadows = DeepCloneTheme(source.Shadows) ?? new Shadow(),
26-
LayoutProperties = DeepCloneTheme(source.LayoutProperties) ?? new LayoutProperties(),
27-
ZIndex = DeepCloneTheme(source.ZIndex) ?? new ZIndex(),
28-
PseudoCss = DeepCloneTheme(source.PseudoCss) ?? new PseudoCss(),
29-
// Exception case
30-
Typography = new Typography
31-
{
32-
Default = DeepCloneBaseTypography(source.Typography.Default),
33-
H1 = DeepCloneBaseTypography(source.Typography.H1),
34-
H2 = DeepCloneBaseTypography(source.Typography.H2),
35-
H3 = DeepCloneBaseTypography(source.Typography.H3),
36-
H4 = DeepCloneBaseTypography(source.Typography.H4),
37-
H5 = DeepCloneBaseTypography(source.Typography.H5),
38-
H6 = DeepCloneBaseTypography(source.Typography.H6),
39-
Subtitle1 = DeepCloneBaseTypography(source.Typography.Subtitle1),
40-
Subtitle2 = DeepCloneBaseTypography(source.Typography.Subtitle2),
41-
Body1 = DeepCloneBaseTypography(source.Typography.Body1),
42-
Body2 = DeepCloneBaseTypography(source.Typography.Body2),
43-
Input = DeepCloneBaseTypography(source.Typography.Input),
44-
Button = DeepCloneBaseTypography(source.Typography.Button),
45-
Caption = DeepCloneBaseTypography(source.Typography.Caption),
46-
Overline = DeepCloneBaseTypography(source.Typography.Overline)
47-
}
48-
};
16+
return copyObj ?? new MudTheme();
4917
}
5018

5119
public static PaletteDark? DeepClone(this PaletteDark source) => DeepClonePalette(source);
@@ -60,38 +28,4 @@ public static MudTheme DeepClone(this MudTheme source)
6028

6129
return copyObj;
6230
}
63-
64-
private static T? DeepCloneTheme<T>(T source) where T : class
65-
{
66-
var paletteType = typeof(T);
67-
var serializeStr = JsonSerializer.Serialize(source, paletteType, ThemeSerializerContext);
68-
var copyObj = (T?)JsonSerializer.Deserialize(serializeStr, paletteType, ThemeSerializerContext);
69-
70-
return copyObj;
71-
}
72-
73-
private static T DeepCloneBaseTypography<T>(T baseTypography) where T : BaseTypography, new()
74-
{
75-
string[] fontFamilyCloned = new string[baseTypography.FontFamily?.Length ?? 0];
76-
if (baseTypography.FontFamily is not null)
77-
{
78-
Array.Copy(baseTypography.FontFamily, fontFamilyCloned, baseTypography.FontFamily.Length);
79-
}
80-
81-
var fontWeightCloned = baseTypography.FontWeight;
82-
var fontSizeCloned = baseTypography.FontSize;
83-
var lineHeightCloned = baseTypography.LineHeight;
84-
var letterSpacingCloned = baseTypography.LetterSpacing;
85-
var textTransformCloned = baseTypography.TextTransform;
86-
87-
return new T
88-
{
89-
FontWeight = fontWeightCloned,
90-
FontFamily = fontFamilyCloned,
91-
FontSize = fontSizeCloned,
92-
LineHeight = lineHeightCloned,
93-
LetterSpacing = letterSpacingCloned,
94-
TextTransform = textTransformCloned,
95-
};
96-
}
9731
}

src/MudBlazor.ThemeManager/Extensions/ThemeSerializerContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace MudBlazor.ThemeManager.Extensions;
44

5-
//[JsonSerializable(typeof(MudTheme))] TODO: Needs this to be done https://github.com/MudBlazor/MudBlazor/pull/9434 rest can be removed after
5+
[JsonSerializable(typeof(MudTheme))]
66
[JsonSerializable(typeof(Shadow))]
77
[JsonSerializable(typeof(LayoutProperties))]
88
[JsonSerializable(typeof(ZIndex))]

0 commit comments

Comments
 (0)