Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Arawn Davies authored Apr 3, 2018
2 parents 8c70d57 + 743fd48 commit f851d5d
Show file tree
Hide file tree
Showing 113 changed files with 2,839 additions and 1,800 deletions.
60 changes: 56 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,63 @@ root = true
[*]
insert_final_newline = true
indent_style = space
indent_size = 2
indent_size = 4
trim_trailing_whitespace = true

[*.cs]
indent_size = 4
csharp_style_conditional_delegate_call = true:suggestion
csharp_style_expression_bodied_accessors = true:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_indexers = true:suggestion
csharp_style_expression_bodied_methods = true:none
csharp_style_expression_bodied_operators = false:none
csharp_style_expression_bodied_properties = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_throw_expression = true:suggestion
csharp_style_var_elsewhere = true:none
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:warning

csharp_indent_block_contents = true:warning
csharp_indent_braces = false:warning
csharp_indent_case_contents = true:warning
csharp_indent_switch_labels = true:warning

csharp_prefer_braces = true:warning
csharp_prefer_simple_default_expression = false:suggestion

csharp_space_after_cast = false:warning
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_colon_in_inheritance_clause = true:warning
csharp_space_after_comma = true:warning
csharp_space_after_dot = false:error
csharp_space_after_semicolon_in_for_statement = true:warning
csharp_space_before_colon_in_inheritance_clause = true:warning
csharp_space_before_comma = false:warning
csharp_space_before_dot = false:error
csharp_space_before_open_square_brackets = true:warning
csharp_space_before_semicolon_in_for_statement = false:error

[*.{cs,vb}]
dotnet_sort_system_directives_first = true

dotnet_style_coalesce_expression = true:warning
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:warning
dotnet_style_null_propagation = true:suggestion
dotnet_style_object_initializer = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
dotnet_style_predefined_type_for_member_access = false:warning
dotnet_style_qualification_for_event = false:warning
dotnet_style_qualification_for_field = false:warning
dotnet_style_qualification_for_method = false:warning

dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_symbols.properties.applicable_kinds = property

[*.csproj]
indent_size = 2
dotnet_naming_rule.properties_must_be_pascal_case.severity = warning
dotnet_naming_rule.properties_must_be_pascal_case.symbols = properties
dotnet_naming_rule.properties_must_be_pascal_case.style = pascal_case
1 change: 1 addition & 0 deletions Build/Targets/Import.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

<Import Project="StrongName.targets" />

<Import Project="Templates.targets" Condition="'$(IsTemplatesProject)' == 'True'" />
<Import Project="Tests.targets" Condition="'$(IsTestProject)' == 'True'" />
<Import Project="VSIX.targets" Condition="'$(IsVsixProject)' == 'True'" />

Expand Down
42 changes: 42 additions & 0 deletions Build/Targets/Templates.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<Project>

<PropertyGroup>
<TargetFramework>netstandard1.0</TargetFramework>
<PackageOutputPath>$(ArtifactsDir)packages\</PackageOutputPath>
<NoBuild>True</NoBuild>
<IncludeBuildOutput>False</IncludeBuildOutput>
</PropertyGroup>

<PropertyGroup>
<PackageInstallationDir>$(UserProfile)\.cosmos\packages\</PackageInstallationDir>
</PropertyGroup>

<ItemGroup>
<Content Include="content\**" Pack="True" PackagePath="content\" />
</ItemGroup>

<Target Name="InstallTemplates" DependsOnTargets="Pack">

<MakeDir Directories="$(PackageInstallationDir)" />

<MSBuild Projects="$(MSBuildProjectFullPath)"
Targets="_GetOutputItemsFromPack">
<Output TaskParameter="TargetOutputs" ItemName="PackageFile" />
</MSBuild>

<ItemGroup>
<PackageFile Remove="@(PackageFile)" Condition="'%(Extension)' != '.nupkg'" />
</ItemGroup>

<PropertyGroup>
<TemplatePackagePath>@(PackageFile)</TemplatePackagePath>
</PropertyGroup>

