Skip to content

Commit

Permalink
Convert to use Central Package Management
Browse files Browse the repository at this point in the history
* all versions in Directory.Packages.props
* use net472 for executable projects
* latest versions of libraries
  • Loading branch information
lahma committed Nov 9, 2024
1 parent 9b7cee6 commit 4124649
Show file tree
Hide file tree
Showing 14 changed files with 57 additions and 57 deletions.
1 change: 1 addition & 0 deletions Acornima.sln
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
Directory.Packages.props = Directory.Packages.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{C428FBAE-48E0-4C47-B9D2-688866714516}"
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/Acornima.Benchmarks/Acornima.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="Esprima" Version="3.0.5" />
<PackageReference Include="BenchmarkDotNet" />
<PackageReference Include="Esprima" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Nuke.Components" Version="8.1.4" />
<PackageReference Include="Nuke.Components" />
</ItemGroup>

</Project>
9 changes: 4 additions & 5 deletions samples/Acornima.Cli/Acornima.Cli.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<AssemblyName>acornima-cli</AssemblyName>
<OutputType>Exe</OutputType>
<PackAsTool>true</PackAsTool>
Expand All @@ -10,9 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.*" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
<PackageReference Include="System.Text.Json" Version="6.0.*" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" />
<PackageReference Include="System.Text.Json" />
</ItemGroup>

<ItemGroup>
Expand All @@ -22,7 +21,7 @@
<!-- Configure polyfills -->

<PropertyGroup>
<PolySharpIncludeGeneratedTypes Condition="'$(TargetFramework)' == 'net462'">
<PolySharpIncludeGeneratedTypes Condition="'$(TargetFramework)' == 'net472'">
System.Runtime.CompilerServices.IsExternalInit;
</PolySharpIncludeGeneratedTypes>
</PropertyGroup>
Expand Down
2 changes: 1 addition & 1 deletion samples/Acornima.Cli/Helpers/ConsoleExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public static string ReadString(this IConsole console)
}

bool isWindowsOS;
#if NET462
#if NET472
isWindowsOS = true;
#else
isWindowsOS = RuntimeInformation.IsOSPlatform(OSPlatform.Windows);
Expand Down
5 changes: 2 additions & 3 deletions samples/JsxTranspiler/JsxTranspiler.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net6.0;net462</TargetFrameworks>
<TargetFrameworks>net6.0;net472</TargetFrameworks>
<AssemblyName>jsxt</AssemblyName>
<OutputType>Exe</OutputType>
<PackAsTool>true</PackAsTool>
Expand All @@ -10,8 +10,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="McMaster.Extensions.CommandLineUtils" Version="4.*" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
<PackageReference Include="McMaster.Extensions.CommandLineUtils" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 0 additions & 5 deletions src/Acornima.Extras/Acornima.Extras.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
<PackageTags>javascript, ecmascript, parser</PackageTags>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Acornima\Acornima.csproj" />
<ProjectReference Include="..\Acornima.SourceGenerators\Acornima.SourceGenerators.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
</ItemGroup>

<!-- Configure polyfills -->
Expand Down
9 changes: 2 additions & 7 deletions src/Acornima/Acornima.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,11 @@
</PropertyGroup>

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

<ItemGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" PrivateAssets="All" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" />
</ItemGroup>

<ItemGroup>
Expand Down
20 changes: 16 additions & 4 deletions src/Acornima/Tokenizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -318,15 +318,27 @@ private void SkipLineComment(int startSkip, CommentKind kind, OnCommentHandler?

// Called at the start of the parse and after every token. Skips
// whitespace and comments.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private void SkipSpace(OnCommentHandler? onComment)
{
if (_position < _endPosition && _input[_position].IsInRange('0', '}'))
{
return;
}

SkipSpaceUnlikely(onComment);
}

private void SkipSpaceUnlikely(OnCommentHandler? onComment)
{
// https://github.com/acornjs/acorn/blob/8.11.3/acorn/src/tokenize.js > `pp.skipSpace = function`

while (_position < _endPosition)
{
var ch = _input[_position];

var charFlags = GetCharFlags(ch) & CharFlags.Skipped;
var charFlags =GetCharFlags(ch) & CharFlags.Skipped;

if (charFlags == 0)
{
return;
Expand Down Expand Up @@ -367,9 +379,9 @@ private void SkipSpace(OnCommentHandler? onComment)
goto default;

case '#' when _position == 0
&& _sourceType != SourceType.Unknown
&& (_options._allowHashBang ?? _options._ecmaVersion >= EcmaVersion.ES14)
&& 1 < _endPosition && _input[0] == '#' && _input[1] == '!':
&& _sourceType != SourceType.Unknown
&& (_options._allowHashBang ?? _options._ecmaVersion >= EcmaVersion.ES14)
&& 1 < _endPosition && _input[0] == '#' && _input[1] == '!':

SkipLineComment(startSkip: 2, CommentKind.HashBang, onComment);
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" Version="3.3.4" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" Version="4.9.2" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Verify.XUnit" Version="23.7.2" />
<PackageReference Include="Verify.SourceGenerators" Version="2.2.0" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.analyzers" Version="1.11.0" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" Version="2.5.7" />
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" PrivateAssets="all" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Verify.XUnit" />
<PackageReference Include="Verify.SourceGenerators" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.analyzers" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion test/Acornima.Tests.Test262/.config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"test262harness.console": {
"version": "1.0.0",
"version": "1.0.1",
"commands": [
"test262"
]
Expand Down
12 changes: 6 additions & 6 deletions test/Acornima.Tests.Test262/Acornima.Tests.Test262.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="NUnit" Version="4.0.1" />
<PackageReference Include="NUnit3TestAdapter" Version="4.5.0" />
<PackageReference Include="Spectre.Console" Version="0.48.0" />
<PackageReference Include="Test262Harness" Version="1.0.0" />
<PackageReference Include="GitHubActionsTestLogger" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="NUnit" />
<PackageReference Include="NUnit3TestAdapter" />
<PackageReference Include="Spectre.Console" />
<PackageReference Include="Test262Harness" />
</ItemGroup>

<ItemGroup>
Expand Down
22 changes: 11 additions & 11 deletions test/Acornima.Tests/Acornima.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<TargetFrameworks>net6.0;net8.0</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net462</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);net472</TargetFrameworks>
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\src\Karambolo.Public.snk</AssemblyOriginatorKeyFile>
<DefaultItemExcludes>Fixtures.RegExp\Generator\**;$(DefaultItemExcludes)</DefaultItemExcludes>
Expand All @@ -14,19 +14,19 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="DiffEngine" Version="13.0.2" />
<PackageReference Include="GitHubActionsTestLogger" Version="2.3.3" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="UnicodeInformation" Version="2.7.1" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.analyzers" Version="1.11.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7" PrivateAssets="all" />
<PackageReference Include="xunit.runner.console" Version="2.7.0" PrivateAssets="all" />
<PackageReference Include="DiffEngine" />
<PackageReference Include="GitHubActionsTestLogger" PrivateAssets="all" />
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="UnicodeInformation" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.analyzers" />
<PackageReference Include="xunit.runner.visualstudio" PrivateAssets="all" />
<PackageReference Include="xunit.runner.console" PrivateAssets="all" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="System.ValueTuple" Version="4.5.0" />
<PackageReference Include="System.ValueTuple" />
</ItemGroup>

</Project>

0 comments on commit 4124649

Please sign in to comment.