This commit is contained in:
Wiesław Šoltés 2021-10-06 22:19:06 +02:00
Родитель e0ac8550c6
Коммит 855fe7a275
32 изменённых файлов: 572 добавлений и 53 удалений

1
.nuke Normal file
Просмотреть файл

@ -0,0 +1 @@
TypefaceUtil.sln

Просмотреть файл

@ -7,14 +7,66 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypefaceUtil", "src\Typefac
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TypefaceUtil.OpenType", "src\TypefaceUtil.OpenType\TypefaceUtil.OpenType.csproj", "{A97DD9DD-60D0-4D3C-847E-BAF7322BDBAE}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnicodeDataGenerator", "unicode\UnicodeDataGenerator.csproj", "{FB936A0D-7B38-4B6D-9DC4-31D819BEDD82}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{FA0D294D-2942-4349-AC60-BB837AA95DAB}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "unicode", "unicode", "{6CBF405F-FC1E-4595-93B2-94D1D0ECC109}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TypefaceUtil.Avalonia", "src\TypefaceUtil.Avalonia\TypefaceUtil.Avalonia.csproj", "{DDCA69DA-405C-4A3B-AF4F-A969FE107D23}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnicodeDataGenerator", "src\UnicodeDataGenerator\UnicodeDataGenerator.csproj", "{DF30A956-2615-4B4A-A129-981DE567629F}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "build", "build", "{13D366ED-5898-462D-B5F6-BCCDBBCD2C5F}"
ProjectSection(SolutionItems) = preProject
build\TypefaceUtil.public.snk = build\TypefaceUtil.public.snk
.editorconfig = .editorconfig
.nuke = .nuke
build.ps1 = build.ps1
build.sh = build.sh
global.json = global.json
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{24BDDCC3-B076-4684-94AF-8CBDDD2A8EBA}"
ProjectSection(SolutionItems) = preProject
LICENSE.TXT = LICENSE.TXT
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{C2F75A5F-9D68-48E1-AAD5-094542747228}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TypefaceUtil.OpenType.UnitTests", "tests\TypefaceUtil.OpenType.UnitTests\TypefaceUtil.OpenType.UnitTests.csproj", "{80ADDBA5-A00F-4545-8642-951143DA2340}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "git", "git", "{FFC56A7E-7F00-4EAD-827A-6242E9855688}"
ProjectSection(SolutionItems) = preProject
.gitattributes = .gitattributes
.gitignore = .gitignore
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "nuget", "nuget", "{429210F9-1870-4169-B2E1-FD834DB8BE86}"
ProjectSection(SolutionItems) = preProject
nuget.config = nuget.config
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "props", "props", "{57F2A3FD-99C6-4E6A-9813-B9B5F0FBC11D}"
ProjectSection(SolutionItems) = preProject
build\Avalonia.Controls.Skia.props = build\Avalonia.Controls.Skia.props
build\Avalonia.Desktop.props = build\Avalonia.Desktop.props
build\Avalonia.Diagnostics.props = build\Avalonia.Diagnostics.props
build\Avalonia.props = build\Avalonia.props
build\Avalonia.ReactiveUI.props = build\Avalonia.ReactiveUI.props
build\Avalonia.Skia.props = build\Avalonia.Skia.props
build\Avalonia.Xaml.Behaviors.props = build\Avalonia.Xaml.Behaviors.props
build\Base.props = build\Base.props
build\ReferenceAssemblies.props = build\ReferenceAssemblies.props
build\SignAssembly.props = build\SignAssembly.props
build\SkiaSharp.Linux.props = build\SkiaSharp.Linux.props
build\SkiaSharp.props = build\SkiaSharp.props
build\SourceLink.props = build\SourceLink.props
build\Svg.Skia.props = build\Svg.Skia.props
build\System.CommandLine.props = build\System.CommandLine.props
build\System.Text.Json.props = build\System.Text.Json.props
build\XUnit.props = build\XUnit.props
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "_build", "build\build\_build.csproj", "{A66A3423-81AE-43B9-AAA6-0FBC44BE5152}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -29,14 +81,22 @@ Global
{A97DD9DD-60D0-4D3C-847E-BAF7322BDBAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A97DD9DD-60D0-4D3C-847E-BAF7322BDBAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A97DD9DD-60D0-4D3C-847E-BAF7322BDBAE}.Release|Any CPU.Build.0 = Release|Any CPU
{FB936A0D-7B38-4B6D-9DC4-31D819BEDD82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FB936A0D-7B38-4B6D-9DC4-31D819BEDD82}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FB936A0D-7B38-4B6D-9DC4-31D819BEDD82}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FB936A0D-7B38-4B6D-9DC4-31D819BEDD82}.Release|Any CPU.Build.0 = Release|Any CPU
{DDCA69DA-405C-4A3B-AF4F-A969FE107D23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DDCA69DA-405C-4A3B-AF4F-A969FE107D23}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DDCA69DA-405C-4A3B-AF4F-A969FE107D23}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DDCA69DA-405C-4A3B-AF4F-A969FE107D23}.Release|Any CPU.Build.0 = Release|Any CPU
{DF30A956-2615-4B4A-A129-981DE567629F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF30A956-2615-4B4A-A129-981DE567629F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF30A956-2615-4B4A-A129-981DE567629F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF30A956-2615-4B4A-A129-981DE567629F}.Release|Any CPU.Build.0 = Release|Any CPU
{80ADDBA5-A00F-4545-8642-951143DA2340}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{80ADDBA5-A00F-4545-8642-951143DA2340}.Debug|Any CPU.Build.0 = Debug|Any CPU
{80ADDBA5-A00F-4545-8642-951143DA2340}.Release|Any CPU.ActiveCfg = Release|Any CPU
{80ADDBA5-A00F-4545-8642-951143DA2340}.Release|Any CPU.Build.0 = Release|Any CPU
{A66A3423-81AE-43B9-AAA6-0FBC44BE5152}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A66A3423-81AE-43B9-AAA6-0FBC44BE5152}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A66A3423-81AE-43B9-AAA6-0FBC44BE5152}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A66A3423-81AE-43B9-AAA6-0FBC44BE5152}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -44,8 +104,13 @@ Global
GlobalSection(NestedProjects) = preSolution
{35DC5579-5E51-458F-BFFC-65133AE83F50} = {FA0D294D-2942-4349-AC60-BB837AA95DAB}
{A97DD9DD-60D0-4D3C-847E-BAF7322BDBAE} = {FA0D294D-2942-4349-AC60-BB837AA95DAB}
{FB936A0D-7B38-4B6D-9DC4-31D819BEDD82} = {6CBF405F-FC1E-4595-93B2-94D1D0ECC109}
{DDCA69DA-405C-4A3B-AF4F-A969FE107D23} = {FA0D294D-2942-4349-AC60-BB837AA95DAB}
{DF30A956-2615-4B4A-A129-981DE567629F} = {FA0D294D-2942-4349-AC60-BB837AA95DAB}
{80ADDBA5-A00F-4545-8642-951143DA2340} = {C2F75A5F-9D68-48E1-AAD5-094542747228}
{FFC56A7E-7F00-4EAD-827A-6242E9855688} = {13D366ED-5898-462D-B5F6-BCCDBBCD2C5F}
{429210F9-1870-4169-B2E1-FD834DB8BE86} = {13D366ED-5898-462D-B5F6-BCCDBBCD2C5F}
{57F2A3FD-99C6-4E6A-9813-B9B5F0FBC11D} = {13D366ED-5898-462D-B5F6-BCCDBBCD2C5F}
{A66A3423-81AE-43B9-AAA6-0FBC44BE5152} = {13D366ED-5898-462D-B5F6-BCCDBBCD2C5F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3D7D93DB-65A8-4680-ADDD-EE67EEC2C975}