<Copy SourceFiles="@(TemplatePackagePath)"
DestinationFolder="$(PackageInstallationDir)" />

<Exec Command="dotnet new -i $(PackageInstallationDir)$([System.IO.Path]::GetFilename('$(TemplatePackagePath)'))" />

</Target>

</Project>
2 changes: 0 additions & 2 deletions Build/Targets/Workarounds.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<Project>

<Import Project="$(BaseIntermediateOutputPath)*.nuget.g.props" Condition="'$(MSBuildProjectExtension)' == '.tmp_proj'" />

<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.tmp_proj'">
<LanguageTargets>$(MSBuildToolsPath)\Microsoft.CSharp.targets</LanguageTargets>
</PropertyGroup>
Expand Down
2 changes: 0 additions & 2 deletions Build/Targets/Workarounds.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,4 @@
</PropertyGroup>
</Target>

<Import Project="$(BaseIntermediateOutputPath)*.nuget.g.targets" Condition="'$(MSBuildProjectExtension)' == '.tmp_proj'" />

</Project>
Binary file removed Build/Tools/vswhere.exe
Binary file not shown.
11 changes: 4 additions & 7 deletions Builder.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Build.Builder", "source\Cosmos.Build.Builder\Cosmos.Build.Builder.csproj", "{74A9329A-2B0B-4C0A-976C-E4FB7228D8B2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Cosmos.Build.Installer", "source\Cosmos.Build.Installer\Cosmos.Build.Installer.csproj", "{27D94586-FE88-4203-BE6A-C99013FD5018}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Cosmos.Build.Builder", "source\Cosmos.Build.Builder\Cosmos.Build.Builder.csproj", "{74A9329A-2B0B-4C0A-976C-E4FB7228D8B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -17,12 +15,11 @@ Global
{74A9329A-2B0B-4C0A-976C-E4FB7228D8B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{74A9329A-2B0B-4C0A-976C-E4FB7228D8B2}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{74A9329A-2B0B-4C0A-976C-E4FB7228D8B2}.Release|Any CPU.Build.0 = Debug|Any CPU
{27D94586-FE88-4203-BE6A-C99013FD5018}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27D94586-FE88-4203-BE6A-C99013FD5018}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27D94586-FE88-4203-BE6A-C99013FD5018}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{27D94586-FE88-4203-BE6A-C99013FD5018}.Release|Any CPU.Build.0 = Debug|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B29ACE62-94D5-4A06-A6C9-608A199BE0E3}
EndGlobalSection
EndGlobal
4 changes: 2 additions & 2 deletions Demos/CosmosGraphicSubsystem/CosmosGraphicSubsystem.csproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<USB_Name>CosmosGraphicSubsystemBoot</USB_Name>
<Bochs_Name>CosmosGraphicSubsystemBoot</Bochs_Name>
<VMware_Name>CosmosGraphicSubsystemBoot</VMware_Name>
<USB_Name>CosmosGraphicSubsystemBoot</USB_Name>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion Demos/Guess/GuessKernel.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.Net.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<TargetFramework>netcoreapp2.0</TargetFramework>
</PropertyGroup>

<PropertyGroup>
Expand Down
2 changes: 2 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<PropertyGroup>
<RepoRoot>$(MSBuildThisFileDirectory)</RepoRoot>
<IL2CPURepoRoot>$(RepoRoot)..\IL2CPU\</IL2CPURepoRoot>
<XSharpRepoRoot>$(RepoRoot)..\XSharp\</XSharpRepoRoot>
</PropertyGroup>

