ファイル
ComputeSharp/build/CreateBlankServiceTokens.ps1
T

40 行
1.2 KiB
PowerShell

# Create the service tokens folder
$SERVICE_TOKENS_FOLDER_RELATIVE_PATH = Join-Path -Path $PSScriptRoot -ChildPath "..\samples\ComputeSharp.SwapChain.Uwp\Assets\Generated"
if(!(Test-Path -Path $SERVICE_TOKENS_FOLDER_RELATIVE_PATH)) {
New-Item -ItemType directory -Path $SERVICE_TOKENS_FOLDER_RELATIVE_PATH
}
$SERVICE_TOKENS_FOLDER_PATH = Resolve-Path -Path $SERVICE_TOKENS_FOLDER_RELATIVE_PATH
# Service tokens
$SERVICE_TOKENS_NAME = "ServiceTokens.g.cs"
$SERVICE_TOKENS_PATH = Join-Path -Path $SERVICE_TOKENS_FOLDER_PATH -ChildPath $SERVICE_TOKENS_NAME
if (!(Test-Path -Path $SERVICE_TOKENS_PATH))
{
# Prepare the generated source
$SERVICE_TOKENS_TEXT =
@"
// <auto-generated/>
#pragma warning disable
#nullable enable
namespace ComputeSharp.SwapChain.Uwp;
/// <summary>
/// A <see langword="class"/> with some secret service tokens.
/// </summary>
public static class ServiceTokens
{
/// <summary>
/// The secret token for the AppService connection.
/// </summary>
#if RELEASE
internal const string AppService = "<APP_CENTER_TOKEN>";
#else
internal const string AppService = "";
#endif
}
"@.Trim()
# Output the source to the target file
Add-Content $SERVICE_TOKENS_TEXT -Path $SERVICE_TOKENS_PATH -NoNewline
}