69
build.ps1 Normal file
Просмотреть файл

@ -0,0 +1,69 @@
[CmdletBinding()]
Param(
#[switch]$CustomParam,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$BuildArguments
)
Write-Output "Windows PowerShell $($Host.Version)"
Set-StrictMode -Version 2.0; $ErrorActionPreference = "Stop"; $ConfirmPreference = "None"; trap { exit 1 }
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
###########################################################################
# CONFIGURATION
###########################################################################
$BuildProjectFile = "$PSScriptRoot\build\build\_build.csproj"
$TempDirectory = "$PSScriptRoot\\.tmp"
$DotNetGlobalFile = "$PSScriptRoot\\global.json"
$DotNetInstallUrl = "https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.ps1"
$DotNetChannel = "Current"
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
$env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
$env:NUGET_XMLDOC_MODE = "skip"
###########################################################################
# EXECUTION
###########################################################################
function ExecSafe([scriptblock] $cmd) {
& $cmd
if ($LASTEXITCODE) { exit $LASTEXITCODE }
}
# If global.json exists, load expected version
if (Test-Path $DotNetGlobalFile) {
$DotNetGlobal = $(Get-Content $DotNetGlobalFile | Out-String | ConvertFrom-Json)
if ($DotNetGlobal.PSObject.Properties["sdk"] -and $DotNetGlobal.sdk.PSObject.Properties["version"]) {
$DotNetVersion = $DotNetGlobal.sdk.version
}
}
# If dotnet is installed locally, and expected version is not set or installation matches the expected version
if ((Get-Command "dotnet" -ErrorAction SilentlyContinue) -ne $null -and `
(!(Test-Path variable:DotNetVersion) -or $(& dotnet --version) -eq $DotNetVersion)) {
$env:DOTNET_EXE = (Get-Command "dotnet").Path
}
else {
$DotNetDirectory = "$TempDirectory\dotnet-win"
$env:DOTNET_EXE = "$DotNetDirectory\dotnet.exe"
# Download install script
$DotNetInstallFile = "$TempDirectory\dotnet-install.ps1"
md -force $TempDirectory > $null
(New-Object System.Net.WebClient).DownloadFile($DotNetInstallUrl, $DotNetInstallFile)
# Install by channel or version
if (!(Test-Path variable:DotNetVersion)) {
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Channel $DotNetChannel -NoPath }
} else {
ExecSafe { & $DotNetInstallFile -InstallDir $DotNetDirectory -Version $DotNetVersion -NoPath }
}
}
Write-Output "Microsoft (R) .NET Core SDK version $(& $env:DOTNET_EXE --version)"
ExecSafe { & $env:DOTNET_EXE run --project $BuildProjectFile -- $BuildArguments }

72
build.sh Normal file
Просмотреть файл

@ -0,0 +1,72 @@
#!/usr/bin/env bash
echo $(bash --version 2>&1 | head -n 1)
#CUSTOMPARAM=0
BUILD_ARGUMENTS=()
for i in "$@"; do
case $(echo $1 | awk '{print tolower($0)}') in
# -custom-param) CUSTOMPARAM=1;;
*) BUILD_ARGUMENTS+=("$1") ;;
esac
shift
done
set -eo pipefail
SCRIPT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)
###########################################################################
# CONFIGURATION
###########################################################################
BUILD_PROJECT_FILE="$SCRIPT_DIR/build/build/_build.csproj"
TEMP_DIRECTORY="$SCRIPT_DIR//.tmp"
DOTNET_GLOBAL_FILE="$SCRIPT_DIR//global.json"
DOTNET_INSTALL_URL="https://raw.githubusercontent.com/dotnet/cli/master/scripts/obtain/dotnet-install.sh"
DOTNET_CHANNEL="Current"
export DOTNET_CLI_TELEMETRY_OPTOUT=1
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
export NUGET_XMLDOC_MODE="skip"
###########################################################################
# EXECUTION
###########################################################################
function FirstJsonValue {
perl -nle 'print $1 if m{"'$1'": "([^"\-]+)",?}' <<< ${@:2}
}
# If global.json exists, load expected version
if [ -f "$DOTNET_GLOBAL_FILE" ]; then
DOTNET_VERSION=$(FirstJsonValue "version" $(cat "$DOTNET_GLOBAL_FILE"))
if [ "$DOTNET_VERSION" == "" ]; then
unset DOTNET_VERSION
fi
fi
# If dotnet is installed locally, and expected version is not set or installation matches the expected version
if [[ -x "$(command -v dotnet)" && (-z ${DOTNET_VERSION+x} || $(dotnet --version) == "$DOTNET_VERSION") ]]; then
export DOTNET_EXE="$(command -v dotnet)"
else
DOTNET_DIRECTORY="$TEMP_DIRECTORY/dotnet-unix"
export DOTNET_EXE="$DOTNET_DIRECTORY/dotnet"
# Download install script
DOTNET_INSTALL_FILE="$TEMP_DIRECTORY/dotnet-install.sh"
mkdir -p "$TEMP_DIRECTORY"
curl -Lsfo "$DOTNET_INSTALL_FILE" "$DOTNET_INSTALL_URL"
chmod +x "$DOTNET_INSTALL_FILE"
# Install by channel or version
if [ -z ${DOTNET_VERSION+x} ]; then
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --channel "$DOTNET_CHANNEL" --no-path
else
"$DOTNET_INSTALL_FILE" --install-dir "$DOTNET_DIRECTORY" --version "$DOTNET_VERSION" --no-path
fi
fi
echo "Microsoft (R) .NET Core SDK version $("$DOTNET_EXE" --version)"
"$DOTNET_EXE" run --project "$BUILD_PROJECT_FILE" -- ${BUILD_ARGUMENTS[@]}

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Controls.Skia" Version="0.10.7.2" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="0.10.7" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.7" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.7" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Skia" Version="0.10.7" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="0.10.7" />
</ItemGroup>
</Project>

6
build/Avalonia.props Normal file
Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.7" />
</ItemGroup>
</Project>

15
build/Base.props Normal file
Просмотреть файл

@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>0.10.7.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Copyright>Copyright © Wiesław Šoltés 2021</Copyright>
<PackageProjectUrl>https://github.com/wieslawsoltes/TypefaceUtil</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup>
<AnalysisLevel>latest</AnalysisLevel>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
</ItemGroup>
</Project>

9
build/SignAssembly.props Normal file
Просмотреть файл

@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<SignAssembly>True</SignAssembly>
<AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)\TypefaceUtil.public.snk</AssemblyOriginatorKeyFile>
<DelaySign>false</DelaySign>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.80.2" />
</ItemGroup>
</Project>

6
build/SkiaSharp.props Normal file
Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="SkiaSharp" Version="2.80.2" />
</ItemGroup>
</Project>

21
build/SourceLink.props Normal file
Просмотреть файл

@ -0,0 +1,21 @@
<Project>
<PropertyGroup>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<IncludeSymbols>false</IncludeSymbols>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>embedded</DebugType>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
</PropertyGroup>
<PropertyGroup Condition="'$(TF_BUILD)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.0.0" PrivateAssets="All"/>
</ItemGroup>
<ItemGroup>
<SourceRoot Include="$(NuGetPackageRoot)" Condition="'$(NuGetPackageRoot)' != ''" />
</ItemGroup>
</Project>

6
build/Svg.Skia.props Normal file
Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Svg.Skia" Version="0.5.7.2" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20104.2" />
</ItemGroup>
</Project>

Просмотреть файл

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="5.0.2" />
</ItemGroup>
</Project>

Двоичные данные
build/TypefaceUtil.public.snk Normal file

Двоичный файл не отображается.

14
build/XUnit.props Normal file
Просмотреть файл

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.abstractions" Version="2.0.3" />
<PackageReference Include="xunit.assert" Version="2.4.1" />
<PackageReference Include="xunit.core" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.core" Version="2.4.1" />
<PackageReference Include="xunit.extensibility.execution" Version="2.4.1" />
<PackageReference Include="xunit.runner.console" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" />
</ItemGroup>
</Project>

124
build/build/Build.cs Normal file
Просмотреть файл

@ -0,0 +1,124 @@
using System.Collections.Generic;
using Nuke.Common;
using Nuke.Common.Git;
using Nuke.Common.IO;
using Nuke.Common.ProjectModel;
using Nuke.Common.Tools.DotNet;
using static Nuke.Common.IO.FileSystemTasks;
using static Nuke.Common.IO.PathConstruction;
using static Nuke.Common.Tools.DotNet.DotNetTasks;
class Build : NukeBuild
{
public static int Main() => Execute<Build>(x => x.Compile);
[Solution]
readonly Solution Solution;
[GitRepository]
readonly GitRepository GitRepository;
[Parameter("configuration")]
public string Configuration { get; set; }
[Parameter("version-suffix")]
public string VersionSuffix { get; set; }
[Parameter("publish-framework")]
public string PublishFramework { get; set; }
[Parameter("publish-runtime")]
public string PublishRuntime { get; set; }
[Parameter("publish-project")]
public string PublishProject { get; set; }
AbsolutePath SourceDirectory => RootDirectory / "src";
AbsolutePath TestsDirectory => RootDirectory / "tests";
AbsolutePath ArtifactsDirectory => RootDirectory / "artifacts";
protected override void OnBuildInitialized()
{
Configuration = Configuration ?? "Release";
VersionSuffix = VersionSuffix ?? "";
}
private void DeleteDirectories(IReadOnlyCollection<string> directories)
{
foreach (var directory in directories)
{
DeleteDirectory(directory);
}
}
Target Clean => _ => _
.Executes(() =>
{
DeleteDirectories(GlobDirectories(SourceDirectory, "**/bin", "**/obj"));
DeleteDirectories(GlobDirectories(TestsDirectory, "**/bin", "**/obj"));
EnsureCleanDirectory(ArtifactsDirectory);
});
Target Restore => _ => _
.DependsOn(Clean)
.Executes(() =>
{
DotNetRestore(s => s
.SetProjectFile(Solution));
});
Target Compile => _ => _
.DependsOn(Restore)
.Executes(() =>
{
DotNetBuild(s => s
.SetProjectFile(Solution)
.SetConfiguration(Configuration)
.SetVersionSuffix(VersionSuffix)
.EnableNoRestore());
});
Target Test => _ => _
.DependsOn(Compile)
.Executes(() =>
{
DotNetTest(s => s
.SetProjectFile(Solution)
.SetConfiguration(Configuration)
.SetLogger("trx")
.SetResultsDirectory(ArtifactsDirectory / "TestResults")
.EnableNoBuild()
.EnableNoRestore());
});
Target Pack => _ => _
.DependsOn(Test)
.Executes(() =>
{
DotNetPack(s => s
.SetProject(Solution)
.SetConfiguration(Configuration)
.SetVersionSuffix(VersionSuffix)
.SetOutputDirectory(ArtifactsDirectory / "NuGet")
.EnableNoBuild()
.EnableNoRestore());
});
Target Publish => _ => _
.DependsOn(Test)
.Requires(() => PublishRuntime)
.Requires(() => PublishFramework)
.Requires(() => PublishProject)
.Executes(() =>
{
DotNetPublish(s => s
.SetProject(Solution.GetProject(PublishProject))
.SetConfiguration(Configuration)
.SetVersionSuffix(VersionSuffix)
.SetFramework(PublishFramework)
.SetRuntime(PublishRuntime)
.SetOutput(ArtifactsDirectory / "Publish" / PublishProject + "-" + PublishFramework + "-" + PublishRuntime));
});
}

21
build/build/_build.csproj Normal file
Просмотреть файл

@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<IsPackable>False</IsPackable>
<NoWarn>CS0649;CS0169</NoWarn>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Nuke.Common" Version="0.24.2" />
</ItemGroup>
<ItemGroup>
<NukeMetadata Include="**\*.json" Exclude="bin\**;obj\**" />
<NukeExternalFiles Include="**\*.*.ext" Exclude="bin\**;obj\**" />
<None Remove="*.ref;*.txt" />
</ItemGroup>
</Project>

Просмотреть файл

До

Ширина:  |  Высота:  |  Размер: 172 KiB

После

Ширина:  |  Высота:  |  Размер: 172 KiB

Просмотреть файл

@ -1,20 +1,43 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.7" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.7" />
<PackageReference Include="Avalonia.Diagnostics" Version="0.10.7" />
<PackageReference Include="Avalonia.ReactiveUI" Version="0.10.7" />
<PackageReference Include="Avalonia.Controls.Skia" Version="0.10.7" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\TypefaceUtil.OpenType\TypefaceUtil.OpenType.csproj" />
</ItemGroup>
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>False</IsPackable>
<Nullable>enable</Nullable>
<ApplicationIcon>Assets\Icon.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<AvaloniaResource Include="Assets\**" />
</ItemGroup>
<PropertyGroup>
<Description>An OpenType typeface utilities.</Description>
<PackageId>TypefaceUtil.Avalonia</PackageId>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageTags>opentype;ttf;fonts;cmap;unicode;skiasharp;text;converter;png;svg;xaml;avaloniaui;avalonia;typeface;codepoint</PackageTags>
</PropertyGroup>
<PropertyGroup>
<PublishTrimmed>False</PublishTrimmed>
<PublishSingleFile>False</PublishSingleFile>
<PublishReadyToRun>True</PublishReadyToRun>
</PropertyGroup>
<Import Project="..\..\build\Base.props" />
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\Avalonia.props" />
<Import Project="..\..\build\Avalonia.Desktop.props" />
<Import Project="..\..\build\Avalonia.Diagnostics.props" />
<Import Project="..\..\build\Avalonia.ReactiveUI.props" />
<Import Project="..\..\build\Avalonia.Xaml.Behaviors.props" />
<Import Project="..\..\build\Avalonia.Controls.Skia.props" />
<Import Project="..\..\build\SkiaSharp.props" />
<Import Project="..\..\build\SkiaSharp.Linux.props" />
<Import Project="..\..\build\Svg.Skia.props" />
<ItemGroup>
<ProjectReference Include="..\TypefaceUtil.OpenType\TypefaceUtil.OpenType.csproj" />
</ItemGroup>
</Project>

Просмотреть файл

@ -15,7 +15,7 @@
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="PreferSystemChrome"
UseLayoutRounding="True"
Icon="/Assets/avalonia-logo.ico"
Icon="/Assets/Icon.ico"
Title="TypefaceUtil">
<Design.DataContext>
<vm:MainWindowViewModel/>

Просмотреть файл

@ -3,20 +3,10 @@
<PropertyGroup>
<TargetFrameworks>netstandard2.0;net5.0</TargetFrameworks>
<OutputType>Library</OutputType>
<LangVersion>preview</LangVersion>
<IsPackable>True</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>0.2.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Copyright>Copyright © Wiesław Šoltés 2020</Copyright>
<PackageProjectUrl>https://github.com/wieslawsoltes/TypefaceUtil</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup>
<Description>An OpenType typeface utilities.</Description>
<PackageId>TypefaceUtil.OpenType</PackageId>
@ -24,4 +14,9 @@
<PackageTags>opentype;ttf;fonts;cmap;unicode;skiasharp;text;converter;png;svg;xaml;avaloniaui;avalonia;typeface;codepoint</PackageTags>
</PropertyGroup>
<Import Project="..\..\build\Base.props"/>
<Import Project="..\..\build\SourceLink.props"/>
<Import Project="..\..\build\SignAssembly.props"/>
<Import Project="..\..\build\ReferenceAssemblies.props"/>
</Project>

Просмотреть файл

@ -8,15 +8,6 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>0.2.0</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>Wiesław Šoltés</Authors>
<Company>Wiesław Šoltés</Company>
<Copyright>Copyright © Wiesław Šoltés 2020</Copyright>
<PackageProjectUrl>https://github.com/wieslawsoltes/TypefaceUtil</PackageProjectUrl>
</PropertyGroup>
<PropertyGroup>
<Description>An OpenType typeface utilities.</Description>
<PackageId>TypefaceUtil</PackageId>
@ -24,6 +15,14 @@
<PackageTags>opentype;ttf;fonts;cmap;unicode;skiasharp;text;converter;png;svg;xaml;avaloniaui;avalonia;typeface;codepoint</PackageTags>
</PropertyGroup>
<Import Project="..\..\build\Base.props" />
<Import Project="..\..\build\SourceLink.props" />
<Import Project="..\..\build\SignAssembly.props" />
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\SkiaSharp.props" />
<Import Project="..\..\build\SkiaSharp.Linux.props" />
<Import Project="..\..\build\System.CommandLine.props" />
<!--
<PropertyGroup>
<PublishTrimmed>True</PublishTrimmed>
@ -49,12 +48,6 @@
<Copy SourceFiles="$(IlcPath)\framework\clrcompression.dll" DestinationFolder="$(PublishDir)" />
</Target>
<ItemGroup>
<PackageReference Include="System.CommandLine" Version="2.0.0-beta1.20303.1" />
<PackageReference Include="SkiaSharp" Version="2.88.0-preview.120" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.0-preview.120" />
</ItemGroup>
<ItemGroup Condition="'$(CoreRT)' == 'True'">
<PackageReference Include="Microsoft.DotNet.ILCompiler" Version="1.0.0-alpha-*" />
</ItemGroup>

Просмотреть файл

Просмотреть файл

@ -3,6 +3,7 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<IsPackable>False</IsPackable>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<OutputType>Library</OutputType>
<IsPackable>False</IsPackable>
<Nullable>enable</Nullable>
</PropertyGroup>
<Import Project="..\..\build\Base.props" />
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\XUnit.props" />
<ItemGroup>
<ProjectReference Include="..\..\src\TypefaceUtil.OpenType\TypefaceUtil.OpenType.csproj" />
</ItemGroup>
</Project>