<Import Project="build\Targets\Import.props" />
Expand Down
1 change: 0 additions & 1 deletion Setup/Cosmos.iss
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ Source: ".\Build\Tools\NAsm\*.exe"; DestDir: "{app}\Build\Tools\NAsm"; Flags: ig
Source: ".\Build\Tools\Cygwin\*"; DestDir: "{app}\Build\Tools\cygwin"; Flags: ignoreversion uninsremovereadonly overwritereadonly
Source: ".\Build\Tools\mkisofs\*"; DestDir: "{app}\Build\Tools\mkisofs"; Flags: ignoreversion uninsremovereadonly overwritereadonly
Source: ".\Build\VSIP\IL2CPU\*"; DestDir: "{app}\Build\IL2CPU"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\NASM\*"; DestDir: "{app}\Build\NASM"; Flags: ignoreversion uninsremovereadonly
;Source: ".\Build\VSIP\XSharp\*"; DestDir: "{app}\Build\XSharp"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Deploy.USB.exe"; DestDir: "{app}\Build\Tools"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Deploy.Pixie.exe"; DestDir: "{app}\Build\Tools"; Flags: ignoreversion uninsremovereadonly
Expand Down
6 changes: 3 additions & 3 deletions Tests/Cosmos.TestRunner.Core/Cosmos.TestRunner.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\IL2CPU\source\Cosmos.IL2CPU\Cosmos.IL2CPU.csproj" />
<ProjectReference Include="..\..\..\IL2CPU\source\IL2CPU.API\IL2CPU.API.csproj" />
<ProjectReference Include="..\..\..\XSharp\source\XSharp.Assembler\XSharp.Assembler.csproj" />
<ProjectReference Include="..\..\source\Cosmos.Build.Common\Cosmos.Build.Common.csproj" />
<ProjectReference Include="..\..\source\Cosmos.Core_Asm\Cosmos.Core_Asm.csproj" />
<ProjectReference Include="..\..\source\Cosmos.Debug.DebugConnectors\Cosmos.Debug.DebugConnectors.csproj" />
Expand All @@ -46,6 +43,9 @@
<ProjectReference Include="..\Cosmos.TestRunner.TestController\Cosmos.TestRunner.TestController.csproj" />
<ProjectReference Include="..\GraphicTest\GraphicTest.csproj" />
<ProjectReference Include="..\SimpleStructsAndArraysTest\SimpleStructsAndArraysTest.csproj" />
<ProjectReference Include="$(IL2CPURepoRoot)source\Cosmos.IL2CPU\Cosmos.IL2CPU.csproj" />
<ProjectReference Include="$(IL2CPURepoRoot)source\IL2CPU.API\IL2CPU.API.csproj" />
<ProjectReference Include="$(XSharpRepoRoot)source\XSharp.Assembler\XSharp.Assembler.csproj" />
</ItemGroup>

</Project>
17 changes: 11 additions & 6 deletions Tests/Cosmos.TestRunner.TestController/Assert.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using System;
using System.Runtime.CompilerServices;

namespace Cosmos.TestRunner
{
public static class Assert
{
public static void IsTrue(bool condition, string message)
public static void IsTrue(bool condition, string message, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0)
{
if (condition)
{
Expand All @@ -14,19 +15,21 @@ public static void IsTrue(bool condition, string message)
}
else
{
TestController.Debugger.Send("Assertion failed!:");
TestController.Debugger.Send("Assertion failed:");
TestController.Debugger.Send("File: " + file);
TestController.Debugger.Send("Line number: " + line);
TestController.Debugger.Send(message);
TestController.Failed();
throw new Exception("Assertion failed!");
}
}

public static void IsFalse(bool condition, string message)
public static void IsFalse(bool condition, string message, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0)
{
IsTrue(!condition, message);
IsTrue(!condition, message, file, line);
}

public static void AreEqual(int expected, int actual, string message)
public static void AreEqual(int expected, int actual, string message, [CallerFilePath] string file = null, [CallerLineNumber] int line = 0)
{
var xResult = expected == actual;
if (!xResult)
Expand All @@ -35,11 +38,13 @@ public static void AreEqual(int expected, int actual, string message)
TestController.Debugger.SendNumber((uint) expected);
TestController.Debugger.Send("Actual value");
TestController.Debugger.SendNumber((uint)actual);

TestController.Debugger.SendNumber("TestAssertion", "Expected", (uint)expected, 32);
TestController.Debugger.SendNumber("TestAssertion", "Actual", (uint)actual, 32);

TestController.Debugger.Send("Numbers sent!");
}
IsTrue(xResult, message);
IsTrue(xResult, message, file, line);
}
}
}
2 changes: 1 addition & 1 deletion Tests/Cosmos.TestRunner/Cosmos.TestRunner.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\IL2CPU\source\IL2CPU\IL2CPU.csproj" />
<ProjectReference Include="..\..\source\TheRingMaster\TheRingMaster.csproj" />
<ProjectReference Include="..\..\Tools\NASM\NASM.csproj" />
<ProjectReference Include="..\Cosmos.TestRunner.Core\Cosmos.TestRunner.Core.csproj" />
<ProjectReference Include="$(IL2CPURepoRoot)source\IL2CPU\IL2CPU.csproj" />
</ItemGroup>

