Skip to content
This repository has been archived by the owner on Aug 30, 2024. It is now read-only.

Commit

Permalink
switch to maui class library, add msix files
Browse files Browse the repository at this point in the history
  • Loading branch information
codymullins committed Apr 12, 2022
1 parent 67cb94d commit 869b4df
Show file tree
Hide file tree
Showing 36 changed files with 195 additions and 63 deletions.
9 changes: 9 additions & 0 deletions eng/export-cert.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
param(
[string]$pw,

[string]$thumbprint
)

$password = ConvertTo-SecureString -String $pw -Force -AsPlainText

Export-PfxCertificate -cert "Cert:\CurrentUser\My\${thumbprint}" -FilePath certificate.pfx -Password $password
1 change: 1 addition & 0 deletions eng/generate-cert.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
New-SelfSignedCertificate -Type Custom -Subject "CN=Spacetime" -KeyUsage DigitalSignature -FriendlyName "Spacetime Certificate" -CertStoreLocation "Cert:\CurrentUser\My" -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}")
8 changes: 8 additions & 0 deletions eng/generate-msix.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
param(
[string]$pw,

[string]$thumbprint
)

$password = ConvertTo-SecureString -String $pw -Force -AsPlainText
msbuild ..\src\Spacetime\Spacetime.csproj /restore /t:Publish /p:TargetFramework=net6.0-windows10.0.19041 /p:configuration=release /p:GenerateAppxPackageOnBuild=true /p:Platform=x64 /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="${thumbprint}" /p:PackageCertificatePassword="${password}"
2 changes: 1 addition & 1 deletion src/Spacetime.Core.Infrastructure/ISpacetimeService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Spacetime.Core
namespace Spacetime.Core.Infrastructure
{
public interface ISpacetimeService
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.Infrastructure
{
// All the code in this file is only included on Android.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.Infrastructure
{
// All the code in this file is only included on Mac Catalyst.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.Infrastructure
{
// All the code in this file is only included on Windows.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.Infrastructure
{
// All the code in this file is only included on iOS.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

</Project>
2 changes: 1 addition & 1 deletion src/Spacetime.Core.Infrastructure/SpacetimeRequest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Text;
using System.Threading.Tasks;

namespace Spacetime.Core
namespace Spacetime.Core.Infrastructure
{
public class SpacetimeRequest
{
Expand Down
2 changes: 1 addition & 1 deletion src/Spacetime.Core.Infrastructure/SpacetimeResponse.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Spacetime.Core
namespace Spacetime.Core.Infrastructure
{
public class SpacetimeResponse
{
Expand Down
2 changes: 1 addition & 1 deletion src/Spacetime.Core.Infrastructure/SpacetimeStatus.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Spacetime.Core
namespace Spacetime.Core.Infrastructure
{
public enum SpacetimeStatus
{
Expand Down
2 changes: 1 addition & 1 deletion src/Spacetime.Core.Tests/UrlBuilderTests.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Xunit;
using FluentAssertions;

using Spacetime.Core.Infrastructure;
namespace Spacetime.Core.Tests
{
public class UrlBuilderTests
Expand Down
7 changes: 7 additions & 0 deletions src/Spacetime.Core.gRPC/Platforms/Android/PlatformClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.gRPC
{
// All the code in this file is only included on Android.
public class PlatformClass1
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.gRPC
{
// All the code in this file is only included on Mac Catalyst.
public class PlatformClass1
{
}
}
7 changes: 7 additions & 0 deletions src/Spacetime.Core.gRPC/Platforms/Windows/PlatformClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.gRPC
{
// All the code in this file is only included on Windows.
public class PlatformClass1
{
}
}
7 changes: 7 additions & 0 deletions src/Spacetime.Core.gRPC/Platforms/iOS/PlatformClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core.gRPC
{
// All the code in this file is only included on iOS.
public class PlatformClass1
{
}
}
34 changes: 21 additions & 13 deletions src/Spacetime.Core.gRPC/Spacetime.Core.gRPC.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<ItemGroup>
<ProjectReference Include="..\Spacetime.Core.Infrastructure\Spacetime.Core.Infrastructure.csproj" />
</ItemGroup>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

<ItemGroup>
<Reference Include="Spacetime.gRPC.Wrapper">
<HintPath>..\..\lib\grpc-wrapper\Spacetime.gRPC.Wrapper.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Spacetime.Core.Infrastructure\Spacetime.Core.Infrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<Reference Include="Spacetime.gRPC.Wrapper">
<HintPath>..\..\lib\grpc-wrapper\Spacetime.gRPC.Wrapper.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
7 changes: 7 additions & 0 deletions src/Spacetime.Core/Platforms/Android/PlatformClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core
{
// All the code in this file is only included on Android.
public class PlatformClass1
{
}
}
7 changes: 7 additions & 0 deletions src/Spacetime.Core/Platforms/MacCatalyst/PlatformClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core
{
// All the code in this file is only included on Mac Catalyst.
public class PlatformClass1
{
}
}
7 changes: 7 additions & 0 deletions src/Spacetime.Core/Platforms/Windows/PlatformClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core
{
// All the code in this file is only included on Windows.
public class PlatformClass1
{
}
}
7 changes: 7 additions & 0 deletions src/Spacetime.Core/Platforms/iOS/PlatformClass1.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace Spacetime.Core
{
// All the code in this file is only included on iOS.
public class PlatformClass1
{
}
}
2 changes: 1 addition & 1 deletion src/Spacetime.Core/Services/RequestService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using LiteDB;

using Spacetime.Core.Infrastructure;
namespace Spacetime.Core.Services;

public class RequestService
Expand Down
41 changes: 22 additions & 19 deletions src/Spacetime.Core/Spacetime.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<TargetFrameworks>net6.0;net6.0-android;net6.0-ios;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<ItemGroup>
<PackageReference Include="Flurl" Version="3.0.4" />
<PackageReference Include="Google.Protobuf" Version="3.19.4" />
<PackageReference Include="Grpc.Net.Client" Version="2.44.0" />
<PackageReference Include="Grpc.Tools" Version="2.45.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="LiteDB" Version="5.0.11" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.17763.0</TargetPlatformMinVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Flurl" Version="3.0.4" />
<PackageReference Include="LiteDB" Version="5.0.11" />
<PackageReference Include="YamlDotNet" Version="11.2.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Spacetime.Core.Infrastructure\Spacetime.Core.Infrastructure.csproj" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Spacetime.Core.Infrastructure\Spacetime.Core.Infrastructure.csproj" />
</ItemGroup>
</Project>
4 changes: 3 additions & 1 deletion src/Spacetime.Core/SpacetimeGrpcService.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace Spacetime.Core
using Spacetime.Core.Infrastructure;

namespace Spacetime.Core
{
public class SpacetimeGrpcService : ISpacetimeService
{
Expand Down
2 changes: 1 addition & 1 deletion src/Spacetime.Core/SpacetimeRestService.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using System.Diagnostics;

using Spacetime.Core.Infrastructure;
namespace Spacetime.Core
{

Expand Down
1 change: 1 addition & 0 deletions src/Spacetime.Core/UrlBuilder.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Flurl;
using Spacetime.Core.Infrastructure;

namespace Spacetime.Core
{
Expand Down
32 changes: 16 additions & 16 deletions src/Spacetime.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spacetime", "Spacetime\Spacetime.csproj", "{A0652C85-FC89-46DB-AD5F-8F44EE90BA4D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spacetime.Core", "Spacetime.Core\Spacetime.Core.csproj", "{E4720514-CC46-4B39-9231-029B0CCC589B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spacetime.Core.Tests", "Spacetime.Core.Tests\Spacetime.Core.Tests.csproj", "{FD7290DA-827A-4A05-8A2A-13BD7E5F06C7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spacetime.Core.gRPC", "Spacetime.Core.gRPC\Spacetime.Core.gRPC.csproj", "{F8A0E626-189B-4BD8-8541-BE63D15B68CC}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spacetime.Core", "Spacetime.Core\Spacetime.Core.csproj", "{723C26F4-2ECB-47D7-B783-E4055C42615E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Spacetime.Core.Infrastructure", "Spacetime.Core.Infrastructure\Spacetime.Core.Infrastructure.csproj", "{B2B16B29-C4A8-471D-85AE-4A9B6FD417EA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spacetime.Core.gRPC", "Spacetime.Core.gRPC\Spacetime.Core.gRPC.csproj", "{59E4197B-63DA-4190-988D-25810A2E91E2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spacetime.Core.Tests", "Spacetime.Core.Tests\Spacetime.Core.Tests.csproj", "{FD7290DA-827A-4A05-8A2A-13BD7E5F06C7}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Spacetime.Core.Infrastructure", "Spacetime.Core.Infrastructure\Spacetime.Core.Infrastructure.csproj", "{8AE0AAC1-F3DF-4E02-B4D2-E6AB69FB7DA9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -24,22 +24,22 @@ Global
{A0652C85-FC89-46DB-AD5F-8F44EE90BA4D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A0652C85-FC89-46DB-AD5F-8F44EE90BA4D}.Release|Any CPU.Build.0 = Release|Any CPU
{A0652C85-FC89-46DB-AD5F-8F44EE90BA4D}.Release|Any CPU.Deploy.0 = Release|Any CPU
{E4720514-CC46-4B39-9231-029B0CCC589B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E4720514-CC46-4B39-9231-029B0CCC589B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E4720514-CC46-4B39-9231-029B0CCC589B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E4720514-CC46-4B39-9231-029B0CCC589B}.Release|Any CPU.Build.0 = Release|Any CPU
{F8A0E626-189B-4BD8-8541-BE63D15B68CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F8A0E626-189B-4BD8-8541-BE63D15B68CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F8A0E626-189B-4BD8-8541-BE63D15B68CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F8A0E626-189B-4BD8-8541-BE63D15B68CC}.Release|Any CPU.Build.0 = Release|Any CPU
{B2B16B29-C4A8-471D-85AE-4A9B6FD417EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2B16B29-C4A8-471D-85AE-4A9B6FD417EA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2B16B29-C4A8-471D-85AE-4A9B6FD417EA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2B16B29-C4A8-471D-85AE-4A9B6FD417EA}.Release|Any CPU.Build.0 = Release|Any CPU
{FD7290DA-827A-4A05-8A2A-13BD7E5F06C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FD7290DA-827A-4A05-8A2A-13BD7E5F06C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD7290DA-827A-4A05-8A2A-13BD7E5F06C7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD7290DA-827A-4A05-8A2A-13BD7E5F06C7}.Release|Any CPU.Build.0 = Release|Any CPU
{723C26F4-2ECB-47D7-B783-E4055C42615E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{723C26F4-2ECB-47D7-B783-E4055C42615E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{723C26F4-2ECB-47D7-B783-E4055C42615E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{723C26F4-2ECB-47D7-B783-E4055C42615E}.Release|Any CPU.Build.0 = Release|Any CPU
{59E4197B-63DA-4190-988D-25810A2E91E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{59E4197B-63DA-4190-988D-25810A2E91E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{59E4197B-63DA-4190-988D-25810A2E91E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{59E4197B-63DA-4190-988D-25810A2E91E2}.Release|Any CPU.Build.0 = Release|Any CPU
{8AE0AAC1-F3DF-4E02-B4D2-E6AB69FB7DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8AE0AAC1-F3DF-4E02-B4D2-E6AB69FB7DA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AE0AAC1-F3DF-4E02-B4D2-E6AB69FB7DA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AE0AAC1-F3DF-4E02-B4D2-E6AB69FB7DA9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions src/Spacetime/Pages/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

@using Spacetime.Core
@using Spacetime.Core.Services
@using Spacetime.Core.Infrastructure;
@using Spacetime.Shared.Components
@using Spacetime.Shared.Components.Display
@using Spacetime.Shared.Components.Inputs
Expand Down
4 changes: 2 additions & 2 deletions src/Spacetime/Platforms/Windows/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@

<Identity
Name="4E06626E-0B14-40DD-8051-BC0A5F5992FB"
Publisher="CN=User Name"
Publisher="CN=Spacetime"
Version="1.0.0.0" />

<Properties>
<DisplayName>Spacetime</DisplayName>
<PublisherDisplayName>Microsoft</PublisherDisplayName>
<PublisherDisplayName>Spacetime Software</PublisherDisplayName>
<Logo>appiconStoreLogo.png</Logo>
</Properties>

Expand Down
2 changes: 2 additions & 0 deletions src/Spacetime/Shared/Components/NewRequestModal.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
@using Spacetime.Shared.Components.Containers.Modal
@using Spacetime.Shared.Components.Display
@using Spacetime.Core.Infrastructure;

@if (IsVisible)
{
<Modal Title="New Request" @bind-IsVisible="@IsVisible">
Expand Down
1 change: 1 addition & 0 deletions src/Spacetime/Shared/Components/Panes/GrpcPane.razor
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@using Spacetime.Core.gRPC
@using Spacetime.Shared.Components.Display
@using Spacetime.Shared.Icons
@using Spacetime.Core.Infrastructure;

@inject IGrpcExplorer GrpcExplorer
@inject RequestService RequestService
Expand Down
Loading

0 comments on commit 869b4df

Please sign in to comment.