Skip to content

Commit

Permalink
Convert to use Central Package Management (#17)
Browse files Browse the repository at this point in the history
* Convert to use Central Package Management

---------

Co-authored-by: Adam Simon <[email protected]>
  • Loading branch information
lahma and adams85 authored Nov 16, 2024
1 parent 9b7cee6 commit 20604c1
Show file tree
Hide file tree
Showing 16 changed files with 86 additions and 57 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
with:
dotnet-version: |
6.0
8.0
- uses: actions/checkout@v4
- name: 'Run: Compile, Test, Pack, Publish'
run: ./build.cmd Compile Test Pack Publish
Expand Down
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
33 changes: 33 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<CentralPackageTransitivePinningEnabled>true</CentralPackageTransitivePinningEnabled>
</PropertyGroup>
<ItemGroup>
<PackageVersion Include="BenchmarkDotNet" Version="0.14.0" />
<PackageVersion Include="Esprima" Version="3.0.5" />
<PackageVersion Include="GitHubActionsTestLogger" Version="2.4.1" />
<PackageVersion Include="McMaster.Extensions.CommandLineUtils" Version="4.1.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageVersion Include="Newtonsoft.Json" Version="13.0.3" />
<PackageVersion Include="NUnit" Version="4.2.2" />
<PackageVersion Include="NUnit3TestAdapter" Version="4.6.0" />
<PackageVersion Include="Spectre.Console" Version="0.49.1" />
<PackageVersion Include="System.Text.Json" Version="8.0.5" />
<PackageVersion Include="Test262Harness" Version="1.0.1" />
<PackageVersion Include="UnicodeInformation" Version="2.7.1" />
<PackageVersion Include="Verify.SourceGenerators" Version="2.2.0" />
<PackageVersion Include="Verify.XUnit" Version="23.7.2" />
<PackageVersion Include="xunit" Version="2.7.0" />
<PackageVersion Include="xunit.analyzers" Version="1.17.0" />
<PackageVersion Include="xunit.runner.console" Version="2.9.2" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.2" />
</ItemGroup>
<ItemGroup>
<!-- global private assets -->
<GlobalPackageReference Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<GlobalPackageReference Include="PolySharp" Version="1.14.1" />
</ItemGroup>
</Project>
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
1 change: 1 addition & 0 deletions build/_build.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

<ItemGroup>
<PackageReference Include="Nuke.Components" Version="8.1.4" />
<PackageReference Include="System.Formats.Asn1" Version="8.0.1" />
</ItemGroup>

</Project>
7 changes: 3 additions & 4 deletions samples/Acornima.Cli/Acornima.Cli.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -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="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
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 NETFRAMEWORK
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
Expand Up @@ -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 All @@ -27,7 +26,7 @@
<!-- Configure polyfills -->

<PropertyGroup>
<PolySharpIncludeGeneratedTypes Condition="'$(TargetFramework)' == 'net462'">
<PolySharpIncludeGeneratedTypes Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
System.Runtime.CompilerServices.IsExternalInit;
</PolySharpIncludeGeneratedTypes>
</PropertyGroup>
Expand Down
8 changes: 7 additions & 1 deletion samples/JsxTranspiler/generate.cmd
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
@echo off

SET TARGET_FRAMEWORK=%1
IF [%TARGET_FRAMEWORK%] == [] (
SET TARGET_FRAMEWORK=net6.0
)

REM Transpile template
dotnet run -f net6.0 -- --type module < template.jsx > template.mjs
dotnet build -f %TARGET_FRAMEWORK%
%~dp0\bin\debug\%TARGET_FRAMEWORK%\jsxt --type module < template.jsx > template.mjs

REM Generate output from template
node generate.mjs
7 changes: 1 addition & 6 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 Expand Up @@ -62,7 +57,7 @@
<!-- Configure polyfills -->

<PropertyGroup>
<PolySharpIncludeGeneratedTypes Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<PolySharpIncludeGeneratedTypes Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
System.Runtime.CompilerServices.IsExternalInit;
System.Runtime.CompilerServices.SkipLocalsInitAttribute
</PolySharpIncludeGeneratedTypes>
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
17 changes: 6 additions & 11 deletions src/Acornima/Acornima.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,12 @@
<PackageTags>javascript, ecmascript, parser</PackageTags>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Memory" Version="4.5.5" />
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))">
<PackageReference Include="System.Memory" VersionOverride="4.5.5" />
</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" />
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" VersionOverride="6.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -78,13 +73,13 @@
<!-- Configure polyfills -->

<PropertyGroup>
<PolySharpIncludeGeneratedTypes Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0' OR '$(TargetFramework)' == 'netstandard2.1'">
<PolySharpIncludeGeneratedTypes Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
System.Runtime.CompilerServices.CallerArgumentExpressionAttribute;
System.Runtime.CompilerServices.IsExternalInit;
System.Runtime.CompilerServices.SkipLocalsInitAttribute
</PolySharpIncludeGeneratedTypes>

<PolySharpIncludeGeneratedTypes Condition="'$(TargetFramework)' == 'net462' OR '$(TargetFramework)' == 'netstandard2.0'">
<PolySharpIncludeGeneratedTypes Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'netstandard2.1'))">
$(PolySharpIncludeGeneratedTypes);
System.Diagnostics.CodeAnalysis.NotNullAttribute;
System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute;
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 @@ -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" VersionOverride="13.0.2" />
<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" />
<ItemGroup Condition="!$([MSBuild]::IsTargetFrameworkCompatible('$(TargetFramework)', 'net6.0'))">
<PackageReference Include="System.ValueTuple" VersionOverride="4.5.0" />
</ItemGroup>

</Project>

0 comments on commit 20604c1

Please sign in to comment.