Skip to content

Commit 349eb46

Browse files
author
Simeon
authored
Convert LottieGen to .NET 5 and create LottieGen.MsBuild package.
With this change, we'll produce a new nuget package that contains the LottieGen.exe executable built into a single file with no dependencies (not even .NET) and an MsBuild task. This is being done to enable LottieGen to be more easily used in a build.
1 parent 78327ce commit 349eb46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+3460
-2657
lines changed

Lottie-Windows.sln

Lines changed: 110 additions & 33 deletions
Large diffs are not rendered by default.

LottieGen/CommandLineOptions.cs

Lines changed: 0 additions & 445 deletions
This file was deleted.

LottieGen/CommandLineTokenizer.cs

Lines changed: 0 additions & 202 deletions
This file was deleted.

LottieGen/Common.proj

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
4+
<PropertyGroup Label="Configuration">
5+
<Import_RootNamespace>LottieGen</Import_RootNamespace>
6+
<OutputType>Exe</OutputType>
7+
<TargetFramework>net5.0</TargetFramework>
8+
<RootNamespace>LottieGen</RootNamespace>
9+
<Configurations>Debug;Release</Configurations>
10+
<LangVersion>latest</LangVersion>
11+
<PlatformTarget>AnyCPU</PlatformTarget>
12+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
13+
<StartupObject>Program</StartupObject>
14+
</PropertyGroup>
15+
16+
<ItemGroup>
17+
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
18+
</ItemGroup>
19+
</Project>

LottieGen/CommonNupkg.props

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup Label="Configuration">
4+
<Authors>Microsoft</Authors>
5+
<Company>Microsoft</Company>
6+
<Product>Lottie for Windows</Product>
7+
<Description>Generates code from a Lottie file. This is the most efficient way to render Lottie files on Windows.</Description>
8+
<PackageTags>Lottie UWP Animations C++ C#</PackageTags>
9+
</PropertyGroup>
10+
</Project>

LottieGen/DataTable.cs

Lines changed: 0 additions & 52 deletions
This file was deleted.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<Import Project="..\CommonNupkg.props" />
3+
<PropertyGroup>
4+
<PackageId>LottieGen</PackageId>
5+
<AssemblyName>LottieGen</AssemblyName>
6+
</PropertyGroup>
7+
8+
<PropertyGroup>
9+
<IsPackable>true</IsPackable>
10+
<PackAsTool>true</PackAsTool>
11+
<ToolCommandName>LottieGen</ToolCommandName>
12+
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<_SourceDir>..\..\source\</_SourceDir>
16+
<StartupObject>Program</StartupObject>
17+
</PropertyGroup>
18+
19+
<Import Project="..\Common.proj" />
20+
<Import Project="$(_SourceDir)Animatables\Animatables.projitems" Label="Shared" />
21+
<Import Project="$(_SourceDir)CompMetadata\CompMetadata.projitems" Label="Shared" />
22+
<Import Project="$(_SourceDir)DotLottie\DotLottie.projitems" Label="Shared" />
23+
<Import Project="$(_SourceDir)GenericData\GenericData.projitems" Label="Shared" />
24+
<Import Project="$(_SourceDir)LottieData\LottieData.projitems" Label="Shared" />
25+
<Import Project="$(_SourceDir)LottieGen\LottieGen.projitems" Label="Shared" />
26+
<Import Project="$(_SourceDir)LottieGenExe\LottieGenExe.projitems" Label="Shared" />
27+
<Import Project="$(_SourceDir)LottieMetadata\LottieMetadata.projitems" Label="Shared" />
28+
<Import Project="$(_SourceDir)LottieReader\LottieReader.projitems" Label="Shared" />
29+
<Import Project="$(_SourceDir)LottieToWinComp\LottieToWinComp.projitems" Label="Shared" />
30+
<Import Project="$(_SourceDir)UIData\UIData.projitems" Label="Shared" />
31+
<Import Project="$(_SourceDir)WinCompData\WinCompData.projitems" Label="Shared" />
32+
<Import Project="$(_SourceDir)WinStorageStreamsData\WinStorageStreamsData.projitems" Label="Shared" />
33+
<Import Project="$(_SourceDir)WinUIXamlMediaData\WinUIXamlMediaData.projitems" Label="Shared" />
34+
<Import Project="$(_SourceDir)YamlData\YamlData.projitems" Label="Shared" />
35+
<Import Project="$(_SourceDir)UIDataCodeGen\UIDataCodeGen.projitems" Label="Shared" />
36+
</Project>

LottieGen/Language.cs renamed to LottieGen/DotnetTool/Program.cs

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,8 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33
// See the LICENSE file in the project root for more information.
44

5-
enum Language
5+
static class Program
66
{
7-
// Language wasn't recognized.
8-
Unknown,
9-
10-
// Language specified was ambigious.
11-
Ambiguous,
12-
13-
CSharp,
14-
Cx,
15-
Cppwinrt,
16-
LottieYaml,
17-
WinCompDgml,
18-
Stats,
19-
}
7+
static int Main(string[] args)
8+
=> Microsoft.Toolkit.Uwp.UI.Lottie.LottieGenExe.Main.Run(args);
9+
}

0 commit comments

Comments
 (0)