</Project>
30 changes: 15 additions & 15 deletions install-VS2017.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@echo off
cls

set DOTNET_VERSION=4.7.1

Expand All @@ -8,30 +7,31 @@ echo Check for installed .NET Framework %DOTNET_VERSION%
reg query "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319\SKUs\.NETFramework,Version=v%DOTNET_VERSION%" /ve >nul 2>&1

if %ERRORLEVEL% neq 0 (
echo .NET Framework %DOTNET_VERSION% is not installed. Please download it from https://www.microsoft.com/net/download/visual-studio-sdks
echo ".NET Framework %DOTNET_VERSION% is not installed. Please download it from https://www.microsoft.com/net/download/visual-studio-sdks"
pause
goto:eof
)

set NuGet=Build\Tools\nuget.exe
set VSWhere=Build\Tools\vswhere.exe

:NuGet
echo Running NuGet restore
%NuGet% restore Builder.sln
set "ARCH=%PROCESSOR_ARCHITECTURE%"
if %ARCH%==x86 set "VSWhere=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"
if %ARCH%==AMD64 set "VSWhere=%ProrgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
REM set "VSWhere=%ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe"

:MSBuild
echo Looking for MSBuild
for /f "usebackq delims=" %%i in (`%VSWhere% -latest -version "[15.0,16.0)" -requires "Microsoft.Component.MSBuild" -property "installationPath"`) do (
for /f "usebackq delims=" %%i in (`^""%VSWhere%" -latest -version "[15.0,16.0)" -products * -requires "Microsoft.Component.MSBuild" -property "installationPath"^"`) do (
set InstallDir=%%i
)

if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
set MSBuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
)
set "MSBuild=%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"

if exist %MSBuild% (
%MSBuild% Builder.sln /nologo /maxcpucount /nodeReuse:false /p:Configuration="Debug" /p:Platform="Any CPU"
if not exist "%MSBuild%" (
echo MSBuild not found. Please make sure Visual Studio 15.2+ is installed.
pause
goto:eof
)

start "Cosmos Builder" "source\Cosmos.Build.Builder\bin\Debug\Cosmos.Build.Builder.exe" "-VSPATH=%InstallDir%" %*
echo Building Builder.sln
"%MSBuild%" Builder.sln /nologo /maxcpucount /nodeReuse:false /verbosity:minimal /t:Restore;Build

start "Cosmos Builder" "source\Cosmos.Build.Builder\bin\Debug\net471\Cosmos.Build.Builder.exe" "-VSPATH=%InstallDir%" %*
2 changes: 0 additions & 2 deletions source/Cosmos.Build.Builder/.editorconfig

This file was deleted.

5 changes: 3 additions & 2 deletions source/Cosmos.Build.Builder/App.xaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<Application x:Class="Cosmos.Build.Builder.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
xmlns:vm="clr-namespace:Cosmos.Build.Builder.ViewModels"
StartupUri="Views/MainWindow.xaml">
<Application.Resources>
<vm:MainWindowViewModel x:Key="MainWindowViewModel" />
</Application.Resources>
</Application>
Loading

0 comments on commit f851d5d

Please sign in to comment.