Skip to content

Commit

Permalink
feat: update to bit 8.1.0 #29 (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi authored Nov 22, 2023
1 parent 8ca4616 commit 4dfcb05
Show file tree
Hide file tree
Showing 189 changed files with 4,262 additions and 5,552 deletions.
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"hostRequirements": {
"cpus": 4
},
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/9144f37e-b370-41ee-a86f-2d2a69251652/bc1d544112ec134184a5aec7f7a1eaf9/dotnet-sdk-8.0.100-rc.2.23502.2-linux-x64.tar.gz -O $HOME/dotnet.tar.gz && export DOTNET_ROOT=$HOME/.dotnet && mkdir -p \"$DOTNET_ROOT\" && tar zxf $HOME/dotnet.tar.gz -C \"$DOTNET_ROOT\" && export PATH=$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH && dotnet dev-certs https --trust && dotnet tool install --global dotnet-ef --version 8.0.0-rc.1.23419.6 && dotnet ef database update --project src/Server/Api/Bit.TemplatePlayground.Server.Api.csproj && dotnet build src/Client/Web/Bit.TemplatePlayground.Client.Web.csproj -t:BeforeBuildTasks --no-restore",
"onCreateCommand": "wget https://download.visualstudio.microsoft.com/download/pr/5226a5fa-8c0b-474f-b79a-8984ad7c5beb/3113ccbf789c9fd29972835f0f334b7a/dotnet-sdk-8.0.100-linux-x64.tar.gz -O $HOME/dotnet.tar.gz && export DOTNET_ROOT=$HOME/.dotnet && mkdir -p \"$DOTNET_ROOT\" && tar zxf $HOME/dotnet.tar.gz -C \"$DOTNET_ROOT\" && export PATH=$DOTNET_ROOT:$DOTNET_ROOT/tools:$PATH && dotnet dev-certs https --trust && dotnet tool install --global dotnet-ef --version 8.0.0 && dotnet ef database update --project src/Server/Api/Bit.TemplatePlayground.Server.Api.csproj && dotnet build src/Client/Web/Bit.TemplatePlayground.Client.Web.csproj -t:BeforeBuildTasks --no-restore",
"waitFor": "onCreateCommand",
"customizations": {
"codespaces": {
"openFiles": [
"src/Client/Core/Pages/Home/HomePage.razor"
"src/Client/Core/Pages/HomePage.razor"
]
},
"vscode": {
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ name: Bit.TemplatePlayground CD

env:
WEB_APP_DEPLOYMENT_TYPE: 'Spa'
API_SERVER_ADDRESS: 'https://bit.templateplayground.bitplatform.dev/api/'
APP_SERVICE_NAME: 'app-service-ad-test'
API_SERVER_ADDRESS: 'https://bp.bitplatform.dev/api/'
APP_SERVICE_NAME: 'app-service-bp-test'
IOS_CODE_SIGN_PROVISION: 'Bit.TemplatePlayground'

on:
Expand Down Expand Up @@ -35,6 +35,13 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: 18

- name: Update appsettings.json api server address
uses: microsoft/variable-substitution@v1
with:
files: 'src/Client/Core/appsettings.json'
env:
ApiServerAddress: ${{ env.API_SERVER_ADDRESS }}

- name: Switch to blazor web assembly
run: sed -i 's/Microsoft.NET.Sdk.Web/Microsoft.NET.Sdk.BlazorWebAssembly/g' src/Client/Web/Bit.TemplatePlayground.Client.Web.csproj
Expand Down Expand Up @@ -90,7 +97,7 @@ jobs:
files: 'appsettings.json'
env:
ConnectionStrings.SqlServerConnectionString: ${{ secrets.DB_CONNECTION_STRING }}
AppSettings.JwtSettings.IdentityCertificatePassword: ${{ secrets.API_IDENTITY_CERTIFICATE_PASSWORD }}
AppSettings.IdentitySettings.IdentityCertificatePassword: ${{ secrets.API_IDENTITY_CERTIFICATE_PASSWORD }}

- name: Delete IdentityCertificate.pfx
run: |
Expand Down Expand Up @@ -262,6 +269,10 @@ jobs:
with:
global-json-file: global.json

- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: '15'

- uses: actions/setup-node@v3
with:
node-version: 18
Expand Down Expand Up @@ -292,7 +303,7 @@ jobs:
- name: Download Apple Provisioning Profiles
uses: Apple-Actions/download-provisioning-profiles@v1
with:
bundle-id: 'com.bitplatform.Bit.TemplatePlayground.Template'
bundle-id: 'com.bitplatform.BP.Template'
issuer-id: ${{ secrets.APPSTORE_API_KEY_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_API_KEY_PRIVATE_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"cwd": "${workspaceFolder}/src/Server/Api",
"program": "dotnet",
"args": [
"watch",
"run",
"--project",
".",
"verbose"
Expand Down
57 changes: 57 additions & 0 deletions Bit.TemplatePlayground.slnLaunch
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
[
{
"Name": "Api \u002B Blazor Hybrid",
"Projects": [
{
"Name": "src\\Server\\Api\\Bit.TemplatePlayground.Server.Api.csproj",
"Action": "Start",
"DebugTarget": "Bit.TemplatePlayground.Server.Api-Swagger"
},
{
"Name": "src\\Client\\App\\Bit.TemplatePlayground.Client.App.csproj",
"Action": "Start",
"DebugTarget": "Windows Machine"
}
]
},
{
"Name": "Api \u002B Blazor Server",
"Projects": [
{
"Name": "src\\Server\\Api\\Bit.TemplatePlayground.Server.Api.csproj",
"Action": "Start",
"DebugTarget": "Bit.TemplatePlayground.Server.Api-Swagger"
},
{
"Name": "src\\Client\\Web\\Bit.TemplatePlayground.Client.Web.csproj",
"Action": "Start",
"DebugTarget": "Bit.TemplatePlayground.Client.Web"
}
]
},
{
"Name": "Api \u002B Blazor Wasm",
"Projects": [
{
"Name": "src\\Server\\Api\\Bit.TemplatePlayground.Server.Api.csproj",
"Action": "Start",
"DebugTarget": "Bit.TemplatePlayground.Server.Api-BlazorWebAssembly"
}
]
},
{
"Name": "Api \u002B Blazor Electron",
"Projects": [
{
"Name": "src\\Server\\Api\\Bit.TemplatePlayground.Server.Api.csproj",
"Action": "Start",
"DebugTarget": "Bit.TemplatePlayground.Server.Api-Swagger"
},
{
"Name": "src\\Client\\Web\\Bit.TemplatePlayground.Client.Web.csproj",
"Action": "Start",
"DebugTarget": "Bit.TemplatePlayground.Client.Web.Electron"
}
]
}
]
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.100-rc.2.23502.2",
"version": "8.0.100",
"rollForward": "disable"
}
}
31 changes: 15 additions & 16 deletions src/Client/App/Bit.TemplatePlayground.Client.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<ApplicationTitle>Bit.TemplatePlayground</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.bitplatform.Bit.TemplatePlayground.Template</ApplicationId>
<ApplicationIdGuid>2CF3C9D5-3732-41B7-95A7-77338B8C8474</ApplicationIdGuid>
<ApplicationId>com.bitplatform.BP.Template</ApplicationId>
<ApplicationIdGuid>11F05C30-B7FE-415E-AABC-21FF361FB5FE</ApplicationIdGuid>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
Expand All @@ -26,7 +26,6 @@
<UseInterpreter Condition="'$(Configuration)' == 'Debug'">True</UseInterpreter>

<NoWarn>$(NoWarn);ClassWithoutModifierAnalyzer</NoWarn>
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-android')) and '$(Configuration)' == 'Release'">
Expand All @@ -40,8 +39,8 @@
<PropertyGroup Condition="$(TargetFramework.Contains('-ios')) and '$(Configuration)' == 'Release'">
<MtouchEnableSGenConc>true</MtouchEnableSGenConc>
<EnableSGenConc>True</EnableSGenConc>
<MtouchInterpreter>all</MtouchInterpreter>
</PropertyGroup>
<MtouchInterpreter>all</MtouchInterpreter>
</PropertyGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-android'))">
<AndroidAotProfile Condition="Exists('custom.aprof')" Include="custom.aprof" />
Expand All @@ -65,12 +64,12 @@

<!-- App icon for all platforms -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" Color="#0065EF" />

<!-- Customize App icon for Android -->
<MauiIcon Condition="$(TargetFramework.Contains('-android'))" Update="Resources\AppIcon\appicon.svg" Color="#0065EF" ForegroundScale="0.68" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#002A66" BaseSize="128,128" />
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#0D2960" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
Expand All @@ -83,14 +82,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bit.BlazorUI" Version="7.1.0" />
<PackageReference Include="Bit.BlazorUI.Icons" Version="7.1.0" />
<PackageReference Include="Bit.BlazorUI.Assets" Version="7.1.0" />
<PackageReference Include="Bit.CodeAnalyzers" Version="7.1.0">
<PackageReference Include="Bit.BlazorUI" Version="8.1.0" />
<PackageReference Include="Bit.BlazorUI.Icons" Version="8.1.0" />
<PackageReference Include="Bit.BlazorUI.Assets" Version="8.1.0" />
<PackageReference Include="Bit.CodeAnalyzers" Version="8.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Bit.SourceGenerators" Version="7.1.0">
<PackageReference Include="Bit.SourceGenerators" Version="8.1.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -102,10 +101,10 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.0-rc.2.9373" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.0-rc.2.9373" />
<PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.0-rc.2.9373" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.0-rc.2.9373" />
<PackageReference Include="Microsoft.Maui.Controls" Version="8.0.3" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="8.0.3" />
<PackageReference Include="Microsoft.Maui.Essentials" Version="8.0.3" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebView.Maui" Version="8.0.3" />
</ItemGroup>

<!-- Build Properties must be defined within these property groups to ensure successful publishing
Expand Down
4 changes: 2 additions & 2 deletions src/Client/App/Extensions/IServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ public static IServiceCollection AddClientAppServices(this IServiceCollection se
services.AddClientWindowsServices();
#endif

services.AddScoped<MainPage>();
services.AddTransient<MainPage>();
services.AddSingleton<IBitDeviceCoordinator, AppDeviceCoordinator>();
services.AddScoped<IExceptionHandler, AppExceptionHandler>();
services.AddTransient<IExceptionHandler, AppExceptionHandler>();

return services;
}
Expand Down
8 changes: 4 additions & 4 deletions src/Client/App/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private void SetupBlazorWebView()
handler.PlatformView.Configuration.AllowsInlineMediaPlayback = true;

handler.PlatformView.ScrollView.Bounces = false;

handler.PlatformView.BackgroundColor = UIKit.UIColor.Clear;
handler.PlatformView.Opaque = false;
#if DEBUG
Expand All @@ -41,9 +41,9 @@ private void SetupBlazorWebView()
#endif
#elif ANDROID
handler.PlatformView.SetBackgroundColor(Android.Graphics.Color.Transparent);

handler.PlatformView.OverScrollMode = Android.Views.OverScrollMode.Never;

Android.Webkit.WebSettings settings = handler.PlatformView.Settings;

settings.AllowFileAccessFromFileURLs =
Expand All @@ -68,7 +68,7 @@ private void SetupBlazorWebView()
try
{
#if WINDOWS && RELEASE
var webView2 = (Microsoft.UI.Xaml.Controls.WebView2)blazorWebView.Handler.PlatformView;
var webView2 = (Microsoft.UI.Xaml.Controls.WebView2)blazorWebView.Handler!.PlatformView!;
await webView2.EnsureCoreWebView2Async();

var settings = webView2.CoreWebView2.Settings;
Expand Down
13 changes: 8 additions & 5 deletions src/Client/App/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

using System.Reflection;
using Bit.TemplatePlayground.Client.Core.Services.HttpMessageHandlers;
using Microsoft.Extensions.FileProviders;

namespace Bit.TemplatePlayground.Client.App;
Expand All @@ -17,7 +18,7 @@ public static MauiApp CreateMauiApp()

builder
.UseMauiApp<App>()
.Configuration.AddJsonFile(new EmbeddedFileProvider(assembly), "appsettings.json", optional: false, false);
.Configuration.AddClientConfigurations();

var services = builder.Services;

Expand All @@ -26,13 +27,15 @@ public static MauiApp CreateMauiApp()
services.AddBlazorWebViewDeveloperTools();
#endif

services.AddScoped(sp =>
Uri.TryCreate(builder.Configuration.GetApiServerAddress(), UriKind.Absolute, out var apiServerAddress);

services.AddTransient(sp =>
{
HttpClient httpClient = new(sp.GetRequiredService<AppHttpClientHandler>())
var handler = sp.GetRequiredService<RequestHeadersDelegationHandler>();
HttpClient httpClient = new(handler)
{
BaseAddress = new Uri(sp.GetRequiredService<IConfiguration>().GetApiServerAddress())
BaseAddress = apiServerAddress
};

return httpClient;
});

Expand Down
6 changes: 3 additions & 3 deletions src/Client/App/Platforms/Android/Resources/values/colors.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#002A66</color>
<color name="colorPrimaryDark">#002A66</color>
<color name="colorAccent">#002A66</color>
<color name="colorPrimary">#0D2960</color>
<color name="colorPrimaryDark">#0D2960</color>
<color name="colorAccent">#0D2960</color>
</resources>
4 changes: 2 additions & 2 deletions src/Client/App/Platforms/Tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.bitplatform.Bit.TemplatePlayground.Template" version="1.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<manifest package="com.bitplatform.BP.Template" version="1.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="com.bitplatform.Bit.TemplatePlayground.Template" exec="Bit.TemplatePlayground.Client.App.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<ui-application appid="com.bitplatform.BP.Template" exec="Bit.TemplatePlayground.Client.App.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>Bit.TemplatePlayground.Client.App</label>
<icon>appicon.xhigh.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
Expand Down
Loading

0 comments on commit 4dfcb05

Please sign in to comment.