Skip to content

Commit

Permalink
Improve template & fix settings bug (#1240)
Browse files Browse the repository at this point in the history
* Improve template & fix settings bug

* Add files
  • Loading branch information
AnErrupTion authored Oct 5, 2024
1 parent d0ba383 commit 2130e8d
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "http://json.schemastore.org/dotnetcli.host",
"symbolInfo": {
"BundleQemuWindows": {
"longName": "bundle-qemu-windows"
}
},
"usageExamples": [
""
]
}
12 changes: 12 additions & 0 deletions Source/Mosa.Templates/templates/.template.config/ide.host.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"$schema": "http://json.schemastore.org/ide.host",
"symbolInfo": [
{
"id": "BundleQemuWindows",
"name": {
"text": "Bundle QEMU for Windows"
},
"isVisible": true
}
]
}
10 changes: 10 additions & 0 deletions Source/Mosa.Templates/templates/.template.config/template.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@
"classifications": [ "Common", "OS", "Kernel" ],
"identity": "Mosa.Starter",
"sourceName": "Mosa.Starter",
"defaultName": "MosaKernel",
"name": "MOSA Kernel",
"shortName": "mosakrnl",
"preferNameDirectory": true,
"tags": {
"language": "C#",
"type": "solution"
},
"symbols": {
"BundleQemuWindows": {
"type": "parameter",
"description": "Defines if QEMU for Windows should be bundled by default in the project.",
"datatype": "bool",
"displayName": "Bundle QEMU for Windows",
"defaultValue": "true"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@
<ItemGroup>
<PackageReference Include="Mosa.Platform" Version="*" />
<PackageReference Include="Mosa.DeviceSystem" Version="*" />
<!--#if (BundleQemuWindows) -->
<PackageReference Include="Mosa.Tools.Package.Qemu" Version="*" />
<!--#else -->
<PackageReference Include="Mosa.Tools.Package" Version="*" />
<!--#endif -->
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Source/Mosa.Tool.Bootstrap/Mosa.Tool.Bootstrap.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.3" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.3" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia" Version="11.1.0-beta2" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.0-beta2" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.0-beta2" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0-beta2" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.3" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.3" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Source/Mosa.Tool.Launcher/Mosa.Tool.Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.0.10" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.0.10" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.0.10" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.3" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.3" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.1.3" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions Source/Mosa.Utility.Configuration/MOSASettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1039,9 +1039,9 @@ public static string GetRegistry(string name, string defaultValue)
try
{
return (string)Registry.CurrentUser
.OpenSubKey(WindowsRegistry.Software)
.OpenSubKey(WindowsRegistry.MosaApp)
.GetValue(name, defaultValue);
.OpenSubKey(WindowsRegistry.Software)?
.OpenSubKey(WindowsRegistry.MosaApp)?
.GetValue(name, defaultValue) ?? defaultValue;
}
catch
{
Expand Down

0 comments on commit 2130e8d

Please sign in to comment.