Skip to content

Commit

Permalink
Merge pull request #27 from cyotek/net50
Browse files Browse the repository at this point in the history
Net50
  • Loading branch information
cyotek committed Oct 3, 2021
2 parents ae32100 + 53c9f1d commit 86dddd0
Show file tree
Hide file tree
Showing 10 changed files with 132 additions and 87 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -6,6 +6,7 @@ obj/
NDependOut/
_NCrunch_*/
nuget/
testresults/

push.cmd

Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,19 @@
# Change Log

## 2.0.3

### Added

* Added deployment target for .NET 5.0

### Fixed

* Fixed a crash which occurred when trying to load a plain text
font and texture file names contained spaces. Thanks to
abenedik for the fix
* No longer requires a custom `global.json` to force an older
SDK version in order to build the 3.5 target

## 2.0.2

### Fixed
Expand Down
5 changes: 5 additions & 0 deletions CONTRIBUTORS.md
@@ -1,5 +1,10 @@
# Contributors

## Version 2.0.3

* @abenedik for fixing a crash when loading a plain text font
and texture filenames contained spaces

## Version 2.0

* @Tom94 for the initial conversion to SDK project format
Expand Down
12 changes: 7 additions & 5 deletions build.cmd
Expand Up @@ -2,15 +2,16 @@

SETLOCAL

CALL ..\..\..\build\set35vars.bat
CALL %CTKBLDROOT%setupEnv.cmd

SET BASENAME=Cyotek.Drawing.BitmapFont
SET RELDIR=src\bin\Release\
SET PRJFILE=src\Cyotek.Drawing.BitmapFont.csproj
SET DLLNAME=Cyotek.Drawing.BitmapFont.dll
SET PRJFILE=src\%BASENAME%.csproj
SET DLLNAME=%BASENAME%.dll

IF EXIST %RELDIR%*.nupkg DEL /F %RELDIR%*.nupkg
IF EXIST %RELDIR%*.nupkg DEL /F %RELDIR%*.nupkg
IF EXIST %RELDIR%*.snupkg DEL /F %RELDIR%*.snupkg
IF EXIST %RELDIR%*.zip DEL /F %RELDIR%*.zip
IF EXIST %RELDIR%*.zip DEL /F %RELDIR%*.zip

dotnet build %PRJFILE% --configuration Release

Expand All @@ -22,6 +23,7 @@ CALL signcmd net452\%DLLNAME%
CALL signcmd net462\%DLLNAME%
CALL signcmd net472\%DLLNAME%
CALL signcmd net48\%DLLNAME%
CALL signcmd net5.0\%DLLNAME%
CALL signcmd netcoreapp2.1\%DLLNAME%
CALL signcmd netcoreapp2.2\%DLLNAME%
CALL signcmd netcoreapp3.1\%DLLNAME%
Expand Down
5 changes: 0 additions & 5 deletions global.json

This file was deleted.

File renamed without changes.
56 changes: 56 additions & 0 deletions runtests.cmd
@@ -0,0 +1,56 @@
@ECHO OFF

SETLOCAL

CALL %CTKBLDROOT%setupEnv.cmd

SET BASENAME=Cyotek.Drawing.BitmapFont
SET RELDIR=tests\bin\Release\
SET PRJFILE=tests\%BASENAME%.Tests.csproj
SET DLLNAME=%BASENAME%.Tests.dll
SET NUNITVER=3.12.0
SET NUNITEXE=%USERPROFILE%\.nuget\packages\nunit.consolerunner\%NUNITVER%\tools\nunit3-console.exe

IF EXIST testresults RMDIR testresults /Q /S
MKDIR testresults

dotnet build %PRJFILE% --configuration Release
IF %ERRORLEVEL% NEQ 0 GOTO :failed

CALL :runtests net35
IF %ERRORLEVEL% NEQ 0 GOTO :failed
CALL :runtests net40
IF %ERRORLEVEL% NEQ 0 GOTO :failed
CALL :runtests net452
IF %ERRORLEVEL% NEQ 0 GOTO :failed
CALL :runtests net462
IF %ERRORLEVEL% NEQ 0 GOTO :failed
CALL :runtests net472
IF %ERRORLEVEL% NEQ 0 GOTO :failed
CALL :runtests net48
IF %ERRORLEVEL% NEQ 0 GOTO :failed
REM CALL :runtests net5.0
REM IF %ERRORLEVEL% NEQ 0 GOTO :failed
REM CALL :runtests netcoreapp2.1
REM IF %ERRORLEVEL% NEQ 0 GOTO :failed
REM CALL :runtests netcoreapp2.2
REM IF %ERRORLEVEL% NEQ 0 GOTO :failed

ENDLOCAL

GOTO :eof

