Skip to content

Commit

Permalink
More Migrate (#280)
Browse files Browse the repository at this point in the history
* Reset state after fork
* Fix release script
* Update to .net 9
* Move nuget to shared
* Use runtime folder to find packs
* which
* Allow relative refs
* Move restore up
  • Loading branch information
mwasplund authored Dec 28, 2024
1 parent 384dc67 commit b6bdd38
Show file tree
Hide file tree
Showing 58 changed files with 1,312 additions and 940 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ jobs:
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 8.0.x
dotnet-version: 9.0.x
- name: Setup Soup Build
uses: soupbuild/setup-soup@v1
with:
version: latest

# Restore Nuget
- name: DotNet Restore
run: dotnet restore ./Soup/Source/GenerateSharp/GenerateSharp.sln

# Build Soup
- name: Soup Where
run: swhere
Expand Down Expand Up @@ -52,14 +56,9 @@ jobs:
run: soup build ./Soup/Source/Client/Tools/ -flavor ${{matrix.config}}

# Build DotNet
- name: DotNet Restore
if: matrix.os != 'ubuntu-22.04'
run: dotnet restore ./Soup/Source/GenerateSharp/GenerateSharp.sln
- name: DotNet Build
if: matrix.os != 'ubuntu-22.04'
run: dotnet build -c ${{matrix.config}} --no-restore ./Soup/Source/GenerateSharp/GenerateSharp.sln
- name: DotNet Test
if: matrix.os != 'ubuntu-22.04'
run: dotnet test -c ${{matrix.config}} --no-build --verbosity normal ./Soup/Source/GenerateSharp/GenerateSharp.sln

# Build Tools
Expand All @@ -75,6 +74,10 @@ jobs:
run: soup restore ./Soup/Source/Tools/PrintValueTable/
- name: Soup Build PrintValueTable
run: soup build ./Soup/Source/Tools/PrintValueTable/ -flavor ${{matrix.config}}
- name: Soup Restore Migrate
run: soup restore ./Soup/Source/GenerateSharp/Migrate/
- name: Soup Build Migrate
run: soup build ./Soup/Source/GenerateSharp/Migrate/ -flavor ${{matrix.config}}

# Build Samples
- name: Soup Restore C BuildExtension
Expand All @@ -88,7 +91,7 @@ jobs:
- name: Soup Build C StaticLibrary
run: soup build ./Soup/Samples/C/StaticLibrary/Application/ -flavor ${{matrix.config}}
- name: Soup Build C WindowsApplication
if: matrix.os != 'ubuntu-24.04'
if: matrix.os == 'windows-2022'
run: soup build ./Soup/Samples/C/WindowsApplication/ -flavor ${{matrix.config}}

- name: Soup Restore Cpp BuildExtension
Expand All @@ -98,7 +101,7 @@ jobs:
- name: Soup Build Cpp ConsoleApplication
run: soup build ./Soup/Samples/Cpp/ConsoleApplication/ -flavor ${{matrix.config}}
- name: Soup Build Cpp DirectX
if: matrix.os != 'ubuntu-24.04'
if: matrix.os == 'windows-2022'
run: soup build ./Soup/Samples/Cpp/DirectX/ -flavor ${{matrix.config}}
- name: Soup Build Cpp DynamicLibrary
run: soup build ./Soup/Samples/Cpp/DynamicLibrary/Application/ -flavor ${{matrix.config}}
Expand All @@ -111,7 +114,7 @@ jobs:
- name: Soup Build Cpp StaticLibrary
run: soup build ./Soup/Samples/Cpp/StaticLibrary/Application/ -flavor ${{matrix.config}}
- name: Soup Build Cpp WindowsApplication
if: matrix.os != 'ubuntu-24.04'
if: matrix.os == 'windows-2022'
run: soup build ./Soup/Samples/Cpp/WindowsApplication/ -flavor ${{matrix.config}}

- name: Soup Restore CSharp BuildExtension
Expand Down
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "coreclr",
"request": "launch",
"preLaunchTask": "",
"program": "${workspaceFolder}/Source/out/msbuild/bin/Swhere/Debug/net8.0/Swhere.dll",
"program": "${workspaceFolder}/out/msbuild/bin/Swhere/Debug/net9.0/linux-x64/Swhere.dll",
"args": [],
"cwd": "${workspaceFolder}",
"stopAtEntry": false,
Expand Down
2 changes: 1 addition & 1 deletion Samples/CSharp/BuildExtension/Executable/Recipe.sml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: 'Samples.CSharp.BuildExtension.Executable'
Language: 'C#|0'
TargetFramework: 'net8.0'
TargetFramework: 'net9.0'
Type: 'Executable'
Version: 1.0.0
Dependencies: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/CSharp/ConsoleApplication/Recipe.sml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name: 'Samples.CSharp.ConsoleApplication'
Language: 'C#|0'
TargetFramework: 'net8.0'
TargetFramework: 'net9.0'
Type: 'Executable'
Version: 1.0.0
2 changes: 1 addition & 1 deletion Samples/CSharp/Library/Application/Recipe.sml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Name: 'Samples.CSharp.Library.ConsoleApplication'
Language: 'C#|0'
TargetFramework: 'net8.0'
TargetFramework: 'net9.0'
Type: 'Executable'
Version: 1.0.0
Dependencies: {
Expand Down
2 changes: 1 addition & 1 deletion Samples/CSharp/Library/Library/Recipe.sml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Name: 'Samples.CSharp.Library.Library'
Language: 'C#|0'
TargetFramework: 'net8.0'
TargetFramework: 'net9.0'
Version: 1.0.0
4 changes: 4 additions & 0 deletions Samples/Cpp/DirectX/Interface.cpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
module;

#include <compare>

export module Sample.DirectX;

import :DXSample;
Expand Down
4 changes: 2 additions & 2 deletions Scripts/Linux/build-packagemanager
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ SOURCE_DIR=$SCRIPTS_DIR/../../Source
PACKAGE_MANAGER_DIR=$SOURCE_DIR/GenerateSharp/PackageManager

# Build PackageManager
echo dotnet publish $PACKAGE_MANAGER_DIR -c $FLAVOR -f net8.0 -r linux-x64 --self-contained
eval dotnet publish $PACKAGE_MANAGER_DIR -c $FLAVOR -f net8.0 -r linux-x64 --self-contained
echo dotnet publish $PACKAGE_MANAGER_DIR -c $FLAVOR -f net9.0 -r linux-x64 --self-contained
eval dotnet publish $PACKAGE_MANAGER_DIR -c $FLAVOR -f net9.0 -r linux-x64 --self-contained
6 changes: 3 additions & 3 deletions Scripts/Linux/soup
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ mkdir -p $RUN_DIR/BuiltIn/Soup/Wren/$SOUP_WREN_VERSION
cp -p $GLOBAL_PACKAGES_DIR/Wren/Soup/Wren/$SOUP_WREN_VERSION/Recipe.sml $RUN_DIR/BuiltIn/Soup/Wren/$SOUP_WREN_VERSION/Recipe.sml
cp -p -R $GLOBAL_PACKAGES_DIR/Wren/Soup/Wren/$SOUP_WREN_VERSION/out/$CONFIG_HASH/ $RUN_DIR/BuiltIn/Soup/Wren/$SOUP_WREN_VERSION/out/

cp -p -R $MSBUILD_DIR/bin/Soup.Build.PackageManager/Release/net8.0/linux-x64/publish/ $RUN_DIR/PackageManager
cp -p -R $MSBUILD_DIR/bin/Soup.Build.PackageManager/Release/net9.0/linux-x64/publish/ $RUN_DIR/PackageManager

cp -p -R $MSBUILD_DIR/bin/SoupView/Release/net8.0/linux-x64/publish/ $RUN_DIR/View
cp -p -R $MSBUILD_DIR/bin/SoupView/Release/net9.0/linux-x64/publish/ $RUN_DIR/View

cp -p -R $MSBUILD_DIR/bin/Swhere/Release/net8.0/linux-x64/publish/Swhere $RUN_DIR/swhere
cp -p -R $MSBUILD_DIR/bin/Swhere/Release/net9.0/linux-x64/publish/Swhere $RUN_DIR/swhere

eval $RUN_DIR/soup "$@"
6 changes: 3 additions & 3 deletions Scripts/Linux/soupd
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ mkdir -p $RUN_DIR/BuiltIn/Soup/Wren/$SOUP_WREN_VERSION
cp -p $GLOBAL_PACKAGES_DIR/Wren/Soup/Wren/$SOUP_WREN_VERSION/Recipe.sml $RUN_DIR/BuiltIn/Soup/Wren/$SOUP_WREN_VERSION/Recipe.sml
cp -p -R $GLOBAL_PACKAGES_DIR/Wren/Soup/Wren/$SOUP_WREN_VERSION/out/$CONFIG_HASH/ $RUN_DIR/BuiltIn/Soup/Wren/$SOUP_WREN_VERSION/out/

cp -p -R $MSBUILD_DIR/bin/Soup.Build.PackageManager/Debug/net8.0/linux-x64/publish/ $RUN_DIR/PackageManager
cp -p -R $MSBUILD_DIR/bin/Soup.Build.PackageManager/Debug/net9.0/linux-x64/publish/ $RUN_DIR/PackageManager

cp -p -R $MSBUILD_DIR/bin/SoupView/Debug/net8.0/linux-x64/publish/ $RUN_DIR/View
cp -p -R $MSBUILD_DIR/bin/SoupView/Debug/net9.0/linux-x64/publish/ $RUN_DIR/View

cp -p -R $MSBUILD_DIR/bin/Swhere/Debug/net8.0/linux-x64/publish/Swhere $RUN_DIR/swhere
cp -p -R $MSBUILD_DIR/bin/Swhere/Debug/net9.0/linux-x64/publish/Swhere $RUN_DIR/swhere

eval $RUN_DIR/soup "$@"
2 changes: 1 addition & 1 deletion Scripts/Linux/swhere
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ ROOT_DIR=$SCRIPTS_DIR/../..
OUT_DIR=$ROOT_DIR/out


eval $OUT_DIR/msbuild/bin/Swhere/Release/net8.0/linux-x64/publish/Swhere "$@"
eval $OUT_DIR/msbuild/bin/Swhere/Release/net9.0/linux-x64/publish/Swhere "$@"
4 changes: 2 additions & 2 deletions Scripts/Windows/build-packagemanager.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ SET SourceDir=%RootDir%\Source
SET PackageManagerDir=%SourceDir%\GenerateSharp\PackageManager

REM - Build PackageManager
echo dotnet publish %PackageManagerDir% -c %Flavor% -f net8.0 -r win-x64 --self-contained
call dotnet publish %PackageManagerDir% -c %Flavor% -f net8.0 -r win-x64 --self-contained
echo dotnet publish %PackageManagerDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained
call dotnet publish %PackageManagerDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
4 changes: 2 additions & 2 deletions Scripts/Windows/build-swhere.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ SET SourceDir=%RootDir%\Source
SET SWhereDir=%SourceDir%\GenerateSharp\Swhere

REM - Build SWhere tool
echo dotnet publish %SWhereDir% -c %Flavor% -f net8.0 -r win-x64 --self-contained
call dotnet publish %SWhereDir% -c %Flavor% -f net8.0 -r win-x64 --self-contained
echo dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained
call dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
6 changes: 3 additions & 3 deletions Scripts/Windows/build-view.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ SET SourceDir=%RootDir%\Source
SET SWhereDir=%SourceDir%\GenerateSharp\SoupView

REM - Cleanup old publish to work around bug in publish
rmdir /S /Q %RootDir%\out\bin\SoupView\%Flavor%\net8.0\win-x64\publish\
rmdir /S /Q %RootDir%\out\bin\SoupView\%Flavor%\net9.0\win-x64\publish\

REM - Publish SWhere tool
echo dotnet publish %SWhereDir% -c %Flavor% -f net8.0 -r win-x64 --self-contained true
dotnet publish %SWhereDir% -c %Flavor% -f net8.0 -r win-x64 --self-contained true
echo dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained true
dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained true
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
7 changes: 4 additions & 3 deletions Scripts/Windows/soup-release.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ SETLOCAL
SET ScriptsDir=%~dp0
SET RootDir=%ScriptsDir%..\..
SET OutDir=%RootDir%\out
SET MSBuildDir=%OutDir%\msbuild
SET RunDir=%OutDir%\run
SET SourceDir=%RootDir%\Source
SET GlobalPackagesDir=%UserProfile%\.soup\packages
Expand Down Expand Up @@ -30,10 +31,10 @@ robocopy %OutDir%\C++\Local\mkdir\%MKDIR_VERSION%\%ConfigHash%\ %RunDir%\Soup\Bu
robocopy %GlobalPackagesDir%\Wren\Soup\Wren\%SOUP_WREN_VERSION%\ %RunDir%\Soup\BuiltIn\Soup\Wren\%SOUP_WREN_VERSION%\ Recipe.sml /NJH /NJS /NDL > NUL
robocopy %GlobalOutDir%\Wren\Soup\Wren\%SOUP_WREN_VERSION%\%ConfigHash%\ %RunDir%\Soup\BuiltIn\Soup\Wren\%SOUP_WREN_VERSION%\out\ /MIR /NJH /NJS /NDL > NUL

robocopy %OutDir%\bin\Soup.Build.PackageManager\Release\net8.0\win-x64\publish\ %RunDir%\Soup\PackageManager\ *.dll *.exe /MIR /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\Soup.Build.PackageManager\Release\net9.0\win-x64\publish\ %RunDir%\Soup\PackageManager\ *.dll *.exe /MIR /NJH /NJS /NDL > NUL

robocopy %OutDir%\bin\SoupView\Release\net8.0\win-x64\publish\ %RunDir%\Soup\View\ *.dll *.exe /MIR /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\SoupView\Release\net9.0\win-x64\publish\ %RunDir%\Soup\View\ *.dll *.exe /MIR /NJH /NJS /NDL > NUL

robocopy %OutDir%\bin\Swhere\Release\net8.0\win-x64\publish\ %RunDir%\ swhere.exe /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\Swhere\Release\net9.0\win-x64\publish\ %RunDir%\ swhere.exe /NJH /NJS /NDL > NUL

%RunDir%\Soup.cmd %*
6 changes: 3 additions & 3 deletions Scripts/Windows/soup.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ robocopy %OutDir%\C++\Local\mkdir\%MKDIR_VERSION%\%ConfigHash%\ %RunDir%\Soup\Bu
robocopy %GlobalPackagesDir%\Wren\Soup\Wren\%SOUP_WREN_VERSION%\ %RunDir%\Soup\BuiltIn\Soup\Wren\%SOUP_WREN_VERSION%\ Recipe.sml /NJH /NJS /NDL > NUL
robocopy %GlobalOutDir%\Wren\Soup\Wren\%SOUP_WREN_VERSION%\%ConfigHash%\ %RunDir%\Soup\BuiltIn\Soup\Wren\%SOUP_WREN_VERSION%\out\ /MIR /NJH /NJS /NDL > NUL

robocopy %MSBuildDir%\bin\Soup.Build.PackageManager\Release\net8.0\win-x64\publish\ %RunDir%\Soup\PackageManager\ /MIR /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\Soup.Build.PackageManager\Release\net9.0\win-x64\publish\ %RunDir%\Soup\PackageManager\ /MIR /NJH /NJS /NDL > NUL

robocopy %MSBuildDir%\bin\SoupView\Release\net8.0\win-x64\publish\ %RunDir%\Soup\View\ /MIR /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\SoupView\Release\net9.0\win-x64\publish\ %RunDir%\Soup\View\ /MIR /NJH /NJS /NDL > NUL

robocopy %MSBuildDir%\bin\Swhere\Release\net8.0\win-x64\publish\ %RunDir%\ swhere.exe /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\Swhere\Release\net9.0\win-x64\publish\ %RunDir%\ swhere.exe /NJH /NJS /NDL > NUL

%RunDir%\Soup.cmd %*
6 changes: 3 additions & 3 deletions Scripts/Windows/soupd.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ robocopy %OutDir%\C++\Local\mkdir\%MKDIR_VERSION%\%ConfigHash%\ %RunDir%\Soup\Bu
robocopy %GlobalPackagesDir%\Wren\Soup\Wren\%SOUP_WREN_VERSION%\ %RunDir%\Soup\BuiltIn\Soup\Wren\%SOUP_WREN_VERSION%\ Recipe.sml /NJH /NJS /NDL > NUL
robocopy %GlobalOutDir%\Wren\Soup\Wren\%SOUP_WREN_VERSION%\%ConfigHash%\ %RunDir%\Soup\BuiltIn\Soup\Wren\%SOUP_WREN_VERSION%\out\ /MIR /NJH /NJS /NDL > NUL

robocopy %MSBuildDir%\bin\Soup.Build.PackageManager\Debug\net8.0\win-x64\publish\ %RunDir%\Soup\PackageManager\ /MIR /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\Soup.Build.PackageManager\Debug\net9.0\win-x64\publish\ %RunDir%\Soup\PackageManager\ /MIR /NJH /NJS /NDL > NUL

robocopy %MSBuildDir%\bin\SoupView\Debug\net8.0\win-x64\publish\ %RunDir%\Soup\View\ /MIR /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\SoupView\Debug\net9.0\win-x64\publish\ %RunDir%\Soup\View\ /MIR /NJH /NJS /NDL > NUL

robocopy %MSBuildDir%\bin\Swhere\Debug\net8.0\win-x64\publish\ %RunDir%\ swhere.exe /NJH /NJS /NDL > NUL
robocopy %MSBuildDir%\bin\Swhere\Debug\net9.0\win-x64\publish\ %RunDir%\ swhere.exe /NJH /NJS /NDL > NUL

%RunDir%\Soup.cmd %*
2 changes: 1 addition & 1 deletion Scripts/Windows/swhere.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ SET RootDir=%ScriptsDir%..\..
SET OutDir=%RootDir%\out
SET MSBuildDir=%OutDir%\msbuild

%MSBuildDir%\bin\Swhere\Release\net8.0\win-x64\publish\swhere.exe %*
%MSBuildDir%\bin\Swhere\Release\net9.0\win-x64\publish\swhere.exe %*
7 changes: 3 additions & 4 deletions Source/GenerateSharp/Api.Client/Soup.Build.Api.Client.csproj
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="System.Text.Json" Version="8.0.5" />
<PackageReference Include="System.Text.Json" Version="9.0.0" />
</ItemGroup>
</Project>
</Project>
5 changes: 2 additions & 3 deletions Source/GenerateSharp/BootstrapBuild/BootstrapBuild.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Platforms>AnyCPU;x64</Platforms>
<TargetFramework>net9.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Opal\Opal.csproj" />
<ProjectReference Include="..\Utilities\Soup.Utilities.csproj" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion Source/GenerateSharp/BootstrapBuild/PackageLock.sml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Closures: {
Build1: {
Wren: {
'Soup|CSharp': { Version: 0.15.1 }
'Soup|CSharp.Nuget': { Version: 0.5.0 }
'Soup|CSharp.Nuget': { Version: 0.5.2 }
}
}
Tool0: {
Expand Down
Loading

0 comments on commit b6bdd38

Please sign in to comment.