Skip to content

Commit

Permalink
Revert "Move to Svg package"
Browse files Browse the repository at this point in the history
This reverts commit 3087628.
  • Loading branch information
wieslawsoltes committed Nov 25, 2023
1 parent edfc540 commit 3f869f1
Show file tree
Hide file tree
Showing 14 changed files with 143 additions and 6 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "externals/SVG"]
path = externals/SVG
url = https://github.com/wieslawsoltes/SVG.git
[submodule "externals/resvg"]
path = externals/resvg
url = https://github.com/wieslawsoltes/resvg.git
16 changes: 16 additions & 0 deletions Svg.Skia.sln
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Svg.Skia", "src\Av
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AvaloniaSvgSkiaSample", "samples\AvaloniaSvgSkiaSample\AvaloniaSvgSkiaSample.csproj", "{81724F00-B7C3-4E25-B473-C7433BABDC81}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Svg.Custom", "src\Svg.Custom\Svg.Custom.csproj", "{CFA46E73-0050-4C57-85CE-6C5868A2483C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Svg.Skia.UnitTests", "tests\Avalonia.Svg.Skia.UnitTests\Avalonia.Svg.Skia.UnitTests.csproj", "{D4467DCA-494D-4C32-9525-4A9713221A53}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Svg.Model", "src\Svg.Model\Svg.Model.csproj", "{4C970B2C-6C96-445B-B80B-4EFBF803FD5F}"
Expand All @@ -80,8 +82,12 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Svg.CodeGen.Skia", "src\Svg
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Avalonia.Controls.Skia", "src\Avalonia.Controls.Skia\Avalonia.Controls.Skia.csproj", "{223B7A5A-E263-4D40-9A6E-FE31EAE92F45}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Svg.Generators", "externals\SVG\Generators\Svg.Generators.csproj", "{AF8AEF5B-0664-4106-9BD3-389758F39B12}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApp", "samples\TestApp\TestApp.csproj", "{B4BC7C90-09C3-46CB-B8B1-0450CC7EAAB0}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "externals", "externals", "{C5FFCF4B-86DC-453E-8006-44EE9EEFEE39}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShimSkiaSharp", "src\ShimSkiaSharp\ShimSkiaSharp.csproj", "{6D2786A1-F110-4448-9CBF-D3CC9D803F31}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvaloniaControlsSample", "samples\AvaloniaControlsSample\AvaloniaControlsSample.csproj", "{BE25FC07-9A8C-4494-A6AE-F2561CF89010}"
Expand Down Expand Up @@ -131,6 +137,10 @@ Global
{81724F00-B7C3-4E25-B473-C7433BABDC81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81724F00-B7C3-4E25-B473-C7433BABDC81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81724F00-B7C3-4E25-B473-C7433BABDC81}.Release|Any CPU.Build.0 = Release|Any CPU
{CFA46E73-0050-4C57-85CE-6C5868A2483C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CFA46E73-0050-4C57-85CE-6C5868A2483C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CFA46E73-0050-4C57-85CE-6C5868A2483C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CFA46E73-0050-4C57-85CE-6C5868A2483C}.Release|Any CPU.Build.0 = Release|Any CPU
{D4467DCA-494D-4C32-9525-4A9713221A53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D4467DCA-494D-4C32-9525-4A9713221A53}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D4467DCA-494D-4C32-9525-4A9713221A53}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand All @@ -147,6 +157,10 @@ Global
{223B7A5A-E263-4D40-9A6E-FE31EAE92F45}.Debug|Any CPU.Build.0 = Debug|Any CPU
{223B7A5A-E263-4D40-9A6E-FE31EAE92F45}.Release|Any CPU.ActiveCfg = Release|Any CPU
{223B7A5A-E263-4D40-9A6E-FE31EAE92F45}.Release|Any CPU.Build.0 = Release|Any CPU
{AF8AEF5B-0664-4106-9BD3-389758F39B12}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AF8AEF5B-0664-4106-9BD3-389758F39B12}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AF8AEF5B-0664-4106-9BD3-389758F39B12}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AF8AEF5B-0664-4106-9BD3-389758F39B12}.Release|Any CPU.Build.0 = Release|Any CPU
{B4BC7C90-09C3-46CB-B8B1-0450CC7EAAB0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B4BC7C90-09C3-46CB-B8B1-0450CC7EAAB0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B4BC7C90-09C3-46CB-B8B1-0450CC7EAAB0}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -205,6 +219,8 @@ Global
{29F59C87-EAE6-4DD3-8666-B79BFAF6B34D} = {4C42912C-9F8C-43D9-A4B5-4427F7EC8F18}
{223B7A5A-E263-4D40-9A6E-FE31EAE92F45} = {4C42912C-9F8C-43D9-A4B5-4427F7EC8F18}
{B4BC7C90-09C3-46CB-B8B1-0450CC7EAAB0} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8}
{CFA46E73-0050-4C57-85CE-6C5868A2483C} = {C5FFCF4B-86DC-453E-8006-44EE9EEFEE39}
{AF8AEF5B-0664-4106-9BD3-389758F39B12} = {C5FFCF4B-86DC-453E-8006-44EE9EEFEE39}
{6D2786A1-F110-4448-9CBF-D3CC9D803F31} = {4C42912C-9F8C-43D9-A4B5-4427F7EC8F18}
{BE25FC07-9A8C-4494-A6AE-F2561CF89010} = {B65D5B3A-77BE-4AFF-B502-A136B9C932F8}
{380E7565-C6FF-45C1-A683-E4E1FC744DCC} = {32B4A27D-6FC0-498C-9AD8-5510ACF2C4A1}
Expand Down
2 changes: 1 addition & 1 deletion build/Svg.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<PackageReference Include="Svg" Version="3.4.6" />
<PackageReference Include="Svg" Version="3.4.4" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions externals/SVG
Submodule SVG added at c21c91
1 change: 1 addition & 0 deletions externals/resvg
Submodule resvg added at a739ae
1 change: 1 addition & 0 deletions samples/TestApp/Views/MainWindow.axaml.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
Expand Down
1 change: 1 addition & 0 deletions samples/svgc/svgc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Svg.Custom\Svg.Custom.csproj" />
<ProjectReference Include="..\..\src\Svg.Model\Svg.Model.csproj" />
</ItemGroup>