:failed
CECHO {0c}ERROR : Test run failed{#}{\n}
EXIT /b 1

:runtests
SET PLATFORM=%1

"%NUNITEXE%" "%RELDIR%%PLATFORM%\%DLLNAME%" -result="./testresults/%BASENAME%-%PLATFORM%.xml"
IF %ERRORLEVEL% NEQ 0 EXIT /b 1

"%NUNITEXE%" "%RELDIR%%PLATFORM%\%DLLNAME%" -result="./testresults/%BASENAME%-%PLATFORM%-x86.xml" -x86
IF %ERRORLEVEL% NEQ 0 EXIT /b 1

EXIT /b 0
11 changes: 5 additions & 6 deletions src/Cyotek.Drawing.BitmapFont.csproj
Expand Up @@ -2,11 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net48</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
<TargetFrameworks Condition=" '$(Configuration)' != 'Debug' ">net48;net35;net40;net452;net462;net472;netcoreapp2.1;netcoreapp2.2;netcoreapp3.1;netstandard1.3;netstandard2.0;netstandard2.1</TargetFrameworks>
<TargetFrameworks>net48;net35;net40;net452;net462;net472;net5.0;netcoreapp2.1;netcoreapp2.2;netcoreapp3.1;netstandard1.3;netstandard2.0;netstandard2.1</TargetFrameworks>
</PropertyGroup>

<PropertyGroup>
Expand All @@ -16,10 +12,11 @@
<PropertyGroup>
<Company>Cyotek Ltd</Company>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>cyopublic.snk</AssemblyOriginatorKeyFile>
<AssemblyOriginatorKeyFile>..\res\Cyotek.Drawing.BitmapFont.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\res\Cyotek.Drawing.BitmapFont.snk" Link="Cyotek.Drawing.BitmapFont.snk" />
<None Include="..\res\icon.png" Link="icon.png" Pack="true" PackagePath="\" />
</ItemGroup>

Expand All @@ -30,6 +27,8 @@
<PropertyGroup>
<!-- https://github.com/dotnet/msbuild/issues/1333#issuecomment-296346352 -->
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
<!-- https://github.com/dotnet/msbuild/issues/5985#issuecomment-752735876 -->
<AutomaticallyUseReferenceAssemblyPackages Condition=" '$(TargetFramework)' == 'net35' ">false</AutomaticallyUseReferenceAssemblyPackages>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='Release'">
Expand Down
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Expand Up @@ -3,7 +3,7 @@
<Title>Cyotek BitmapFont</Title>
<Authors>Cyotek</Authors>
<Owners>Cyotek</Owners>
<VersionPrefix>2.0.2</VersionPrefix>
<VersionPrefix>2.0.3</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Copyright>Copyright © 2012-2021 Cyotek Ltd. All Rights Reserved.</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
Expand Down
113 changes: 43 additions & 70 deletions tests/Cyotek.Drawing.BitmapFont.Tests.csproj
@@ -1,102 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{73515AF8-FA45-495F-91BA-AD5DAE58944C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Cyotek.Drawing.BitmapFont.Tests</RootNamespace>
<AssemblyName>Cyotek.Drawing.BitmapFont.Tests</AssemblyName>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworks>net48;net35;net40;net452;net462;net472;net5.0;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>

<PropertyGroup>
<IsPackable>false</IsPackable>
<RootNamespace>Cyotek.Drawing.BitmapFont.Tests</RootNamespace>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>

<PropertyGroup>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\res\Cyotek.Drawing.BitmapFont.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>

<ItemGroup>
<None Include="..\res\Cyotek.Drawing.BitmapFont.snk" Link="Cyotek.Drawing.BitmapFont.snk" />
</ItemGroup>

<ItemGroup>
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Drawing" />
<Reference Include="System.Xml.Linq" />
<Reference Include="Microsoft.CSharp" />
<PackageReference Include="NUnit" Version="3.13.2" />
<PackageReference Include="NUnit3TestAdapter" Version="4.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.11.0" />
</ItemGroup>

<ItemGroup>
<Compile Include="BitmapFontAssert.cs" />
<Compile Include="BitmapFontLoaderTests.cs" />
<Compile Include="BitmapFontTests.cs" />
<Compile Include="CharacterTests.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestBase.cs" />
<ProjectReference Include="..\src\Cyotek.Drawing.BitmapFont.csproj" />
</ItemGroup>

<ItemGroup>
<None Include="data\hiero-sample.fnt">
<None Update="data\hiero-sample.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\simple-spaces.fnt">
<None Update="data\simple-bin.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\trebuchet-invalid-bin.fnt">
<None Update="data\simple-spaces.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\trebuchet-invalid-text.fnt">
<None Update="data\simple-xml.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\trebuchet-invalid-xml.fnt">
<None Update="data\simple.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<None Include="data\simple-bin.fnt">
<None Update="data\trebuchet-invalid-bin.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\simple-xml.fnt">
<None Update="data\trebuchet-invalid-text.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\simple.fnt">
<None Update="data\trebuchet-invalid-xml.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\trebuchet-ms-bin.fnt">
<None Update="data\trebuchet-ms-bin.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\trebuchet-ms-text.fnt">
<None Update="data\trebuchet-ms-text.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="data\trebuchet-ms-xml.fnt">
<None Update="data\trebuchet-ms-xml.fnt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\src\Cyotek.Drawing.BitmapFont.csproj">
<Project>{A8E42972-0BC3-4F26-99DF-87B6379E875F}</Project>
<Name>Cyotek.Drawing.BitmapFont</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

<PropertyGroup>
<!-- https://github.com/dotnet/msbuild/issues/1333#issuecomment-296346352 -->
<FrameworkPathOverride Condition="'$(TargetFramework)' == 'net35'">$(MSBuildProgramFiles32)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client</FrameworkPathOverride>
<!-- https://github.com/dotnet/msbuild/issues/5985#issuecomment-752735876 -->
<AutomaticallyUseReferenceAssemblyPackages Condition=" '$(TargetFramework)' == 'net35' ">false</AutomaticallyUseReferenceAssemblyPackages>
</PropertyGroup>

</Project>

0 comments on commit 86dddd0

Please sign in to comment.