Expand Down
31 changes: 31 additions & 0 deletions src/Svg.Custom/LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Microsoft Public License (Ms-PL)

This license governs use of the accompanying software. If you use the software, you accept this license. If you do not accept the license, do not use the software.

1. Definitions

The terms "reproduce," "reproduction," "derivative works," and "distribution" have the same meaning here as under U.S. copyright law.

A "contribution" is the original software, or any additions or changes to the software.

A "contributor" is any person that distributes its contribution under this license.

"Licensed patents" are a contributor's patent claims that read directly on its contribution.

2. Grant of Rights

(A) Copyright Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free copyright license to reproduce its contribution, prepare derivative works of its contribution, and distribute its contribution or any derivative works that you create.

(B) Patent Grant- Subject to the terms of this license, including the license conditions and limitations in section 3, each contributor grants you a non-exclusive, worldwide, royalty-free license under its licensed patents to make, have made, use, sell, offer for sale, import, and/or otherwise dispose of its contribution in the software or derivative works of the contribution in the software.

3. Conditions and Limitations

(A) No Trademark License- This license does not grant you rights to use any contributors' name, logo, or trademarks.

(B) If you bring a patent claim against any contributor over patents that you claim are infringed by the software, your patent license from such contributor to the software ends automatically.

(C) If you distribute any portion of the software, you must retain all copyright, patent, trademark, and attribution notices that are present in the software.

(D) If you distribute any portion of the software in source code form, you may do so only under this license by including a complete copy of this license with your distribution. If you distribute any portion of the software in compiled or object code form, you may only do so under a license that complies with this license.

(E) The software is licensed "as-is." You bear the risk of using it. The contributors give no express warranties, guarantees or conditions. You may have additional consumer rights under your local laws which this license cannot change. To the extent permitted under your local laws, the contributors exclude the implied warranties of merchantability, fitness for a particular purpose and non-infringement.
3 changes: 3 additions & 0 deletions src/Svg.Custom/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
using System;

[assembly: CLSCompliant(false)]
73 changes: 73 additions & 0 deletions src/Svg.Custom/Svg.Custom.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFrameworks>netstandard2.0;net6.0;net8.0</TargetFrameworks>
<EnableDefaultCompileItems>False</EnableDefaultCompileItems>
<EnableDefaultItems>False</EnableDefaultItems>
<GenerateAssemblyInfo>True</GenerateAssemblyInfo>
<NoWarn>CS1591;SYSLIB0014</NoWarn>
<IsPackable>True</IsPackable>
<Nullable>disable</Nullable>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)\$(TargetFramework)\GeneratedFiles</CompilerGeneratedFilesOutputPath>
<DefineConstants>$(DefineConstants);NO_SDC</DefineConstants>
</PropertyGroup>

<PropertyGroup>
<Description>Custom build of the SVG rendering library.</Description>
<PackageId>Svg.Custom</PackageId>
<PackageLicenseExpression>MS-PL</PackageLicenseExpression>
<PackageTags>svg;vector graphics;rendering;2d;graphics;geometry;shapes</PackageTags>
</PropertyGroup>

<Import Project="..\..\build\Base.props" />
<Import Project="..\..\build\SourceLink.props" />
<Import Project="..\..\build\SignAssembly.props" />
<Import Project="..\..\build\ReferenceAssemblies.props" />

<PropertyGroup>
<SvgSourcesBasePath>..\..\externals\SVG</SvgSourcesBasePath>
<!--<SvgSourcesBasePath>..\..\..\SVG</SvgSourcesBasePath>-->
</PropertyGroup>

<ItemGroup>
<!-- https://github.com/vvvv/SVG/blob/master/Source/SvgDtdResolver.cs#L32 -->
<EmbeddedResource Include="$(SvgSourcesBasePath)\Source\Resources\svg11.dtd">
<Link>Resources\svg11.dtd</Link>
<LogicalName>Svg.Resources.svg11.dtd</LogicalName>
</EmbeddedResource>
</ItemGroup>

<ItemGroup>
<Compile Include="**\*.cs" Exclude="bin\**;obj\**" />
<Compile Include="$(SvgSourcesBasePath)\Source\**\*.cs" Exclude="$(SvgSourcesBasePath)\Source\obj\**" />
<Compile Remove="$(SvgSourcesBasePath)\Source\Properties\AssemblyInfo.cs" />
<Compile Remove="$(SvgSourcesBasePath)\Source\Resources\svg11.dtd" />
</ItemGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<DefineConstants>$(DefineConstants);NETSTANDARD;NETSTANDARD20</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(TargetFramework)'=='net6.0'">
<DefineConstants>$(DefineConstants);NETCORE;NET6</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)'=='netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="ExCSS" Version="4.2.3" />
</ItemGroup>

<PropertyGroup>
<DefineConstants>$(DefineConstants);USE_SOURCE_GENERATORS</DefineConstants>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="$(SvgSourcesBasePath)\Generators\Svg.Generators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
</ItemGroup>

</Project>
4 changes: 3 additions & 1 deletion src/Svg.Model/Svg.Model.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@
<Import Project="..\..\build\SourceLink.props" />
<Import Project="..\..\build\SignAssembly.props" />
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\Svg.props" />
<!--<Import Project="..\..\build\Svg.props" />-->

<ItemGroup>
<!--<ProjectReference Include="..\..\externals\SVG\Source\Svg.csproj" />-->
<ProjectReference Include="..\ShimSkiaSharp\ShimSkiaSharp.csproj" />
<ProjectReference Include="..\Svg.Custom\Svg.Custom.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
File renamed without changes.
4 changes: 3 additions & 1 deletion src/Svg.Skia/Svg.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@
<Import Project="..\..\build\ReferenceAssemblies.props" />
<Import Project="..\..\build\SkiaSharp.props" />
<Import Project="..\..\build\SkiaSharp.HarfBuzz.props" />
<Import Project="..\..\build\Svg.props" />

<!--<Import Project="..\..\build\Svg.props" />-->
<ItemGroup>
<!--<ProjectReference Include="..\..\externals\SVG\Source\Svg.csproj" />-->
<ProjectReference Include="..\Svg.Model\Svg.Model.csproj" />
<ProjectReference Include="..\Svg.Custom\Svg.Custom.csproj" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Svg.SourceGenerator.Skia/Svg.SourceGenerator.Skia.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@
<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.0-4.final" PrivateAssets="all" />
<PackageReference Include="Svg" Version="3.4.6" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="ExCSS" Version="4.2.3" GeneratePathProperty="true" PrivateAssets="all" />
<PackageReference Include="SkiaSharp" Version="2.88.6" GeneratePathProperty="true" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\ShimSkiaSharp\ShimSkiaSharp.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Svg.Custom\Svg.Custom.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Svg.Model\Svg.Model.csproj" PrivateAssets="all" />
<ProjectReference Include="..\Svg.Skia\Svg.Skia.csproj" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<None Include="Svg.SourceGenerator.Skia.props" Pack="true" PackagePath="build" Visible="false" />
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(PKGSvg)\lib\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="$(PKGExCSS)\lib\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="..\ShimSkiaSharp\bin\$(Configuration)\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="..\Svg.Custom\bin\$(Configuration)\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="..\Svg.Model\bin\$(Configuration)\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
<None Include="..\Svg.Skia\bin\$(Configuration)\netstandard2.0\*.dll" Pack="true" PackagePath="analyzers/dotnet/cs" Visible="false" />
</ItemGroup>
Expand All @@ -64,10 +64,10 @@

<Target Name="GetDependencyTargetPaths">
<ItemGroup>
<TargetPathWithTargetPlatformMoniker Include="$(PKGSvg)\lib\netstandard2.0\Svg.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(PKGExCSS)\lib\netstandard2.0\ExCSS.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(PKGSkiaSharp)\lib\netstandard2.0\SkiaSharp.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildThisFileDirectory)\..\ShimSkiaSharp\bin\$(Configuration)\netstandard2.0\ShimSkiaSharp.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildThisFileDirectory)\..\Svg.Custom\bin\$(Configuration)\netstandard2.0\Svg.Custom.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildThisFileDirectory)\..\Svg.Model\bin\$(Configuration)\netstandard2.0\Svg.Model.dll" IncludeRuntimeDependency="false" />
<TargetPathWithTargetPlatformMoniker Include="$(MSBuildThisFileDirectory)\..\Svg.Skia\bin\$(Configuration)\netstandard2.0\Svg.Skia.dll" IncludeRuntimeDependency="false" />
</ItemGroup>
Expand Down

0 comments on commit 3f869f1

Please sign in to comment.