├── .gitattributes ├── root-recipe.sml ├── samples ├── cpp │ ├── parse-json │ │ ├── .gitignore │ │ ├── message.json │ │ ├── recipe.sml │ │ ├── package-lock.sml │ │ └── main.cpp │ ├── build-extension │ │ ├── .gitignore │ │ ├── tool │ │ │ ├── recipe.sml │ │ │ ├── main.cpp │ │ │ └── package-lock.sml │ │ ├── executable │ │ │ ├── recipe.sml │ │ │ ├── main.cpp │ │ │ └── package-lock.sml │ │ └── extension │ │ │ ├── recipe.sml │ │ │ └── package-lock.sml │ ├── dynamic-library │ │ ├── .gitignore │ │ ├── library │ │ │ ├── library.cpp │ │ │ ├── recipe.sml │ │ │ └── public │ │ │ │ └── library.h │ │ └── application │ │ │ ├── recipe.sml │ │ │ ├── main.cpp │ │ │ └── package-lock.sml │ ├── header-library │ │ ├── .gitignore │ │ ├── application │ │ │ ├── recipe.sml │ │ │ ├── main.cpp │ │ │ └── package-lock.sml │ │ └── library │ │ │ ├── recipe.sml │ │ │ └── library.h │ ├── module-interface │ │ ├── .gitignore │ │ ├── recipe.sml │ │ ├── main.cpp │ │ ├── helper.cpp │ │ └── package-lock.sml │ ├── static-library │ │ ├── .gitignore │ │ ├── library │ │ │ ├── recipe.sml │ │ │ └── library.cpp │ │ └── application │ │ │ ├── recipe.sml │ │ │ ├── main.cpp │ │ │ └── package-lock.sml │ ├── console-application │ │ ├── .gitignore │ │ ├── recipe.sml │ │ ├── main.cpp │ │ └── package-lock.sml │ ├── module-dynamic-library │ │ ├── .gitignore │ │ ├── library │ │ │ ├── recipe.sml │ │ │ └── library.cpp │ │ └── application │ │ │ ├── recipe.sml │ │ │ ├── main.cpp │ │ │ └── package-lock.sml │ ├── windows-application │ │ ├── windows-project.h │ │ ├── small.ico │ │ ├── windows-project.ico │ │ ├── windows-project.rc │ │ ├── recipe.sml │ │ ├── targetver.h │ │ ├── framework.h │ │ ├── package-lock.sml │ │ └── resource.h │ └── directx │ │ ├── Interface.cpp │ │ ├── recipe.sml │ │ ├── main.cpp │ │ ├── shaders.hlsl │ │ └── package-lock.sml ├── csharp │ ├── library │ │ ├── .gitignore │ │ ├── library │ │ │ ├── recipe.sml │ │ │ └── helper.cs │ │ └── application │ │ │ ├── recipe.sml │ │ │ ├── program.cs │ │ │ └── package-lock.sml │ ├── build-extension │ │ ├── .gitignore │ │ ├── extension │ │ │ ├── recipe.sml │ │ │ └── package-lock.sml │ │ └── executable │ │ │ ├── recipe.sml │ │ │ ├── program.cs │ │ │ └── package-lock.sml │ └── console-application │ │ ├── .gitignore │ │ ├── recipe.sml │ │ ├── program.cs │ │ └── package-lock.sml └── c │ ├── build-extension │ ├── .gitignore │ ├── extension │ │ ├── recipe.sml │ │ └── package-lock.sml │ └── executable │ │ ├── recipe.sml │ │ ├── main.c │ │ └── package-lock.sml │ ├── dynamic-library │ ├── .gitignore │ ├── library │ │ ├── library.c │ │ ├── public │ │ │ └── library.h │ │ └── recipe.sml │ └── application │ │ ├── main.c │ │ ├── recipe.sml │ │ └── package-lock.sml │ ├── static-library │ ├── .gitignore │ ├── library │ │ ├── public │ │ │ └── library.h │ │ ├── library.c │ │ └── recipe.sml │ └── application │ │ ├── main.c │ │ ├── recipe.sml │ │ └── package-lock.sml │ ├── console-application │ ├── .gitignore │ ├── recipe.sml │ ├── main.c │ └── package-lock.sml │ └── windows-application │ ├── windows-project.h │ ├── small.ico │ ├── windows-project.rc │ ├── windows-project.ico │ ├── recipe.sml │ ├── targetver.h │ ├── package-lock.sml │ ├── framework.h │ └── resource.h ├── global.json ├── init.cmd ├── code ├── bench-tests │ ├── nanobench.cpp │ └── recipe.sml ├── tools │ ├── copy │ │ ├── recipe.sml │ │ └── package-lock.sml │ ├── mkdir │ │ ├── recipe.sml │ │ ├── package-lock.sml │ │ └── main.cpp │ ├── parse-modules │ │ ├── module.cpp │ │ ├── recipe.sml │ │ ├── package-lock.sml │ │ └── early-exit-exception.cpp │ ├── print │ │ └── recipe.sml │ └── bootstrap │ │ ├── properties │ │ └── launchSettings.json │ │ └── recipe.sml ├── generate-sharp │ ├── api.client │ │ ├── recipe.sml │ │ ├── soup.build.api.client.csproj │ │ └── models │ │ │ ├── generate-closure-result.cs │ │ │ ├── package-create-or-update-model.cs │ │ │ ├── file-parameter.cs │ │ │ ├── source-generation-context.cs │ │ │ ├── language-model.cs │ │ │ ├── package-summary-model.cs │ │ │ ├── package-local-or-public-exact-reference-model.cs │ │ │ ├── language-reference-model.cs │ │ │ ├── semantic-version.cs │ │ │ ├── semantic-version-model.cs │ │ │ └── semantic-version-exact-model.cs │ ├── opal │ │ ├── recipe.sml │ │ ├── opal.csproj │ │ ├── io │ │ │ ├── i-console-manager.cs │ │ │ └── i-console-input.cs │ │ ├── system │ │ │ ├── i-input-file.cs │ │ │ ├── i-output-file.cs │ │ │ ├── i-library-manager.cs │ │ │ ├── i-system.cs │ │ │ ├── directory-entry.cs │ │ │ ├── runtime-system.cs │ │ │ ├── i-process-manager.cs │ │ │ ├── i-process.cs │ │ │ ├── runtime-process-manager.cs │ │ │ └── i-library.cs │ │ └── logger │ │ │ ├── event-type-filter.cs │ │ │ ├── scoped-trace-listener-register.cs │ │ │ ├── i-event-filter.cs │ │ │ └── test-trace-listener.cs │ ├── soup-view │ │ ├── assets │ │ │ └── soup.ico │ │ ├── properties │ │ │ └── launchSettings.json │ │ ├── view-models │ │ │ ├── graph-node-view-model.cs │ │ │ ├── property-value-view-model.cs │ │ │ ├── content-pane-view-model.cs │ │ │ ├── view-model-base.cs │ │ │ └── value-table-item-view-model.cs │ │ ├── app.axaml │ │ ├── app.axaml.cs │ │ ├── views │ │ │ ├── task-graph-view.axaml.cs │ │ │ ├── dependency-graph-view.axaml.cs │ │ │ ├── preprocessor-task-graph-view.axaml.cs │ │ │ ├── main-window.axaml.cs │ │ │ ├── operation-graph-view.axaml.cs │ │ │ ├── graph-viewer-item.axaml │ │ │ └── preprocessor-operation-graph-view.axaml.cs │ │ ├── app.manifest │ │ └── utilities │ │ │ └── view-locator.cs │ ├── migrate │ │ ├── recipe.sml │ │ ├── properties │ │ │ └── launchSettings.json │ │ ├── msbuild │ │ │ ├── compile-item.cs │ │ │ ├── project-reference-item.cs │ │ │ └── package-reference-item.cs │ │ ├── migrate.csproj │ │ └── package-lock.sml │ ├── swhere │ │ ├── recipe.sml │ │ ├── os-platform.cs │ │ ├── nuget │ │ │ ├── nuspec-dependency-base.cs │ │ │ ├── nuget-package-dependency.cs │ │ │ ├── nuget-package.cs │ │ │ ├── nuget-package-version.cs │ │ │ └── nuget-package-target-framework.cs │ │ ├── swhere.csproj │ │ ├── package-lock.sml │ │ └── source-set-utilities.cs │ ├── package-manager │ │ ├── properties │ │ │ └── launchSettings.json │ │ ├── recipe.sml │ │ ├── izip-archive.cs │ │ ├── izip-manager.cs │ │ ├── i-authentication-manager.cs │ │ ├── i-closure-manager.cs │ │ ├── compression-zip-manager.cs │ │ ├── compression-zip-archive.cs │ │ ├── package-lock.sml │ │ └── soup.build.package-manager.csproj │ ├── soup-native-interop │ │ ├── recipe.sml │ │ ├── load-build-graph-result-context.cs │ │ └── load-build-graph-result.cs │ ├── utilities │ │ ├── recipe.sml │ │ ├── soup.utilities.csproj │ │ ├── collection-extensions.cs │ │ ├── sml │ │ │ └── grammar │ │ │ │ ├── SML.tokens │ │ │ │ └── sml-lexer.tokens │ │ └── handled-exception.cs │ ├── package-manager.unittests │ │ ├── ihttp-message-handler.cs │ │ └── soup.build.package-manager.unittests.csproj │ ├── swhere.core.unittests │ │ └── swhere.unittests.csproj │ ├── utilities.unittests │ │ ├── recipe │ │ │ └── package-name-unittests.cs │ │ └── soup.utilities.unittests.csproj │ └── opal.unittests │ │ └── opal.unittests.csproj ├── monitor │ ├── test │ │ ├── recipe.sml │ │ └── main.cpp │ ├── shared │ │ ├── recipe.sml │ │ ├── message-type.h │ │ ├── message.h │ │ ├── linux │ │ │ └── detour-event-type.h │ │ ├── windows │ │ │ └── process-payload.h │ │ └── module.cpp │ ├── host │ │ ├── linux │ │ │ └── environment.h │ │ ├── recipe.sml │ │ ├── isystem-access-monitor.h │ │ └── scoped-monitor-process-manager-register.h │ ├── log │ │ └── recipe.sml │ └── client │ │ ├── recipe.sml │ │ ├── windows │ │ └── functions │ │ │ └── cache │ │ │ ├── process-env.h │ │ │ ├── undocumented-api.h │ │ │ └── lib-loader-api.h │ │ ├── package-lock.sml │ │ ├── Helpers.h │ │ └── main.cpp ├── installer │ ├── README.md │ └── soup-installer │ │ ├── images │ │ ├── dialog-banner.bmp │ │ └── dialog-background.bmp │ │ └── soup-installer.csproj ├── stylecop.json ├── client │ ├── native │ │ └── recipe.sml │ ├── cli │ │ ├── source │ │ │ ├── options │ │ │ │ ├── version-options.h │ │ │ │ ├── view-options.h │ │ │ │ ├── shared-options.h │ │ │ │ ├── publish-options.h │ │ │ │ ├── initialize-options.h │ │ │ │ └── restore-options.h │ │ │ ├── commands │ │ │ │ ├── i-command.h │ │ │ │ └── version-command.h │ │ │ └── main.cpp │ │ ├── tests │ │ │ ├── gen │ │ │ │ ├── commands │ │ │ │ │ ├── build-command-tests.gen.h │ │ │ │ │ ├── install-command-tests.gen.h │ │ │ │ │ ├── publish-command-tests.gen.h │ │ │ │ │ ├── version-command-tests.gen.h │ │ │ │ │ └── initialize-command-tests.gen.h │ │ │ │ └── test-main.cpp │ │ │ └── commands │ │ │ │ ├── build-command-tests.h │ │ │ │ ├── install-command-tests.h │ │ │ │ ├── publish-command-tests.h │ │ │ │ ├── version-command-tests.h │ │ │ │ └── initialize-command-tests.h │ │ └── recipe.sml │ └── core │ │ ├── tests │ │ ├── gen │ │ │ ├── build │ │ │ │ ├── package-provider-tests.gen.cpp │ │ │ │ ├── recipe-build-location-manager-tests.gen.cpp │ │ │ │ └── build-engine-tests.gen.cpp │ │ │ ├── local-user-config │ │ │ │ ├── local-user-config-tests.gen.cpp │ │ │ │ └── local-user-config-extensions-tests.gen.cpp │ │ │ ├── operation-graph │ │ │ │ ├── operation-graph-writer-tests.gen.cpp │ │ │ │ ├── operation-results-writer-tests.gen.cpp │ │ │ │ ├── operation-graph-manager-tests.gen.cpp │ │ │ │ ├── operation-results-manager-tests.gen.cpp │ │ │ │ └── operation-results-tests.gen.cpp │ │ │ ├── value-table │ │ │ │ └── value-table-manager-tests.gen.cpp │ │ │ ├── recipe │ │ │ │ └── recipe-extensions-tests.gen.cpp │ │ │ └── package │ │ │ │ └── package-manager-tests.gen.cpp │ │ └── local-user-config │ │ │ └── local-user-config-tests.cpp │ │ ├── recipe.sml │ │ └── source │ │ ├── build │ │ ├── known-language.cpp │ │ ├── build-failed-exception.cpp │ │ └── ievaluate-engine.cpp │ │ └── utilities │ │ └── handled-exception.cpp ├── generate │ ├── recipe.sml │ └── extension-task-details.h └── generate-test │ └── recipe.sml ├── docs ├── assets │ ├── getting-started-init.gif │ ├── getting-started-run.gif │ ├── getting-started-build.gif │ ├── getting-started-swhere.gif │ └── getting-started-winget.gif ├── architecture │ ├── build-task.md │ ├── language-version-resolution.md │ ├── root-recipe.md │ ├── build-extension.md │ ├── build-operation.md │ ├── shared-state-table.md │ ├── package-reference.md │ ├── active-state-table.md │ ├── local-user-config.md │ └── parameters-table.md ├── cli │ ├── version.md │ ├── init.md │ ├── view.md │ ├── publish.md │ ├── restore.md │ ├── install.md │ ├── build.md │ ├── target.md │ └── run.md ├── contributing.md ├── samples.md ├── samples │ ├── csharp.md │ └── c.md ├── tools │ └── swhere.md ├── developer-setup.md └── cli.md ├── scripts ├── windows │ ├── install │ │ └── soup.cmd │ ├── swhere.cmd │ ├── uninstall.cmd │ ├── install.cmd │ ├── sign-installer.cmd │ ├── build-swhere.cmd │ ├── generate-sml-lexer.cmd │ ├── generate-module-parser-lexer.cmd │ ├── build-packagemanager.cmd │ ├── generate-languagereference-lexer.cmd │ ├── build-view.cmd │ ├── generate-sml-antlr.cmd │ ├── release.cmd │ ├── sign-runtime.cmd │ └── build.cmd └── linux │ ├── swhere │ ├── install │ ├── build-swhere │ ├── build-packagemanager │ ├── generate-sml-lexer │ ├── generate-module-parser-lexer │ ├── build-view │ ├── bootstrap │ ├── build │ ├── build-client │ └── release ├── init.sh ├── .gitignore ├── .devcontainer ├── devcontainer.json └── Dockerfile ├── .vscode └── tasks.json ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md └── LICENSE /.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto -------------------------------------------------------------------------------- /root-recipe.sml: -------------------------------------------------------------------------------- 1 | OutputRoot: './out/' -------------------------------------------------------------------------------- /samples/cpp/parse-json/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/csharp/library/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/c/build-extension/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/c/dynamic-library/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/c/static-library/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/cpp/build-extension/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/cpp/dynamic-library/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/cpp/header-library/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/cpp/module-interface/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/cpp/static-library/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/c/console-application/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/cpp/console-application/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/csharp/build-extension/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/cpp/module-dynamic-library/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /samples/csharp/console-application/.gitignore: -------------------------------------------------------------------------------- 1 | out/ -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "sdk": { 3 | "version": "9.0.*" 4 | } 5 | } -------------------------------------------------------------------------------- /samples/cpp/parse-json/message.json: -------------------------------------------------------------------------------- 1 | { 2 | "message": "Hello!" 3 | } -------------------------------------------------------------------------------- /samples/c/static-library/library/public/library.h: -------------------------------------------------------------------------------- 1 | 2 | const char* GetName(); -------------------------------------------------------------------------------- /init.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SET ROOT=%~dp0 3 | SET PATH=%ROOT%\Scripts\Windows\;%PATH% -------------------------------------------------------------------------------- /code/bench-tests/nanobench.cpp: -------------------------------------------------------------------------------- 1 | #define ANKERL_NANOBENCH_IMPLEMENT 2 | #include "nanobench.h" -------------------------------------------------------------------------------- /samples/c/windows-application/windows-project.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" -------------------------------------------------------------------------------- /samples/cpp/windows-application/windows-project.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" -------------------------------------------------------------------------------- /code/tools/copy/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'copy' 2 | Language: 'C++|0' 3 | Version: 1.2.0 4 | Type: 'Executable' -------------------------------------------------------------------------------- /code/generate-sharp/api.client/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Api.Client' 2 | Language: 'C#|0' 3 | Version: 1.0.0 -------------------------------------------------------------------------------- /code/monitor/test/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Monitor.Test' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'Executable' -------------------------------------------------------------------------------- /code/generate-sharp/opal/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Opal' 2 | Language: 'C#|0' 3 | Version: 1.0.0 4 | TargetFramework: 'net9.0' -------------------------------------------------------------------------------- /docs/assets/getting-started-init.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/docs/assets/getting-started-init.gif -------------------------------------------------------------------------------- /docs/assets/getting-started-run.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/docs/assets/getting-started-run.gif -------------------------------------------------------------------------------- /scripts/windows/install/soup.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET ScriptsDir=%~dp0 4 | 5 | "%ScriptsDir%\Soup\soup.exe" %* -------------------------------------------------------------------------------- /code/installer/README.md: -------------------------------------------------------------------------------- 1 | ## Setup 2 | * Download latest version of [WiX toolset](https://github.com/wixtoolset/wix3/releases) -------------------------------------------------------------------------------- /docs/assets/getting-started-build.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/docs/assets/getting-started-build.gif -------------------------------------------------------------------------------- /docs/assets/getting-started-swhere.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/docs/assets/getting-started-swhere.gif -------------------------------------------------------------------------------- /docs/assets/getting-started-winget.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/docs/assets/getting-started-winget.gif -------------------------------------------------------------------------------- /samples/c/dynamic-library/library/library.c: -------------------------------------------------------------------------------- 1 | #include "library.h" 2 | 3 | const char* GetName() 4 | { 5 | return "Soup"; 6 | } -------------------------------------------------------------------------------- /samples/c/dynamic-library/library/public/library.h: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | __declspec(dllexport) 3 | #endif 4 | const char* GetName(); -------------------------------------------------------------------------------- /samples/c/static-library/library/library.c: -------------------------------------------------------------------------------- 1 | #include "library.h" 2 | 3 | const char* GetName() 4 | { 5 | return "Soup"; 6 | } -------------------------------------------------------------------------------- /samples/c/windows-application/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/samples/c/windows-application/small.ico -------------------------------------------------------------------------------- /samples/cpp/windows-application/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/samples/cpp/windows-application/small.ico -------------------------------------------------------------------------------- /docs/architecture/build-task.md: -------------------------------------------------------------------------------- 1 | # Build Task 2 | 3 | The [Wren](https://wren.io/) implementation of the ```SoupTask``` interface. 4 | -------------------------------------------------------------------------------- /samples/c/console-application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.ConsoleApplication' 2 | Language: 'C|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 -------------------------------------------------------------------------------- /samples/cpp/module-interface/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.ModuleInterface' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/assets/soup.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/code/generate-sharp/soup-view/assets/soup.ico -------------------------------------------------------------------------------- /code/stylecop.json: -------------------------------------------------------------------------------- 1 | { 2 | "settings": { 3 | "documentationRules": { 4 | "companyName": "Soup" 5 | } 6 | } 7 | } -------------------------------------------------------------------------------- /samples/c/console-application/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | printf("Hello World, Soup Style!"); 6 | return 0; 7 | } -------------------------------------------------------------------------------- /samples/c/windows-application/windows-project.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/samples/c/windows-application/windows-project.rc -------------------------------------------------------------------------------- /samples/cpp/build-extension/tool/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.SimpleBuildExtension.Tool' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 -------------------------------------------------------------------------------- /samples/cpp/console-application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.ConsoleApplication' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 -------------------------------------------------------------------------------- /init.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) 3 | export PATH=$SCRIPT_DIR/scripts/linux:$PATH -------------------------------------------------------------------------------- /samples/c/windows-application/windows-project.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/samples/c/windows-application/windows-project.ico -------------------------------------------------------------------------------- /samples/cpp/static-library/library/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.StaticLibrary.Library' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'StaticLibrary' -------------------------------------------------------------------------------- /samples/cpp/windows-application/windows-project.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/samples/cpp/windows-application/windows-project.ico -------------------------------------------------------------------------------- /samples/cpp/windows-application/windows-project.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/samples/cpp/windows-application/windows-project.rc -------------------------------------------------------------------------------- /samples/csharp/library/library/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.CSharp.Library.Library' 2 | Language: 'C#|0' 3 | TargetFramework: 'net9.0' 4 | Version: 1.0.0 -------------------------------------------------------------------------------- /code/installer/soup-installer/images/dialog-banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/code/installer/soup-installer/images/dialog-banner.bmp -------------------------------------------------------------------------------- /samples/cpp/build-extension/tool/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | std::cout << "Tool, Soup Style!" << std::endl; 6 | return 0; 7 | } -------------------------------------------------------------------------------- /code/installer/soup-installer/images/dialog-background.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/soup-build/soup/HEAD/code/installer/soup-installer/images/dialog-background.bmp -------------------------------------------------------------------------------- /samples/cpp/console-application/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | std::cout << "Hello World, Soup Style!" << std::endl; 6 | return 0; 7 | } -------------------------------------------------------------------------------- /samples/c/windows-application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.WindowsApplication' 2 | Language: 'C|0' 3 | Type: 'Windows' 4 | Version: 1.0.0 5 | Resources: 'windows-project.rc' -------------------------------------------------------------------------------- /samples/cpp/module-dynamic-library/library/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.ModuleDynamicLibrary.Library' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'DynamicLibrary' -------------------------------------------------------------------------------- /code/generate-sharp/opal/opal.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | 5 | -------------------------------------------------------------------------------- /code/tools/mkdir/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'mkdir' 2 | Language: 'C++|0' 3 | Version: 1.2.0 4 | Type: 'Executable' 5 | Dependencies: { 6 | Runtime: [ 7 | 'mwasplund|Opal@0' 8 | ] 9 | } -------------------------------------------------------------------------------- /code/tools/parse-modules/module.cpp: -------------------------------------------------------------------------------- 1 | export module parse.modules; 2 | 3 | import Opal; 4 | 5 | // Parse 6 | export import :EarlyExitException; 7 | export import :ModuleParser; -------------------------------------------------------------------------------- /samples/cpp/windows-application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.WindowsApplication' 2 | Language: 'C++|0' 3 | Type: 'Windows' 4 | Version: 1.0.0 5 | Resources: 'windows-project.rc' -------------------------------------------------------------------------------- /samples/c/static-library/application/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | printf("Hello World, %s Style!", GetName()); 7 | return 0; 8 | } -------------------------------------------------------------------------------- /samples/csharp/console-application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.CSharp.ConsoleApplication' 2 | Language: 'C#|0' 3 | TargetFramework: 'net9.0' 4 | Type: 'Executable' 5 | Version: 1.0.0 -------------------------------------------------------------------------------- /code/bench-tests/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.BenchTests' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'Executable' 5 | Dependencies: { 6 | Runtime: [ 7 | '../client/core/' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/c/dynamic-library/application/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main() 5 | { 6 | printf("Hello World, %s Style!", GetName()); 7 | return 0; 8 | } -------------------------------------------------------------------------------- /code/monitor/shared/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Monitor.Shared' 2 | Description: 'The shared resources that are used from both the detoured process and the monitor manager.' 3 | Language: 'C++|0' 4 | Version: 1.0.0 -------------------------------------------------------------------------------- /samples/cpp/parse-json/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.ParseJson' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'Executable' 5 | Dependencies: { 6 | Runtime: [ 7 | 'mwasplund|json11@1' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/c/build-extension/extension/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.BuildExtension.Extension' 2 | Language: 'Wren|0' 3 | Version: 1.0.0 4 | Dependencies: { 5 | Runtime: [ 6 | 'Soup|Build.Utils@0' 7 | ] 8 | } -------------------------------------------------------------------------------- /samples/cpp/dynamic-library/library/library.cpp: -------------------------------------------------------------------------------- 1 | #include "library.h" 2 | 3 | namespace Samples::Cpp::DynamicLibrary::Library 4 | { 5 | const char* Helper::GetName() 6 | { 7 | return "Soup"; 8 | } 9 | } -------------------------------------------------------------------------------- /samples/csharp/library/library/helper.cs: -------------------------------------------------------------------------------- 1 | namespace Samples.CSharp.Library 2 | { 3 | public class Helper 4 | { 5 | public static string GetName() 6 | { 7 | return "Soup"; 8 | } 9 | }; 10 | } -------------------------------------------------------------------------------- /samples/csharp/build-extension/extension/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.CSharp.BuildExtension.Extension' 2 | Language: 'Wren|0' 3 | Version: 1.0.0 4 | Dependencies: { 5 | Runtime: [ 6 | 'Soup|Build.Utils@0' 7 | ] 8 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Visual Studio 2 | .vs/ 3 | 4 | # VSCode 5 | .vscode/settings.json 6 | 7 | # Soup 8 | /out/ 9 | 10 | # Wix 11 | wix/ 12 | 13 | # Antlr 14 | .antlr/ 15 | 16 | # Avalonia 17 | .avalonia-build-tasks/ -------------------------------------------------------------------------------- /code/client/native/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Native' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'DynamicLibrary' 5 | Dependencies: { 6 | Runtime: [ 7 | '../core/' 8 | 'mwasplund|json11@1' 9 | ] 10 | } -------------------------------------------------------------------------------- /code/tools/print/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'soup.print' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'Executable' 5 | Dependencies: { 6 | Runtime: [ 7 | 'mwasplund|Opal@0' 8 | '../../client/core/' 9 | ] 10 | } -------------------------------------------------------------------------------- /samples/c/dynamic-library/application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.DynamicLibrary.Application' 2 | Language: 'C|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../library/' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/c/static-library/application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.StaticLibrary.Application' 2 | Language: 'C|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../library/' 8 | ] 9 | } -------------------------------------------------------------------------------- /code/generate-sharp/migrate/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Migrate' 2 | Language: 'C#|0' 3 | Version: 1.0.0 4 | Type: 'Executable' 5 | TargetFramework: 'net9.0' 6 | Dependencies: { 7 | Runtime: [ 8 | '../utilities/' 9 | ] 10 | } -------------------------------------------------------------------------------- /code/monitor/shared/message-type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Monitor 4 | { 5 | export enum class MessageType : uint32_t 6 | { 7 | Initialize, 8 | Shutdown, 9 | Error, 10 | 11 | Detour, 12 | }; 13 | } -------------------------------------------------------------------------------- /code/tools/bootstrap/properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "SoupBootstrap": { 4 | "commandName": "Project", 5 | "commandLineArgs": "C:\\Users\\mwasp\\Dev\\Repos\\Soup\\" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /samples/c/build-extension/executable/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.SimpleBuildExtension.Executable' 2 | Language: 'C|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Build: [ 7 | '../extension/' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/cpp/header-library/application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.HeaderLibrary.Application' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../library/' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/cpp/static-library/application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.StaticLibrary.Application' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../library/' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/cpp/build-extension/executable/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.SimpleBuildExtension.Executable' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Build: [ 7 | '../extension/' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/cpp/dynamic-library/application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.DynamicLibrary.Application' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../library/' 8 | ] 9 | } -------------------------------------------------------------------------------- /samples/cpp/module-interface/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | import Samples.Cpp.ModuleInterface; 4 | 5 | int main() 6 | { 7 | std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl; 8 | return 0; 9 | } -------------------------------------------------------------------------------- /docs/cli/version.md: -------------------------------------------------------------------------------- 1 | # Version 2 | ## Overview 3 | Print the version of the Soup executable. 4 | ``` 5 | soup version 6 | ``` 7 | 8 | ## Examples 9 | The one and only way to use this command. 10 | ``` 11 | soup version 12 | ``` -------------------------------------------------------------------------------- /samples/c/build-extension/executable/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | #ifdef SPECIAL_BUILD 6 | printf("Hello World, Soup Style!"); 7 | #else 8 | printf("Hello World..."); 9 | #endif 10 | return 0; 11 | } -------------------------------------------------------------------------------- /samples/cpp/header-library/library/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.HeaderLibrary.Library' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | PublicHeaders: [ 5 | { 6 | Root: './' 7 | Files: [ 8 | 'library.h' 9 | ] 10 | } 11 | ] -------------------------------------------------------------------------------- /samples/cpp/module-dynamic-library/application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.ModuleDynamicLibrary.Application' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../library/' 8 | ] 9 | } -------------------------------------------------------------------------------- /code/generate/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Generate' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../client/core/' 8 | '[C]mwasplund|wren@1' 9 | 'mwasplund|Opal@0' 10 | ] 11 | } -------------------------------------------------------------------------------- /samples/cpp/directx/Interface.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Sample.DirectX; 6 | 7 | import :DXSample; 8 | import :DXSampleHelper; 9 | export import :D3D12HelloTriangle; 10 | export import :Win32Application; -------------------------------------------------------------------------------- /scripts/windows/swhere.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET ScriptsDir=%~dp0 4 | SET RootDir=%ScriptsDir%..\.. 5 | SET OutDir=%RootDir%\out 6 | SET MSBuildDir=%OutDir%\msbuild 7 | 8 | %MSBuildDir%\bin\swhere\Release\net9.0\win-x64\publish\swhere.exe %* -------------------------------------------------------------------------------- /code/generate-sharp/migrate/properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Migrate": { 4 | "commandName": "Project", 5 | "commandLineArgs": "../../../../../../../code/generate-sharp/migrate/Migrate.csproj" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /code/generate-test/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Generate.Test' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.0.0 5 | Dependencies: { 6 | Runtime: [ 7 | '../client/core/' 8 | '[C]mwasplund|wren@1' 9 | 'mwasplund|Opal@0' 10 | ] 11 | } -------------------------------------------------------------------------------- /code/monitor/host/linux/environment.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | 7 | // The existing environment for this process 8 | extern char **environ; -------------------------------------------------------------------------------- /samples/cpp/build-extension/extension/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.BuildExtension.Extension' 2 | Language: 'Wren|0' 3 | Version: 1.0.0 4 | Dependencies: { 5 | Runtime: [ 6 | 'Soup|Build.Utils@0' 7 | ] 8 | Tool: [ 9 | '../tool/' 10 | ] 11 | } -------------------------------------------------------------------------------- /code/monitor/test/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char** argv) 5 | { 6 | std::ofstream outfile("test.txt"); 7 | outfile << "my text here!" << std::endl; 8 | outfile.close(); 9 | 10 | return 0; 11 | } -------------------------------------------------------------------------------- /docs/architecture/language-version-resolution.md: -------------------------------------------------------------------------------- 1 | # Language Version Resolution 2 | 3 | The Build requires that all package versions be resolved during the restore command to produce an explicit package lock with an exact set of packages to use. 4 | 5 | 6 | -------------------------------------------------------------------------------- /samples/cpp/header-library/library/library.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | namespace Samples::Cpp::HeaderLibrary::Library 4 | { 5 | class Helper 6 | { 7 | public: 8 | static std::string GetName() 9 | { 10 | return "Soup"; 11 | } 12 | }; 13 | } -------------------------------------------------------------------------------- /scripts/linux/swhere: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Stop on first error 4 | set -e 5 | 6 | SCRIPTS_DIR=$(dirname "$0") 7 | ROOT_DIR=$SCRIPTS_DIR/../.. 8 | OUT_DIR=$ROOT_DIR/out 9 | 10 | $OUT_DIR/msbuild/bin/swhere/Release/net9.0/linux-x64/publish/swhere "$@" -------------------------------------------------------------------------------- /scripts/windows/uninstall.cmd: -------------------------------------------------------------------------------- 1 | SETLOCAL 2 | SET ScriptsDir=%~dp0 3 | SET RootDir=%ScriptsDir%..\.. 4 | SET CodeDir=%RootDir%\code 5 | SET InstallerDir=%CodeDir%\installer\soup-installer\msi 6 | pushd %InstallerDir% 7 | start msiexec /uninstall Soup.msi 8 | popd -------------------------------------------------------------------------------- /samples/csharp/library/application/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.CSharp.Library.ConsoleApplication' 2 | Language: 'C#|0' 3 | TargetFramework: 'net9.0' 4 | Type: 'Executable' 5 | Version: 1.0.0 6 | Dependencies: { 7 | Runtime: [ 8 | '../library/' 9 | ] 10 | } -------------------------------------------------------------------------------- /samples/cpp/directx/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.DirectX' 2 | Language: 'C++|0' 3 | Type: 'Windows' 4 | Version: 1.0.0 5 | PlatformLibraries: [ 6 | 'D3D12.lib' 7 | 'D3DCompiler.lib' 8 | 'DXGI.lib' 9 | ] 10 | RuntimeDependencies: [ 11 | 'shaders.hlsl' 12 | ] -------------------------------------------------------------------------------- /samples/csharp/build-extension/executable/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.CSharp.BuildExtension.Executable' 2 | Language: 'C#|0' 3 | TargetFramework: 'net9.0' 4 | Type: 'Executable' 5 | Version: 1.0.0 6 | Dependencies: { 7 | Build: [ 8 | '../extension/' 9 | ] 10 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Swhere' 2 | Language: 'C#|0' 3 | Version: 1.0.0 4 | Type: 'Executable' 5 | Source: [ 6 | 'program.cs' 7 | ] 8 | Dependencies: { 9 | Runtime: [ 10 | '../swhere.core/' 11 | '../utilities/' 12 | '../opal/' 13 | ] 14 | } -------------------------------------------------------------------------------- /code/tools/parse-modules/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'parse.modules' 2 | Language: 'C++|0' 3 | Type: 'Executable' 4 | Version: 1.2.1 5 | Defines: [ 6 | # 'SHOW_TOKENS' 7 | ] 8 | Dependencies: { 9 | Runtime: [ 10 | 'mwasplund|Opal@0' 11 | 'mwasplund|reflex@5' 12 | ] 13 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/os-platform.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Soup.Build.Discover; 6 | 7 | public enum OSPlatform 8 | { 9 | Linux, 10 | Windows, 11 | } -------------------------------------------------------------------------------- /scripts/windows/install.cmd: -------------------------------------------------------------------------------- 1 | SETLOCAL 2 | SET ScriptsDir=%~dp0 3 | SET RootDir=%ScriptsDir%..\.. 4 | SET OutDir=%RootDir%\out 5 | 6 | SET SOUP_VERSION=0.42.7 7 | 8 | pushd %OutDir%\release 9 | msiexec /package soup-build-%SOUP_VERSION%-windows-x64.msi /passive 10 | popd -------------------------------------------------------------------------------- /docs/architecture/root-recipe.md: -------------------------------------------------------------------------------- 1 | # Root Recipe 2 | 3 | The Root Recipe file is used to specify shared state between multiple Recipe packages under the same directory hierarchy. Currently the only state it can set is the shared output directory root that allows for out of source builds. -------------------------------------------------------------------------------- /samples/cpp/build-extension/executable/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() 4 | { 5 | #ifdef SPECIAL_BUILD 6 | std::cout << "Hello World, Soup Style!" << std::endl; 7 | #else 8 | std::cout << "Hello World..." << std::endl; 9 | #endif 10 | 11 | return 0; 12 | } -------------------------------------------------------------------------------- /samples/cpp/header-library/application/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Samples::Cpp::HeaderLibrary::Library; 5 | 6 | int main() 7 | { 8 | std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl; 9 | return 0; 10 | } -------------------------------------------------------------------------------- /samples/csharp/console-application/program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Samples.CSharp.ConsoleApplication 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | Console.WriteLine("Hello World, Soup Style!"); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/nuget/nuspec-dependency-base.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Swhere.Core.Nuget; 6 | 7 | public class NuspecDependencyBase 8 | { 9 | } 10 | -------------------------------------------------------------------------------- /code/monitor/log/recipe.sml: -------------------------------------------------------------------------------- 1 | # A sample Monitor that logs all access to disk 2 | Name: 'LogMonitor' 3 | Language: 'C++|0' 4 | Version: 1.0.0 5 | Type: 'Executable' 6 | Dependencies: { 7 | Runtime: [ 8 | 'mwasplund|Detours@4' 9 | 'mwasplund|Opal@0' 10 | '../shared/' 11 | ] 12 | } -------------------------------------------------------------------------------- /code/monitor/shared/message.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "message-type.h" 3 | 4 | namespace Monitor 5 | { 6 | export struct Message 7 | { 8 | public: 9 | MessageType Type; 10 | uint32_t ContentSize; 11 | uint8_t Content[2048 - sizeof(Type) - sizeof(ContentSize)]; 12 | }; 13 | } -------------------------------------------------------------------------------- /samples/cpp/dynamic-library/application/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace Samples::Cpp::DynamicLibrary::Library; 5 | 6 | int main() 7 | { 8 | std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl; 9 | return 0; 10 | } -------------------------------------------------------------------------------- /code/generate-sharp/api.client/soup.build.api.client.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /code/generate-sharp/migrate/msbuild/compile-item.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Soup.Build.Migrate; 6 | 7 | public class CompileItem 8 | { 9 | public string? Remove { get; set; } 10 | } -------------------------------------------------------------------------------- /samples/c/static-library/library/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.StaticLibrary.Library' 2 | Language: 'C|0' 3 | Version: 1.0.0 4 | Type: 'StaticLibrary' 5 | IncludePaths: [ 6 | 'public/' 7 | ] 8 | PublicHeaders: [ 9 | { 10 | Root: 'public/' 11 | Files: [ 12 | 'library.h' 13 | ] 14 | } 15 | ] -------------------------------------------------------------------------------- /samples/csharp/library/application/program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Samples.CSharp.Library.Application 4 | { 5 | public class Program 6 | { 7 | public static void Main(string[] args) 8 | { 9 | Console.WriteLine($"Hello World, {Helper.GetName()} Style!"); 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /samples/c/dynamic-library/library/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.C.DynamicLibrary.Library' 2 | Language: 'C|0' 3 | Version: 1.0.0 4 | Type: 'DynamicLibrary' 5 | IncludePaths: [ 6 | 'public/' 7 | ] 8 | PublicHeaders: [ 9 | { 10 | Root: 'public/' 11 | Files: [ 12 | 'library.h' 13 | ] 14 | } 15 | ] -------------------------------------------------------------------------------- /samples/cpp/static-library/application/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | import Samples.Cpp.StaticLibrary.Library; 4 | using namespace Samples::Cpp::StaticLibrary::Library; 5 | 6 | int main() 7 | { 8 | std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl; 9 | return 0; 10 | } -------------------------------------------------------------------------------- /docs/contributing.md: -------------------------------------------------------------------------------- 1 | # Welcome! 2 | We are in the early stages of development, however it is never to early to start contributing! 3 | 4 | For now please follow standard practices for projects on GitHub! This document will continue to grow with the community as we adopt our own guidelines for contributing to the project. 5 | -------------------------------------------------------------------------------- /samples/cpp/module-interface/helper.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | // Include all standard library headers in the global module 4 | #include 5 | 6 | export module Samples.Cpp.ModuleInterface; 7 | 8 | export class Helper 9 | { 10 | public: 11 | static std::string GetName() 12 | { 13 | return "Soup"; 14 | } 15 | }; -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/generate-closure-result.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Soup.Build.Api.Client; 6 | 7 | public enum GenerateClosureResult 8 | { 9 | Success, 10 | Failure, 11 | } -------------------------------------------------------------------------------- /code/tools/bootstrap/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Bootstrap' 2 | Language: 'C#|0' 3 | Version: 1.0.0 4 | TargetFramework: 'net9.0' 5 | Type: 'Executable' 6 | Dependencies: { 7 | Runtime: [ 8 | '../../generate-sharp/utilities/' 9 | '../../generate-sharp/opal/' 10 | '../../generate-sharp/soup-native-interop/' 11 | ] 12 | } -------------------------------------------------------------------------------- /samples/cpp/module-dynamic-library/application/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | import Samples.Cpp.ModuleDynamicLibrary.Library; 4 | using namespace Samples::Cpp::DynamicLibrary::Library; 5 | 6 | int main() 7 | { 8 | std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl; 9 | return 0; 10 | } -------------------------------------------------------------------------------- /docs/samples.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | These samples are a small set of all the cool things you can do with the Soup Build System. The source for these samples can be found in the main Soup repository in the Samples folder. 3 | 4 | ## [C Samples](samples/c.md) 5 | 6 | ## [C++ Samples](samples/cpp.md) 7 | 8 | ## [C# Samples](samples/csharp.md) -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "SoupView": { 4 | "commandName": "Project", 5 | "commandLineArgs": "..\\..\\..\\code\\client\\cli\\recipe.sml", 6 | "workingDirectory": "..\\..\\..\\out\\run\\Soup\\", 7 | "nativeDebugging": true 8 | } 9 | } 10 | } -------------------------------------------------------------------------------- /code/monitor/host/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Monitor.Host' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Defines: [ 5 | # 'TRACE_DETOUR_SERVER' 6 | # 'TRACE_MONITOR_HOST' 7 | ] 8 | Dependencies: { 9 | Runtime: [ 10 | 'mwasplund|Detours@4' 11 | '[C]mwasplund|libseccomp@2.5' 12 | 'mwasplund|Opal@0' 13 | '../shared/' 14 | ] 15 | } 16 | -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Soup.Build.PackageManager": { 4 | "commandName": "Project", 5 | "commandLineArgs2": "restore-packages [TEST_DIR]", 6 | "commandLineArgs": "publish-package C:/Users/mwasp/Dev/Repos/soup/code/generate-sharp/opal" 7 | } 8 | } 9 | } -------------------------------------------------------------------------------- /scripts/linux/install: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Stop on first error 4 | set -e 5 | 6 | SCRIPTS_DIR=$(dirname "$0") 7 | ROOT_DIR=$SCRIPTS_DIR/../.. 8 | OUT_DIR=$ROOT_DIR/out 9 | RUN_DIR=$OUT_DIR/run 10 | RELEASE_DIR=$OUT_DIR/release 11 | VERSION=$($RUN_DIR/bin/soup "version") 12 | 13 | sudo apt install -f $RELEASE_DIR/soup-build_$VERSION-1_amd64.deb -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "C++", 3 | "build": { 4 | "dockerfile": "Dockerfile" 5 | }, 6 | "features": { 7 | "ghcr.io/devcontainers/features/dotnet:2": { 8 | "version": "9.0", 9 | "dotnetRuntimeVersions": "9.0", 10 | "aspNetCoreRuntimeVersions": "9.0" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /samples/cpp/dynamic-library/library/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Samples.Cpp.DynamicLibrary.Library' 2 | Language: 'C++|0' 3 | Version: 1.0.0 4 | Type: 'DynamicLibrary' 5 | Defines: [ 6 | 'EXPORT_LIBRARY' 7 | ] 8 | IncludePaths: [ 9 | 'public/' 10 | ] 11 | PublicHeaders: [ 12 | { 13 | Root: 'public/' 14 | Files: [ 15 | 'library.h' 16 | ] 17 | } 18 | ] -------------------------------------------------------------------------------- /code/generate-sharp/migrate/msbuild/project-reference-item.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Path = Opal.Path; 6 | 7 | namespace Soup.Build.Migrate; 8 | 9 | public class ProjectReferenceItem 10 | { 11 | public Path? Include { get; set; } 12 | } -------------------------------------------------------------------------------- /samples/c/windows-application/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // // Including SDKDDKVer.h defines the highest available Windows platform. 4 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 5 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 6 | #include 7 | -------------------------------------------------------------------------------- /samples/cpp/windows-application/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // // Including SDKDDKVer.h defines the highest available Windows platform. 4 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 5 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 6 | #include 7 | -------------------------------------------------------------------------------- /code/generate-sharp/migrate/msbuild/package-reference-item.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Soup.Build.Migrate; 6 | 7 | public class PackageReferenceItem 8 | { 9 | public string? Include { get; set; } 10 | 11 | public string? Version { get; set; } 12 | } -------------------------------------------------------------------------------- /code/generate-sharp/soup-native-interop/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Native.Interop' 2 | Language: 'C#|0' 3 | Version: 1.0.0 4 | TargetFramework: 'net9.0' 5 | AllowUnsafeBlocks: true 6 | Dependencies: { 7 | Build: [ 8 | 'Soup|CSharp.Nuget@0' 9 | ] 10 | Runtime: [ 11 | '../opal/' 12 | '../utilities/' 13 | ] 14 | RuntimeReference: [ 15 | '../../client/native/' 16 | ] 17 | } -------------------------------------------------------------------------------- /code/generate-sharp/utilities/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Utilities' 2 | Language: 'C#|0' 3 | Version: 1.0.0 4 | TargetFramework: 'net9.0' 5 | Dependencies: { 6 | Build: [ 7 | 'Soup|CSharp.Nuget@0' 8 | ] 9 | Runtime: [ 10 | '../opal/' 11 | ] 12 | } 13 | Nuget: { 14 | Dependencies: { 15 | Runtime: [ 16 | { Name: 'Antlr4.Runtime.Standard', Version: '4.13.1' } 17 | ] 18 | } 19 | } -------------------------------------------------------------------------------- /samples/cpp/directx/main.cpp: -------------------------------------------------------------------------------- 1 | #define WIN32_LEAN_AND_MEAN 2 | #include 3 | 4 | #include 5 | 6 | import Sample.DirectX; 7 | 8 | _Use_decl_annotations_ 9 | int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE, LPSTR, int nCmdShow) 10 | { 11 | D3D12HelloTriangle sample(1280, 720, L"D3D12 Hello Triangle"); 12 | return Win32Application::Run(&sample, hInstance, nCmdShow); 13 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/nuget/nuget-package-dependency.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Swhere.Core.Nuget; 6 | 7 | public class NugetPackageDependency 8 | { 9 | public string Id { get; set; } = string.Empty; 10 | 11 | public string Version { get; set; } = string.Empty; 12 | } -------------------------------------------------------------------------------- /docs/architecture/build-extension.md: -------------------------------------------------------------------------------- 1 | # Build Extension 2 | 3 | A [Wren](https://wren.io/) package that contains one or more implementations of the [Build Task](build-task.md) interface. When referenced as a **Build** Dependency within a [Recipe](recipe.md) the Generate runtime will automatically discover and instantiate one instance of each public class that implements the shared interface definition. The 4 | -------------------------------------------------------------------------------- /docs/architecture/build-operation.md: -------------------------------------------------------------------------------- 1 | # Build Operation 2 | 3 | The smallest unit of work that makes up the build graph produced during the generate phase. The operation contains the working folder, executable, command line arguments and declared input and output files. The input/output set are used to combine individual operations into a Directed Acyclic Graph (DAG) that is required for a well structured build. 4 | -------------------------------------------------------------------------------- /samples/cpp/directx/shaders.hlsl: -------------------------------------------------------------------------------- 1 | struct PSInput 2 | { 3 | float4 position : SV_POSITION; 4 | float4 color : COLOR; 5 | }; 6 | 7 | PSInput VSMain(float4 position : POSITION, float4 color : COLOR) 8 | { 9 | PSInput result; 10 | 11 | result.position = position; 12 | result.color = color; 13 | 14 | return result; 15 | } 16 | 17 | float4 PSMain(PSInput input) : SV_TARGET 18 | { 19 | return input.color; 20 | } -------------------------------------------------------------------------------- /scripts/linux/build-swhere: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Build SWhere!" 3 | 4 | # Stop on first error 5 | set -e 6 | 7 | FLAVOR="$1" 8 | SCRIPTS_DIR=$(dirname "$0") 9 | CODE_DIR=$SCRIPTS_DIR/../../code 10 | SWHERE_DIR=$CODE_DIR/generate-sharp/swhere 11 | 12 | # Build SWhere tool 13 | echo dotnet publish $SWHERE_DIR -c $FLAVOR -r linux-x64 --self-contained 14 | dotnet publish $SWHERE_DIR -c $FLAVOR -r linux-x64 --self-contained -------------------------------------------------------------------------------- /scripts/windows/sign-installer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET ScriptsDir=%~dp0 4 | SET RootDir=%ScriptsDir%..\.. 5 | SET OutDir=%RootDir%\out 6 | 7 | SET SOUP_VERSION=0.42.7 8 | 9 | SET SIGN_COMMAND=signtool sign /n "Open Source Developer, Matthew Asplund" /t http://time.certum.pl /fd sha1 /v 10 | 11 | SET SignFiles=%OutDir%\release\soup-build-%SOUP_VERSION%-windows-x64.msi 12 | 13 | %SIGN_COMMAND% %SignFiles% -------------------------------------------------------------------------------- /samples/c/console-application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | C: { 5 | 'Samples.C.ConsoleApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|C': { Version: 0.5.0 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /samples/c/windows-application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | C: { 5 | 'Samples.C.WindowsApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|C': { Version: 0.5.0 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /samples/cpp/dynamic-library/library/public/library.h: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #ifdef EXPORT_LIBRARY 3 | #define LIBRARY_API __declspec(dllexport) 4 | #else 5 | #define LIBRARY_API __declspec(dllimport) 6 | #endif 7 | #else 8 | #define LIBRARY_API 9 | #endif 10 | 11 | namespace Samples::Cpp::DynamicLibrary::Library 12 | { 13 | class Helper 14 | { 15 | public: 16 | LIBRARY_API static const char* GetName(); 17 | }; 18 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/nuget/nuget-package.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Swhere.Core.Nuget; 8 | 9 | public class NugetPackage 10 | { 11 | public string Id { get; set; } = string.Empty; 12 | 13 | public IList Versions { get; init; } = []; 14 | } 15 | -------------------------------------------------------------------------------- /code/client/cli/source/options/version-options.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "shared-options.h" 7 | 8 | namespace Soup::Client 9 | { 10 | /// 11 | /// Version Command 12 | /// 13 | // TODO: [Verb("version")] 14 | class VersionOptions : public SharedOptions 15 | { 16 | }; 17 | } 18 | -------------------------------------------------------------------------------- /code/monitor/client/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Monitor.Client' 2 | Description: 'The Detours dynamic library that is injected into a child process to intercept system calls.' 3 | Language: 'C++|0' 4 | Version: 1.0.0 5 | Type: 'DynamicLibrary' 6 | Defines: [ 7 | # 'ENABLE_MONITOR_DEBUG' 8 | # 'TRACE_DETOUR_CLIENT' 9 | ] 10 | Dependencies: { 11 | Runtime: [ 12 | 'mwasplund|Detours@4' 13 | '../shared/' 14 | 'mwasplund|Opal@0' 15 | ] 16 | } -------------------------------------------------------------------------------- /docs/architecture/shared-state-table.md: -------------------------------------------------------------------------------- 1 | # Shared State Table 2 | 3 | The output shared state from the Generate phase that will be passed along to all of the packages that directly reference the package. Used to communicate with downstream builds to tell them what input they are required to consume from the referenced package. Can be used to specify runtime dependencies that need to be copied over or build dependencies that need to be linked against. 4 | -------------------------------------------------------------------------------- /samples/csharp/console-application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C#': { 5 | 'Samples.CSharp.ConsoleApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|CSharp': { Version: 0.16.0 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /code/client/cli/tests/gen/commands/build-command-tests.gen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "commands/build-command-tests.h" 3 | 4 | TestState RunBuildCommandTests() 5 | { 6 | auto className = "BuildCommandTests"; 7 | auto testClass = std::make_shared(); 8 | TestState state = { 0, 0 }; 9 | state += Soup::Test::RunTest(className, "NameIsCorrect", [&testClass]() { testClass->NameIsCorrect(); }); 10 | 11 | return state; 12 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/nuget/nuget-package-version.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Swhere.Core.Nuget; 8 | 9 | public class NugetPackageVersion 10 | { 11 | public string Version { get; set; } = string.Empty; 12 | 13 | public IList TargetFrameworks { get; init; } = []; 14 | } -------------------------------------------------------------------------------- /samples/c/windows-application/framework.h: -------------------------------------------------------------------------------- 1 | // framework.h : include file for standard system include files, 2 | // or project specific include files 3 | // 4 | 5 | #pragma once 6 | 7 | #include "targetver.h" 8 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 9 | // Windows Header Files 10 | #include 11 | // C RunTime Header Files 12 | #include 13 | #include 14 | #include 15 | #include -------------------------------------------------------------------------------- /samples/cpp/directx/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.DirectX': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|Cpp': { Version: 0.16.1 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | 'mwasplund|parse.modules': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /samples/cpp/static-library/library/library.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | // Include all standard library headers in the global module 4 | #include 5 | 6 | export module Samples.Cpp.StaticLibrary.Library; 7 | 8 | // Note: The namespace does not have to match the module name 9 | export namespace Samples::Cpp::StaticLibrary::Library 10 | { 11 | class Helper 12 | { 13 | public: 14 | static std::string GetName() 15 | { 16 | return "Soup"; 17 | } 18 | }; 19 | } -------------------------------------------------------------------------------- /scripts/windows/build-swhere.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | SET RootDir=%ScriptsDir%..\.. 6 | SET CodeDir=%RootDir%\code 7 | SET SWhereDir=%CodeDir%\generate-sharp\swhere 8 | 9 | REM - Build SWhere tool 10 | echo dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained 11 | call dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained 12 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% 13 | -------------------------------------------------------------------------------- /scripts/windows/generate-sml-lexer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | SET RootDir=%ScriptsDir%..\..\ 6 | SET ClientCoreDir=code\client\core\source 7 | SET REFLEX=%UserProfile%\source\repos\RE-flex\bin\win64\reflex.exe 8 | 9 | pushd %RootDir% 10 | echo %REFLEX% %ClientCoreDir%\sml\sml-parser.l -o %ClientCoreDir%\sml\sml-parser.cpp 11 | call %REFLEX% %ClientCoreDir%\sml\sml-parser.l -o %ClientCoreDir%\sml\sml-parser.cpp 12 | popd -------------------------------------------------------------------------------- /code/client/cli/source/commands/i-command.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | 7 | namespace Soup::Client 8 | { 9 | /// 10 | /// Command Interface 11 | /// 12 | class ICommand 13 | { 14 | public: 15 | /// 16 | /// Main entry point for a unique command 17 | /// 18 | virtual void Run() = 0; 19 | }; 20 | } 21 | -------------------------------------------------------------------------------- /code/client/cli/tests/gen/commands/install-command-tests.gen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "commands/install-command-tests.h" 3 | 4 | TestState RunInstallCommandTests() 5 | { 6 | auto className = "InstallCommandTests"; 7 | auto testClass = std::make_shared(); 8 | TestState state = { 0, 0 }; 9 | state += Soup::Test::RunTest(className, "Initialize", [&testClass]() { testClass->Initialize(); }); 10 | 11 | return state; 12 | } -------------------------------------------------------------------------------- /code/client/cli/tests/gen/commands/publish-command-tests.gen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "commands/publish-command-tests.h" 3 | 4 | TestState RunPublishCommandTests() 5 | { 6 | auto className = "PublishCommandTests"; 7 | auto testClass = std::make_shared(); 8 | TestState state = { 0, 0 }; 9 | state += Soup::Test::RunTest(className, "Initialize", [&testClass]() { testClass->Initialize(); }); 10 | 11 | return state; 12 | } -------------------------------------------------------------------------------- /code/client/cli/tests/gen/commands/version-command-tests.gen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "commands/version-command-tests.h" 3 | 4 | TestState RunVersionCommandTests() 5 | { 6 | auto className = "VersionCommandTests"; 7 | auto testClass = std::make_shared(); 8 | TestState state = { 0, 0 }; 9 | state += Soup::Test::RunTest(className, "Initialize", [&testClass]() { testClass->Initialize(); }); 10 | 11 | return state; 12 | } -------------------------------------------------------------------------------- /samples/cpp/windows-application/framework.h: -------------------------------------------------------------------------------- 1 | // framework.h : include file for standard system include files, 2 | // or project specific include files 3 | // 4 | 5 | #pragma once 6 | 7 | #include "targetver.h" 8 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 9 | // Windows Header Files 10 | #include 11 | // C RunTime Header Files 12 | #include 13 | #include 14 | #include 15 | #include -------------------------------------------------------------------------------- /code/generate-sharp/utilities/soup.utilities.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | 5 | 6 | 1701;1702;3021 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /code/generate-sharp/utilities/collection-extensions.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Soup; 8 | 9 | public static class CollectionExtensions 10 | { 11 | public static void AddRange(this IList list, IEnumerable range) 12 | { 13 | foreach (var value in range) 14 | { 15 | list.Add(value); 16 | } 17 | } 18 | } -------------------------------------------------------------------------------- /docs/cli/init.md: -------------------------------------------------------------------------------- 1 | 2 | # Init 3 | ## Overview 4 | Initialize a new console application project in the current active directory. 5 | ``` 6 | soup init 7 | ``` 8 | `path` - An optional parameter that directly follows the initialize command. If present this specifies the directory to create a Recipe file. If not present then the command will use the current active directory. 9 | 10 | ## Examples 11 | The one and only way to use this command. 12 | ``` 13 | soup init 14 | ``` 15 | -------------------------------------------------------------------------------- /samples/cpp/module-interface/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.ModuleInterface': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|Cpp': { Version: 0.16.1 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | 'mwasplund|parse.modules': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /samples/cpp/console-application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.ConsoleApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|Cpp': { Version: 0.16.1 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | 'mwasplund|parse.modules': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /samples/cpp/windows-application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.WindowsApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|Cpp': { Version: 0.16.1 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | 'mwasplund|parse.modules': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /scripts/windows/generate-module-parser-lexer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | SET RootDir=%ScriptsDir%..\..\ 6 | SET ParseModuleDir=code\tools\parse-modules 7 | SET REFLEX=S:\repos\RE-flex\bin\win64\reflex.exe 8 | 9 | pushd %RootDir% 10 | echo %REFLEX% %ParseModuleDir%\parser\module-parser.l -o %ParseModuleDir%\parser\module-parser.cpp 11 | call %REFLEX% %ParseModuleDir%\parser\module-parser.l -o %ParseModuleDir%\parser\module-parser.cpp 12 | popd -------------------------------------------------------------------------------- /code/client/cli/tests/gen/commands/initialize-command-tests.gen.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "commands/initialize-command-tests.h" 3 | 4 | TestState RunInitializeCommandTests() 5 | { 6 | auto className = "InitializeCommandTests"; 7 | auto testClass = std::make_shared(); 8 | TestState state = { 0, 0 }; 9 | state += Soup::Test::RunTest(className, "NameIsCorrect", [&testClass]() { testClass->NameIsCorrect(); }); 10 | 11 | return state; 12 | } -------------------------------------------------------------------------------- /samples/cpp/build-extension/tool/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.SimpleBuildExtension.Tool': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Soup|Cpp': { Version: 0.16.1 } 11 | } 12 | } 13 | Tool0: { 14 | 'C++': { 15 | 'mwasplund|copy': { Version: 1.2.0 } 16 | 'mwasplund|mkdir': { Version: 1.2.0 } 17 | 'mwasplund|parse.modules': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /scripts/linux/build-packagemanager: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Build PackageManager!" 3 | 4 | # Stop on first error 5 | set -e 6 | 7 | FLAVOR="$1" 8 | SCRIPTS_DIR=$(dirname "$0") 9 | CODE_DIR=$SCRIPTS_DIR/../../code 10 | PACKAGE_MANAGER_DIR=$CODE_DIR/generate-sharp/package-manager 11 | 12 | # Build PackageManager 13 | echo dotnet publish $PACKAGE_MANAGER_DIR -c $FLAVOR -f net9.0 -r linux-x64 --self-contained 14 | dotnet publish $PACKAGE_MANAGER_DIR -c $FLAVOR -f net9.0 -r linux-x64 --self-contained -------------------------------------------------------------------------------- /scripts/linux/generate-sml-lexer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Generate SML Lexer!" 3 | 4 | # Stop on first error 5 | set -e 6 | 7 | FLAVOR="$1" 8 | SCRIPTS_DIR=$(dirname "$0") 9 | ROOT_DIR=$SCRIPTS_DIR/../.. 10 | CODE_DIR=$ROOT_DIR/code 11 | CLIENT_CODE_DIR=$CODE_DIR/client/core/source 12 | REFLEX=~/dev/repos/RE-flex/bin/reflex 13 | 14 | echo $REFLEX $CLIENT_CODE_DIR/sml/sml-parser.l -o $CLIENT_CODE_DIR/sml/sml-parser.cpp 15 | $REFLEX $CLIENT_CODE_DIR/sml/sml-parser.l -o $CLIENT_CODE_DIR/sml/sml-parser.cpp -------------------------------------------------------------------------------- /code/generate-sharp/migrate/migrate.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net9.0 5 | true 6 | true 7 | false 8 | true 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /scripts/windows/build-packagemanager.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | SET RootDir=%ScriptsDir%..\.. 6 | SET CodeDir=%RootDir%\code 7 | SET PackageManagerDir=%CodeDir%\generate-sharp\package-manager 8 | 9 | REM - Build PackageManager 10 | echo dotnet publish %PackageManagerDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained 11 | call dotnet publish %PackageManagerDir% -c %Flavor% -f net9.0 -r win-x64 --self-contained 12 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% 13 | -------------------------------------------------------------------------------- /samples/c/build-extension/executable/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | C: { 5 | 'Samples.C.SimpleBuildExtension.Executable': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Samples.C.BuildExtension.Extension': { Version: '../extension/' } 11 | 'Soup|C': { Version: 0.5.0 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/io/i-console-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Opal.IO; 6 | 7 | /// 8 | /// The input manager interface 9 | /// Interface mainly used to allow for unit testing client code. 10 | /// 11 | public interface IConsoleManager 12 | { 13 | /// 14 | /// Get the standard input stream. 15 | /// 16 | IConsoleInput GetStandardInput(); 17 | } 18 | -------------------------------------------------------------------------------- /code/tools/copy/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | copy: { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'mwasplund|copy': { Version: './', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Cpp': { Version: 0.16.1 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | 'mwasplund|parse.modules': { Version: 1.2.0 } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /samples/c/build-extension/extension/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | Wren: { 5 | 'Samples.C.BuildExtension.Extension': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Soup|Build.Utils': { Version: 0.9.1, Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Wren': { Version: 0.5.4 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /samples/csharp/build-extension/executable/program.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Samples.CSharp.BuildExtension.Executable 6 | { 7 | using System; 8 | 9 | public class Program 10 | { 11 | public static void Main(string[] args) 12 | { 13 | #if SPECIAL_BUILD 14 | Console.WriteLine("Hello World, Soup Style!"); 15 | #else 16 | Console.WriteLine("Hello World..."); 17 | #endif 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /samples/cpp/build-extension/extension/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | Wren: { 5 | 'Samples.Cpp.BuildExtension.Extension': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Soup|Build.Utils': { Version: 0.9.1, Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Wren': { Version: 0.5.4 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /samples/csharp/build-extension/extension/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | Wren: { 5 | 'Samples.CSharp.BuildExtension.Extension': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Soup|Build.Utils': { Version: 0.9.1, Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Wren': { Version: 0.5.4 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.PackageManager' 2 | Language: 'C#|0' 3 | Version: 1.0.0 4 | Type: 'Executable' 5 | Dependencies: { 6 | Build: [ 7 | 'Soup|CSharp.Nuget@0' 8 | ] 9 | Runtime: [ 10 | '../package-manager.core/' 11 | '../utilities/' 12 | '../opal/' 13 | ] 14 | } 15 | 16 | Nuget: { 17 | Dependencies: { 18 | 'Runtime': [ 19 | { Name: 'Microsoft.Identity.Client', Version: '4.48.1' } 20 | { Name: 'System.Security.Cryptography.ProtectedData', Version: '6.0.0' } 21 | ] 22 | } 23 | } -------------------------------------------------------------------------------- /docs/architecture/package-reference.md: -------------------------------------------------------------------------------- 1 | # Package Reference 2 | 3 | A **Package Reference** is a special format string that can either be a directory Path reference or a unique package Name and Version separated by an '@' character. 4 | 5 | > Note: Path references are not allowed in published packages. 6 | 7 | > Note2: While absolute paths are allowed, they are strongly discouraged as they do not lend themselves to sharing code with others. 8 | 9 | ``` 10 | "../../other-package/" 11 | ``` 12 | 13 | ``` 14 | "OtherPackage@1.2.3" 15 | ``` -------------------------------------------------------------------------------- /docs/cli/view.md: -------------------------------------------------------------------------------- 1 | # View 2 | ## Overview 3 | Launch the Soup View utility GUI for visualizing the build dependency, tasks and operation graphs. 4 | ``` 5 | soup view 6 | ``` 7 | 8 | `path` - An optional parameter that directly follows the build command. If present this specifies the directory to look for a Recipe file to build. If not present then the command will use the current active directory. 9 | 10 | ## Examples 11 | Launch the tool in the current directory for debug with default configurations. 12 | ``` 13 | soup view 14 | ``` -------------------------------------------------------------------------------- /samples/c/dynamic-library/application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | C: { 5 | 'Samples.C.DynamicLibrary.Application': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Samples.C.DynamicLibrary.Library': { Version: '../library/', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|C': { Version: 0.5.0 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /samples/c/static-library/application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | C: { 5 | 'Samples.C.StaticLibrary.Application': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Samples.C.StaticLibrary.Library': { Version: '../library/', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|C': { Version: 0.5.0 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/nuget/nuget-package-target-framework.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Swhere.Core.Nuget; 8 | 9 | public class NugetPackageTargetFramework 10 | { 11 | public string Name { get; set; } = string.Empty; 12 | 13 | public IList Dependencies { get; init; } = []; 14 | 15 | public IList Libraries { get; init; } = []; 16 | } -------------------------------------------------------------------------------- /samples/cpp/module-dynamic-library/library/library.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | // Include all standard library headers in the global module 4 | #include 5 | 6 | export module Samples.Cpp.ModuleDynamicLibrary.Library; 7 | 8 | // Note: The namespace does not have to match the module name 9 | export namespace Samples::Cpp::DynamicLibrary::Library 10 | { 11 | class Helper 12 | { 13 | public: 14 | #ifdef _WIN32 15 | __declspec(dllexport) 16 | #endif 17 | static std::string GetName() 18 | { 19 | return "Soup"; 20 | } 21 | }; 22 | } -------------------------------------------------------------------------------- /samples/csharp/build-extension/executable/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C#': { 5 | 'Samples.CSharp.BuildExtension.Executable': { Version: '../Executable', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Samples.CSharp.BuildExtension.Extension': { Version: '../extension/' } 11 | 'Soup|CSharp': { Version: 0.16.0 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/izip-archive.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | using Path = Opal.Path; 7 | 8 | namespace Soup.Build.PackageManager; 9 | 10 | /// 11 | /// The zip archive interface 12 | /// Interface mainly used to allow for unit testing client code. 13 | /// 14 | public interface IZipArchive : IDisposable 15 | { 16 | void CreateEntryFromFile(Path sourceFileName, string entryName); 17 | } 18 | -------------------------------------------------------------------------------- /code/installer/soup-installer/soup-installer.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net8.0-windows 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /samples/cpp/parse-json/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.ParseJson': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'mwasplund|json11': { Version: 1.1.5, Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Cpp': { Version: 0.16.1 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | 'mwasplund|parse.modules': { Version: 1.2.0 } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /samples/csharp/library/application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C#': { 5 | 'Samples.CSharp.Library.ConsoleApplication': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Samples.CSharp.Library.Library': { Version: '../library/', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|CSharp': { Version: 0.16.0 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | } 19 | } 20 | } -------------------------------------------------------------------------------- /scripts/linux/generate-module-parser-lexer: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Generate Module Parser Lexer!" 3 | 4 | # Stop on first error 5 | set -e 6 | 7 | FLAVOR="$1" 8 | SCRIPTS_DIR=$(dirname "$0") 9 | ROOT_DIR=$SCRIPTS_DIR/../.. 10 | CODE_DIR=$ROOT_DIR/code 11 | PARSE_MODULES_DIR=$CODE_DIR/parse-modules 12 | REFLEX=~/dev/repos/RE-flex/bin/reflex 13 | 14 | echo $REFLEX $PARSE_MODULES_DIR/parser/module-parser.l -o $PARSE_MODULES_DIR/parser/module-parser.cpp 15 | $REFLEX $PARSE_MODULES_DIR/parser/module-parser.l -o $PARSE_MODULES_DIR/parser/module-parser.cpp -------------------------------------------------------------------------------- /scripts/windows/generate-languagereference-lexer.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | SET RootDir=%ScriptsDir%..\..\ 6 | SET ClientCoreDir=code\client\core\source 7 | SET REFLEX=%UserProfile%\source\repos\RE-flex\bin\win64\reflex.exe 8 | 9 | pushd %RootDir% 10 | echo %REFLEX% %ClientCoreDir%\recipe\language-reference-parser.l -o %ClientCoreDir%\recipe\language-reference-parser.cpp 11 | call %REFLEX% %ClientCoreDir%\recipe\language-reference-parser.l -o %ClientCoreDir%\recipe\language-reference-parser.cpp 12 | popd -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/i-input-file.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | using System.IO; 7 | 8 | namespace Opal.System; 9 | 10 | /// 11 | /// The input file interface 12 | /// Interface mainly used to allow for unit testing client code. 13 | /// 14 | public interface IInputFile : IDisposable 15 | { 16 | /// 17 | /// Gets the input stream. 18 | /// 19 | Stream GetInStream(); 20 | } 21 | -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/i-output-file.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | using System.IO; 7 | 8 | namespace Opal.System; 9 | 10 | /// 11 | /// The output file interface 12 | /// Interface mainly used to allow for unit testing client code. 13 | /// 14 | public interface IOutputFile : IDisposable 15 | { 16 | /// 17 | /// Gets the output stream. 18 | /// 19 | Stream GetOutStream(); 20 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/i-library-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Opal.System; 6 | 7 | /// 8 | /// The library manager interface 9 | /// Interface mainly used to allow for unit testing client code. 10 | /// 11 | public interface ILibraryManager 12 | { 13 | /// 14 | /// Loads a library with the provided path. 15 | /// 16 | abstract ILibrary LoadDynamicLibrary(Path library); 17 | } 18 | -------------------------------------------------------------------------------- /code/client/cli/tests/commands/build-command-tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "build-command.h" 7 | 8 | namespace Soup::Client::UnitTests 9 | { 10 | /// 11 | /// Build Command Tests 12 | /// 13 | class BuildCommandTests 14 | { 15 | public: 16 | // [[Fact]] 17 | void NameIsCorrect() 18 | { 19 | auto options = BuildOptions(); 20 | auto uut = BuildCommand(options); 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /code/generate-sharp/package-manager.unittests/ihttp-message-handler.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | using System.Net.Http; 7 | 8 | namespace Soup.Build.PackageManager.UnitTests; 9 | 10 | public interface IHttpMessageHandler 11 | { 12 | HttpResponseMessage Send(HttpMethod method, Uri requestUri, string headers, string? content); 13 | HttpResponseMessage SendAsync(HttpMethod method, Uri? requestUri, string headers, string? content); 14 | } -------------------------------------------------------------------------------- /code/client/cli/tests/commands/install-command-tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "install-command.h" 7 | 8 | namespace Soup::Client::UnitTests 9 | { 10 | /// 11 | /// Install Command Tests 12 | /// 13 | class InstallCommandTests 14 | { 15 | public: 16 | // [[Fact]] 17 | void Initialize() 18 | { 19 | auto options = InstallOptions(); 20 | auto uut = InstallCommand(options); 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /code/client/cli/tests/commands/publish-command-tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "publish-command.h" 7 | 8 | namespace Soup::Client::UnitTests 9 | { 10 | /// 11 | /// Publish Command Tests 12 | /// 13 | class PublishCommandTests 14 | { 15 | public: 16 | // [[Fact]] 17 | void Initialize() 18 | { 19 | auto options = PublishOptions(); 20 | auto uut = PublishCommand(options); 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /code/client/cli/tests/commands/version-command-tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "version-command.h" 7 | 8 | namespace Soup::Client::UnitTests 9 | { 10 | /// 11 | /// Version Command Tests 12 | /// 13 | class VersionCommandTests 14 | { 15 | public: 16 | // [[Fact]] 17 | void Initialize() 18 | { 19 | auto options = VersionOptions(); 20 | auto uut = VersionCommand(options); 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /docs/samples/csharp.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | The set of C# samples. 3 | 4 | ## [Build Extension](csharp/build-extension.md) 5 | This is a console application that uses a custom build extension to set a preprocessor definition to show how a user can easily author their own custom build logic that can be shared with others. 6 | 7 | ## [Console Application](csharp/console-application.md) 8 | This is the smallest amount of code to get a console application building using Soup. 9 | 10 | ## [Library](csharp/library.md) 11 | Sample project that shows creating a consuming a dynamic library. -------------------------------------------------------------------------------- /scripts/windows/build-view.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | SET RootDir=%ScriptsDir%..\.. 6 | SET CodeDir=%RootDir%\code 7 | SET SWhereDir=%CodeDir%\generate-sharp\soup-view 8 | 9 | REM - Cleanup old publish to work around bug in publish 10 | rmdir /S /Q %RootDir%\out\msbuild\bin\soup-view\%Flavor%\net9.0\win-x64\publish\ 11 | 12 | REM - Publish SWhere tool 13 | echo dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 14 | dotnet publish %SWhereDir% -c %Flavor% -f net9.0 -r win-x64 15 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/izip-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Path = Opal.Path; 6 | 7 | namespace Soup.Build.PackageManager; 8 | 9 | /// 10 | /// The zip manager interface 11 | /// Interface mainly used to allow for unit testing client code. 12 | /// 13 | public interface IZipManager 14 | { 15 | void ExtractToDirectory(Path sourceArchiveFileName, Path destinationDirectoryName); 16 | 17 | IZipArchive OpenCreate(Path archivePath); 18 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/build/package-provider-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunPackageProviderTests; 6 | 7 | import :PackageProviderTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunPackageProviderTests() 11 | { 12 | auto className = "PackageProviderTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "Initialize", [&testClass]() { testClass->Initialize(); }); 16 | 17 | return state; 18 | } -------------------------------------------------------------------------------- /scripts/linux/build-view: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Build SoupView!" 3 | 4 | # Stop on first error 5 | set -e 6 | 7 | FLAVOR="$1" 8 | SCRIPTS_DIR=$(dirname "$0") 9 | ROOT_DIR=$SCRIPTS_DIR/../.. 10 | CODE_DIR=$ROOT_DIR/code 11 | SWHERE_DIR=$CODE_DIR/generate-sharp/soup-view 12 | 13 | # Cleanup old publish to work around bug in publish 14 | rm -r -f $ROOT_DIR/out/msbuild/bin/soup-view/$FLAVOR/net9.0/linux-x64/publish/ 15 | 16 | # Build SWhere tool 17 | echo dotnet publish $SWHERE_DIR -c $FLAVOR -r linux-x64 --self-contained 18 | dotnet publish $SWHERE_DIR -c $FLAVOR -r linux-x64 --self-contained -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "type": "shell", 6 | "label": "Build", 7 | "args": [], 8 | "options": { 9 | "cwd": "${workspaceFolder}" 10 | }, 11 | "windows": { 12 | "command": "scripts/windows/build Debug" 13 | }, 14 | "linux": { 15 | "command": "scripts/linux/build Debug" 16 | }, 17 | "problemMatcher": [], 18 | "group": { 19 | "kind": "build", 20 | "isDefault": true 21 | }, 22 | "detail": "Run the build script." 23 | } 24 | ] 25 | } -------------------------------------------------------------------------------- /code/client/cli/tests/commands/initialize-command-tests.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "initialize-command.h" 7 | 8 | namespace Soup::Client::UnitTests 9 | { 10 | /// 11 | /// Initialize Command Tests 12 | /// 13 | class InitializeCommandTests 14 | { 15 | public: 16 | // [[Fact]] 17 | void NameIsCorrect() 18 | { 19 | auto options = InitializeOptions(); 20 | auto uut = InitializeCommand(options); 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /code/tools/mkdir/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | mkdir: { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'mwasplund|mkdir': { Version: './', Build: 'Build0', Tool: 'Tool0' } 7 | 'mwasplund|Opal': { Version: 0.12.4, Build: 'Build0', Tool: 'Tool0' } 8 | } 9 | } 10 | Build0: { 11 | Wren: { 12 | 'Soup|Cpp': { Version: 0.16.1 } 13 | } 14 | } 15 | Tool0: { 16 | 'C++': { 17 | 'mwasplund|copy': { Version: 1.2.0 } 18 | 'mwasplund|mkdir': { Version: 1.2.0 } 19 | 'mwasplund|parse.modules': { Version: 1.2.0 } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere/swhere.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net9.0 5 | true 6 | true 7 | false 8 | true 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/cpp/header-library/application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.HeaderLibrary.Application': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Samples.Cpp.HeaderLibrary.Library': { Version: '../library/', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Cpp': { Version: 0.16.1 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | 'mwasplund|parse.modules': { Version: 1.2.0 } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /samples/cpp/static-library/application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.StaticLibrary.Application': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Samples.Cpp.StaticLibrary.Library': { Version: '../library/', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Cpp': { Version: 0.16.1 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | 'mwasplund|parse.modules': { Version: 1.2.0 } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/view-models/graph-node-view-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using GraphShape; 6 | using System.Collections.Generic; 7 | 8 | namespace Soup.View.ViewModels; 9 | 10 | public class GraphNodeViewModel 11 | { 12 | public required string Title { get; set; } 13 | public required string ToolTip { get; set; } 14 | public required uint Id { get; set; } 15 | public IList ChildNodes { get; init; } = []; 16 | 17 | public required Point Position { get; set; } 18 | } -------------------------------------------------------------------------------- /samples/cpp/dynamic-library/application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.DynamicLibrary.Application': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Samples.Cpp.DynamicLibrary.Library': { Version: '../library/', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Cpp': { Version: 0.16.1 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | 'mwasplund|parse.modules': { Version: 1.2.0 } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /scripts/windows/generate-sml-antlr.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | SET RootDir=%ScriptsDir%..\.. 6 | SET CodeDir=%RootDir%\code 7 | SET GrammarDir=%CodeDir%\grammar 8 | SET CSharpDir=%CodeDir%\generate-sharp\utilities\sml\grammar 9 | SET JAVA="C:\Program Files\Microsoft\jdk-11.0.23.9-hotspot\bin\java.exe" 10 | SET ANLTR=%JAVA% -jar %UserProfile%\Desktop\antlr-4.11.1-complete.jar 11 | 12 | pushd %GrammarDir% 13 | echo %ANLTR% -Dlanguage=CSharp SML.g4 -o %CSharpDir% -no-listener -visitor 14 | call %ANLTR% -Dlanguage=CSharp SML.g4 -o %CSharpDir% -no-listener -visitor 15 | popd -------------------------------------------------------------------------------- /code/monitor/shared/linux/detour-event-type.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Monitor::Linux 4 | { 5 | export enum class DetourEventType : uint32_t 6 | { 7 | // FileApi 8 | open, 9 | creat, 10 | openat, 11 | link, 12 | linkat, 13 | rename, 14 | unlink, 15 | remove, 16 | fopen, 17 | fdopen, 18 | freopen, 19 | mkdir, 20 | rmdir, 21 | 22 | // ProcessApi 23 | system, 24 | fork, 25 | vfork, 26 | clone, 27 | __clone2, 28 | clone3, 29 | execl, 30 | execlp, 31 | execle, 32 | execv, 33 | execvp, 34 | execvpe, 35 | execve, 36 | execveat, 37 | fexecve, 38 | }; 39 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/io/i-console-input.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Opal.IO; 6 | 7 | /// 8 | /// The console input stream interface 9 | /// Interface mainly used to allow for unit testing client code. 10 | /// 11 | public interface IConsoleInput 12 | { 13 | /// 14 | /// Read a line from the stream. 15 | /// 16 | string ReadLine(); 17 | 18 | /// 19 | /// Read a password from the stream. 20 | /// 21 | string ReadPassword(); 22 | } 23 | -------------------------------------------------------------------------------- /samples/cpp/module-dynamic-library/application/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.Cpp.ModuleDynamicLibrary.Application': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Samples.Cpp.ModuleDynamicLibrary.Library': { Version: '../library/', Build: 'Build0', Tool: 'Tool0' } 7 | } 8 | } 9 | Build0: { 10 | Wren: { 11 | 'Soup|Cpp': { Version: 0.16.1 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'mwasplund|copy': { Version: 1.2.0 } 17 | 'mwasplund|mkdir': { Version: 1.2.0 } 18 | 'mwasplund|parse.modules': { Version: 1.2.0 } 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /code/client/cli/source/options/view-options.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "shared-options.h" 7 | 8 | namespace Soup::Client 9 | { 10 | /// 11 | /// View Command 12 | /// 13 | // TODO: [Verb("view")] 14 | class ViewOptions : public SharedOptions 15 | { 16 | public: 17 | /// 18 | /// Gets or sets the path to run 19 | /// 20 | // [[Args::Option("path", Index = 0, HelpText = "Path to the package to run.")]] 21 | std::string Path; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/i-system.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Runtime.Versioning; 6 | 7 | namespace Opal.System; 8 | 9 | /// 10 | /// The system access interface 11 | /// Interface mainly used to allow for unit testing client code. 12 | /// 13 | public interface ISystem 14 | { 15 | /// 16 | /// Gets the registry value 17 | /// 18 | [SupportedOSPlatform("windows")] 19 | object? GetRegistryValue(string keyName, string? valueName, object? defaultValue); 20 | } 21 | -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/i-authentication-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Threading.Tasks; 6 | 7 | namespace Soup.Build.PackageManager; 8 | 9 | /// 10 | /// The authentication manager interface 11 | /// Interface mainly used to allow for unit testing client code. 12 | /// 13 | public interface IAuthenticationManager 14 | { 15 | /// 16 | /// Get the authentication token for the user 17 | /// 18 | Task EnsureSignInAsync(); 19 | } 20 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-native-interop/load-build-graph-result-context.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Text.Json.Serialization; 6 | 7 | namespace Soup.Native; 8 | 9 | [JsonSourceGenerationOptions( 10 | WriteIndented = false, 11 | PropertyNamingPolicy = JsonKnownNamingPolicy.Unspecified, 12 | GenerationMode = JsonSourceGenerationMode.Metadata)] 13 | [JsonSerializable(typeof(LoadBuildGraphResult))] 14 | internal sealed partial class LoadBuildGraphResultContext : JsonSerializerContext 15 | { 16 | } -------------------------------------------------------------------------------- /code/monitor/host/isystem-access-monitor.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Monitor 4 | { 5 | export class ISystemAccessMonitor 6 | { 7 | public: 8 | virtual void OnCreateProcess(std::string_view applicationName, bool wasDetoured) = 0; 9 | virtual void TouchFileRead(Path filePath, bool exists, bool wasBlocked) = 0; 10 | virtual void TouchFileWrite(Path filePath, bool wasBlocked) = 0; 11 | virtual void TouchFileDelete(Path filePath, bool wasBlocked) = 0; 12 | virtual void TouchFileDeleteOnClose(Path filePath) = 0; 13 | virtual void SearchPath(std::string_view path, std::string_view filename) = 0; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /scripts/windows/release.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET ScriptsDir=%~dp0 4 | SET RootDir=%ScriptsDir%../.. 5 | SET OutDir=%RootDir%/out 6 | SET ReleaseDir=%OutDir%/release 7 | SET RunDir=%OutDir%/run 8 | SET CodeDir=%RootDir%/code 9 | SET InstallerDir=%CodeDir%/installer/soup-installer 10 | 11 | SET SOUP_VERSION=0.42.7 12 | 13 | REM - Build MSI Installer 14 | echo msbuild %InstallerDir% -p:Configuration=Release 15 | msbuild %InstallerDir% -p:Configuration=Release 16 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% 17 | 18 | REM - Generate zip release 19 | tar -a -cf %ReleaseDir%/soup-build-%SOUP_VERSION%-windows-x64.zip -C %RunDir% * -------------------------------------------------------------------------------- /code/client/cli/source/options/shared-options.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | 7 | namespace Soup::Client 8 | { 9 | /// 10 | /// Shared Options for all Commands 11 | /// 12 | class SharedOptions 13 | { 14 | public: 15 | virtual ~SharedOptions() 16 | { 17 | } 18 | 19 | /// 20 | /// Gets or sets the package name 21 | /// 22 | // TODO: [Option('v', "verbose", Default = false, HelpText = "Enable verbose logging.")] 23 | TraceEventFlag Verbosity; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /docs/cli/publish.md: -------------------------------------------------------------------------------- 1 | # Publish 2 | ## Overview 3 | Pack the current recipe folder and publish its contents to the official feed. 4 | ``` 5 | soup publish 6 | ``` 7 | 8 | `path` - An optional parameter that directly follows the publish command. If present this specifies the directory to look for a Recipe file to load. If not present then the command will use the current active directory. 9 | 10 | ## Examples 11 | Publish the latest version of the package in the current folder. 12 | ``` 13 | soup publish 14 | ``` 15 | 16 | Publish the latest version in the MyProject Recipe file. 17 | ``` 18 | soup publish ./Code/MyProject/ 19 | ``` -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/view-models/property-value-view-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.ObjectModel; 6 | 7 | namespace Soup.View.ViewModels; 8 | 9 | public class PropertyValueViewModel 10 | { 11 | public PropertyValueViewModel(string name, string? value) 12 | { 13 | this.Name = name; 14 | this.Value = value; 15 | } 16 | 17 | public string Name { get; set; } 18 | public string? Value { get; set; } 19 | 20 | public ObservableCollection? Children { get; init; } 21 | } -------------------------------------------------------------------------------- /code/monitor/client/windows/functions/cache/process-env.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Monitor::Windows::Functions::Cache::ProcessEnv 4 | { 5 | /// 6 | /// Searches for a specified file in a specified path. 7 | /// 8 | DWORD (WINAPI* SearchPathA)( 9 | LPCSTR lpPath, 10 | LPCSTR lpFileName, 11 | LPCSTR lpExtension, 12 | DWORD nBufferLength, 13 | LPSTR lpBuffer, 14 | LPSTR *lpFilePart) = ::SearchPathA; 15 | DWORD (WINAPI* SearchPathW)( 16 | LPCWSTR lpPath, 17 | LPCWSTR lpFileName, 18 | LPCWSTR lpExtension, 19 | DWORD nBufferLength, 20 | LPWSTR lpBuffer, 21 | LPWSTR *lpFilePart) = ::SearchPathW; 22 | } -------------------------------------------------------------------------------- /samples/cpp/build-extension/executable/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Samples.SimpleBuildExtension.Executable': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | } 7 | } 8 | Build0: { 9 | Wren: { 10 | 'Samples.Cpp.BuildExtension.Extension': { Version: '../extension/' } 11 | 'Soup|Cpp': { Version: 0.16.1 } 12 | } 13 | } 14 | Tool0: { 15 | 'C++': { 16 | 'Samples.SimpleBuildExtension.Tool': { Version: '../tool/' } 17 | 'mwasplund|copy': { Version: 1.2.0 } 18 | 'mwasplund|mkdir': { Version: 1.2.0 } 19 | 'mwasplund|parse.modules': { Version: 1.2.0 } 20 | } 21 | } 22 | } -------------------------------------------------------------------------------- /code/client/cli/source/options/publish-options.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "shared-options.h" 7 | 8 | namespace Soup::Client 9 | { 10 | /// 11 | /// Publish Command Options 12 | /// 13 | // TODO: [Verb("publish")] 14 | class PublishOptions : public SharedOptions 15 | { 16 | public: 17 | /// 18 | /// Gets or sets the path to publish 19 | /// 20 | // [[Args::Option("path", Index = 0, HelpText = "Path to the package to publish.")]] 21 | std::string Path; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /docs/cli/restore.md: -------------------------------------------------------------------------------- 1 | # Restore 2 | ## Overview 3 | Restore packages from the public feed using an existing package lock or generates a new lock if none exists. 4 | ``` 5 | soup restore 6 | ``` 7 | 8 | `path` - An optional parameter that directly follows the restore command. If present this specifies the directory to look for a Recipe file to load. If not present then the command will use the current active directory. 9 | 10 | ## Examples 11 | Install all of the current defined external dependency packages. 12 | ``` 13 | soup restore 14 | ``` 15 | 16 | Install all packages in the MyProject Recipe file. 17 | ``` 18 | soup restore ./Code/MyProject/ 19 | ``` -------------------------------------------------------------------------------- /code/client/core/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup.Core' 2 | Language: 'C++|0' 3 | Version: 0.1.1 4 | Defines: [ 5 | # 'TRACE_SYSTEM_ACCESS' 6 | # 'TRACE_FILE_SYSTEM_STATE' 7 | ] 8 | IncludePaths: [ 9 | 'source/' 10 | ] 11 | Source: [ 12 | 'source/**/*.cpp' 13 | ] 14 | Dependencies: { 15 | Build: [ 16 | 'mwasplund|Soup.Test.Cpp@0' 17 | ] 18 | Runtime: [ 19 | 'mwasplund|Opal@0' 20 | 'mwasplund|reflex@5' 21 | '../../monitor/host/' 22 | '[C]mwasplund|wren@1' 23 | 'mwasplund|CryptoPP@1' 24 | ] 25 | Test: [ 26 | 'mwasplund|Soup.Test.Assert@0' 27 | ] 28 | } 29 | Tests: { 30 | Source: [ 31 | 'tests/**/*.cpp' 32 | ] 33 | IncludePaths: [ 34 | 'tests/' 35 | ] 36 | } -------------------------------------------------------------------------------- /code/generate-sharp/utilities/sml/grammar/SML.tokens: -------------------------------------------------------------------------------- 1 | COLON=1 2 | AT_SIGN=2 3 | OPEN_PARENTHESIS=3 4 | CLOSE_PARENTHESIS=4 5 | LESS_THAN=5 6 | GREATER_THAN=6 7 | OPEN_BRACKET=7 8 | CLOSE_BRACKET=8 9 | OPEN_BRACE=9 10 | CLOSE_BRACE=10 11 | PIPE=11 12 | COMMA=12 13 | TRUE=13 14 | FALSE=14 15 | NEWLINE=15 16 | COMMENT=16 17 | VERSION=17 18 | FLOAT=18 19 | INTEGER=19 20 | ALPHA_LITERAL=20 21 | ALPHA_EXT1_LITERAL=21 22 | ALPHA_EXT2_LITERAL=22 23 | ALPHA_EXT3_LITERAL=23 24 | STRING_LITERAL=24 25 | WHITESPACE=25 26 | ':'=1 27 | '@'=2 28 | '('=3 29 | ')'=4 30 | '<'=5 31 | '>'=6 32 | '['=7 33 | ']'=8 34 | '{'=9 35 | '}'=10 36 | '|'=11 37 | ','=12 38 | 'true'=13 39 | 'false'=14 40 | -------------------------------------------------------------------------------- /samples/cpp/parse-json/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | import json11; 7 | 8 | int main() 9 | { 10 | // Read in the contents of the json file 11 | auto jsonFile = std::ifstream("./message.json"); 12 | auto jsonContent = std::string( 13 | std::istreambuf_iterator(jsonFile), 14 | std::istreambuf_iterator()); 15 | 16 | // Parse the json 17 | std::string errorMessage; 18 | auto json = json11::Json::parse(jsonContent, errorMessage); 19 | 20 | // Print the single property value 21 | std::cout << "Message: " << json["message"].string_value() << std::endl; 22 | 23 | return 0; 24 | } -------------------------------------------------------------------------------- /code/client/cli/source/options/initialize-options.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "shared-options.h" 7 | 8 | namespace Soup::Client 9 | { 10 | /// 11 | /// Initialize Command Options 12 | /// 13 | // TODO: [Verb("initialize")] 14 | class InitializeOptions : public SharedOptions 15 | { 16 | public: 17 | /// 18 | /// Gets or sets the path to initialize 19 | /// 20 | // [[Args::Option("path", Index = 0, HelpText = "Path to the package to initialize.")]] 21 | std::string Path; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /code/generate-sharp/utilities/sml/grammar/sml-lexer.tokens: -------------------------------------------------------------------------------- 1 | COLON=1 2 | AT_SIGN=2 3 | OPEN_PARENTHESIS=3 4 | CLOSE_PARENTHESIS=4 5 | LESS_THAN=5 6 | GREATER_THAN=6 7 | OPEN_BRACKET=7 8 | CLOSE_BRACKET=8 9 | OPEN_BRACE=9 10 | CLOSE_BRACE=10 11 | PIPE=11 12 | COMMA=12 13 | TRUE=13 14 | FALSE=14 15 | NEWLINE=15 16 | COMMENT=16 17 | VERSION=17 18 | FLOAT=18 19 | INTEGER=19 20 | ALPHA_LITERAL=20 21 | ALPHA_EXT1_LITERAL=21 22 | ALPHA_EXT2_LITERAL=22 23 | ALPHA_EXT3_LITERAL=23 24 | STRING_LITERAL=24 25 | WHITESPACE=25 26 | ':'=1 27 | '@'=2 28 | '('=3 29 | ')'=4 30 | '<'=5 31 | '>'=6 32 | '['=7 33 | ']'=8 34 | '{'=9 35 | '}'=10 36 | '|'=11 37 | ','=12 38 | 'true'=13 39 | 'false'=14 40 | -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/i-closure-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Threading.Tasks; 6 | using Path = Opal.Path; 7 | 8 | namespace Soup.Build.PackageManager; 9 | 10 | /// 11 | /// The closure manager interface 12 | /// Interface mainly used to allow for unit testing client code. 13 | /// 14 | public interface IClosureManager 15 | { 16 | Task GenerateAndRestoreRecursiveLocksAsync( 17 | Path workingDirectory, 18 | Path packageStoreDirectory, 19 | Path packageLockStoreDirectory, 20 | Path stagingDirectory); 21 | } 22 | -------------------------------------------------------------------------------- /code/generate-sharp/utilities/handled-exception.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | 7 | namespace Soup.Build; 8 | 9 | /// 10 | /// An exception type that indicates an error was already handled and we can safely exit 11 | /// 12 | public class HandledException : Exception 13 | { 14 | public HandledException(string message) : base(message) 15 | { 16 | } 17 | 18 | public HandledException(string message, Exception innerException) : base(message, innerException) 19 | { 20 | } 21 | 22 | public HandledException() 23 | { 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/directory-entry.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Opal.System; 6 | 7 | /// 8 | /// The directory entry. 9 | /// 10 | public class DirectoryEntry 11 | { 12 | public Path Path { get; set; } = new Path(); 13 | 14 | public bool IsDirectory { get; set; } 15 | 16 | public ulong Size { get; set; } 17 | 18 | public int AccessTime { get; set; } 19 | 20 | public int CreateTime { get; set; } 21 | 22 | public int ModifiedTime { get; set; } 23 | 24 | // TODO: Make generic 25 | public int Attributes { get; set; } 26 | } 27 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/app.axaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /code/generate-sharp/migrate/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C#': { 5 | Migrate: { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | Opal: { Version: '../opal/', Build: 'Build0', Tool: 'Tool0' } 7 | 'Soup.Utilities': { Version: '../utilities/', Build: 'Build1', Tool: 'Tool0' } 8 | } 9 | } 10 | Build0: { 11 | Wren: { 12 | 'Soup|CSharp': { Version: 0.16.0 } 13 | } 14 | } 15 | Build1: { 16 | Wren: { 17 | 'Soup|CSharp': { Version: 0.16.0 } 18 | 'Soup|CSharp.Nuget': { Version: 0.6.0 } 19 | } 20 | } 21 | Tool0: { 22 | 'C++': { 23 | 'mwasplund|copy': { Version: 1.2.0 } 24 | 'mwasplund|mkdir': { Version: 1.2.0 } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /code/monitor/client/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'Monitor.Client': { Version: './', Build: 'Build0', Tool: 'Tool0' } 6 | 'Monitor.Shared': { Version: '../shared/', Build: 'Build0', Tool: 'Tool0' } 7 | 'mwasplund|Detours': { Version: 4.0.14, Build: 'Build0', Tool: 'Tool0' } 8 | 'mwasplund|Opal': { Version: 0.12.4, Build: 'Build0', Tool: 'Tool0' } 9 | } 10 | } 11 | Build0: { 12 | Wren: { 13 | 'Soup|Cpp': { Version: 0.16.1 } 14 | } 15 | } 16 | Tool0: { 17 | 'C++': { 18 | 'mwasplund|copy': { Version: 1.2.0 } 19 | 'mwasplund|mkdir': { Version: 1.2.0 } 20 | 'mwasplund|parse.modules': { Version: 1.2.0 } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /scripts/linux/bootstrap: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Bootstrap Build" 3 | 4 | # Stop on first error 5 | set -e 6 | 7 | FLAVOR="Release" 8 | SCRIPTS_DIR=$(dirname "$0") 9 | 10 | # Build Client 11 | echo $SCRIPTS_DIR/bootstrap-client 12 | $SCRIPTS_DIR/bootstrap-client 13 | 14 | # Build SWhere tool 15 | echo $SCRIPTS_DIR/build-swhere $FLAVOR 16 | $SCRIPTS_DIR/build-swhere $FLAVOR 17 | 18 | # Build PackageManager 19 | echo $SCRIPTS_DIR/build-packagemanager $FLAVOR 20 | $SCRIPTS_DIR/build-packagemanager $FLAVOR 21 | 22 | # Build Tools 23 | echo $SCRIPTS_DIR/bootstrap-tools 24 | $SCRIPTS_DIR/bootstrap-tools 25 | 26 | # Build View 27 | echo $SCRIPTS_DIR/build-view $FLAVOR 28 | $SCRIPTS_DIR/build-view $FLAVOR -------------------------------------------------------------------------------- /code/client/core/source/build/known-language.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | module; 6 | 7 | #include 8 | 9 | export module Soup.Core:KnownLanguage; 10 | 11 | import Opal; 12 | 13 | using namespace Opal; 14 | 15 | namespace Soup::Core 16 | { 17 | export struct KnownLanguage 18 | { 19 | KnownLanguage( 20 | std::string extensionOwner, 21 | std::string extensionName) : 22 | ExtensionOwner(std::move(extensionOwner)), 23 | ExtensionName(std::move(extensionName)) 24 | { 25 | } 26 | 27 | std::string ExtensionOwner; 28 | std::string ExtensionName; 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /code/tools/parse-modules/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C++': { 5 | 'mwasplund|Opal': { Version: 0.12.4, Build: 'Build0', Tool: 'Tool0' } 6 | 'mwasplund|reflex': { Version: 5.5.2, Build: 'Build0', Tool: 'Tool0' } 7 | 'parse.modules': { Version: './', Build: 'Build0', Tool: 'Tool0' } 8 | 'mwasplund|parse.modules': { Version: './', Build: 'Build0', Tool: 'Tool0' } 9 | } 10 | } 11 | Build0: { 12 | Wren: { 13 | 'Soup|Cpp': { Version: 0.16.1 } 14 | } 15 | } 16 | Tool0: { 17 | 'C++': { 18 | 'mwasplund|copy': { Version: 1.2.0 } 19 | 'mwasplund|mkdir': { Version: 1.2.0 } 20 | 'mwasplund|parse.modules': { Version: 1.2.0 } 21 | } 22 | } 23 | } -------------------------------------------------------------------------------- /scripts/linux/build: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | echo "Build: $1" 3 | 4 | # Stop on first error 5 | set -e 6 | 7 | FLAVOR="$1" 8 | SCRIPTS_DIR=$(dirname "$0") 9 | 10 | # Build Client 11 | echo $SCRIPTS_DIR/build-client $FLAVOR 12 | $SCRIPTS_DIR/build-client $FLAVOR 13 | 14 | # Build SWhere tool 15 | echo $SCRIPTS_DIR/build-swhere $FLAVOR 16 | $SCRIPTS_DIR/build-swhere $FLAVOR 17 | 18 | # Build PackageManager 19 | echo $SCRIPTS_DIR/build-packagemanager $FLAVOR 20 | $SCRIPTS_DIR/build-packagemanager $FLAVOR 21 | 22 | # Build Tools 23 | echo $SCRIPTS_DIR/build-tools $FLAVOR 24 | $SCRIPTS_DIR/build-tools $FLAVOR 25 | 26 | # Build View 27 | echo $SCRIPTS_DIR/build-view $FLAVOR 28 | $SCRIPTS_DIR/build-view $FLAVOR -------------------------------------------------------------------------------- /scripts/windows/sign-runtime.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET ScriptsDir=%~dp0 4 | SET RootDir=%ScriptsDir%..\.. 5 | SET OutDir=%RootDir%\out 6 | SET RunDir=%OutDir%\run 7 | 8 | SET SIGN_COMMAND=signtool sign /n "Open Source Developer, Matthew Asplund" /t http://time.certum.pl /fd sha1 /v 9 | 10 | SET SignFiles=%RunDir%\*.exe 11 | SET SignFiles=%RunDir%\Soup\*.dll %SignFiles% 12 | SET SignFiles=%RunDir%\Soup\*.exe %SignFiles% 13 | SET SignFiles=%RunDir%\Soup\PackageManager\*.dll %SignFiles% 14 | SET SignFiles=%RunDir%\Soup\PackageManager\*.exe %SignFiles% 15 | SET SignFiles=%RunDir%\Soup\View\*.dll %SignFiles% 16 | SET SignFiles=%RunDir%\Soup\View\*.exe %SignFiles% 17 | 18 | %SIGN_COMMAND% %SignFiles% -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/view-models/content-pane-view-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia.Controls.Notifications; 6 | using Avalonia.Threading; 7 | 8 | namespace Soup.View.ViewModels; 9 | 10 | public class ContentPaneViewModel : ViewModelBase 11 | { 12 | public WindowNotificationManager? NotificationManager { get; set; } 13 | 14 | protected void NotifyError(string message) 15 | { 16 | Dispatcher.UIThread.Post(() => 17 | { 18 | this.NotificationManager?.Show( 19 | new Notification( 20 | "Error", 21 | message, 22 | NotificationType.Error)); 23 | }); 24 | } 25 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/local-user-config/local-user-config-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunLocalUserConfigTests; 6 | 7 | import :LocalUserConfigTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunLocalUserConfigTests() 11 | { 12 | auto className = "LocalUserConfigTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "InitializerDefault", [&testClass]() { testClass->InitializerDefault(); }); 16 | state += Soup::Test::RunTest(className, "OperatorEqualDefault", [&testClass]() { testClass->OperatorEqualDefault(); }); 17 | 18 | return state; 19 | } -------------------------------------------------------------------------------- /code/generate-sharp/swhere.core.unittests/swhere.unittests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | false 5 | 6 | 7 | 8 | 9 | 10 | runtime; build; native; contentfiles; analyzers; buildtransitive 11 | all 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /docs/architecture/active-state-table.md: -------------------------------------------------------------------------------- 1 | # Active State Table 2 | 3 | The root table that provides input and output state from individual build tasks during the Generate phase. Used for inter-task communication within the same package generate phase. 4 | 5 | ## Known Keys 6 | 7 | ### "Parameters" 8 | The [Parameters Table](parameters-table.md) that contains the input from the Command Line Application. 9 | 10 | ### "Recipe" 11 | The duplicated state of the [Recipe](recipe.md) file. 12 | 13 | ### "Dependencies" 14 | The table which a key for each direct dependency referenced from the Recipe file. The value contains the [Shared State Table](shared-state-table.md) from the resulting outputs from the generate phase of the referenced package build. 15 | 16 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/app.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls.ApplicationLifetimes; 3 | using Avalonia.Markup.Xaml; 4 | using Soup.View.ViewModels; 5 | using System.Linq; 6 | 7 | namespace Soup.View; 8 | 9 | public partial class App : Application 10 | { 11 | public override void Initialize() 12 | { 13 | AvaloniaXamlLoader.Load(this); 14 | } 15 | 16 | public override void OnFrameworkInitializationCompleted() 17 | { 18 | if (this.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) 19 | { 20 | desktop.MainWindow = new MainWindow() 21 | { 22 | DataContext = new MainWindowViewModel(desktop.Args?.FirstOrDefault()), 23 | }; 24 | } 25 | 26 | base.OnFrameworkInitializationCompleted(); 27 | } 28 | } -------------------------------------------------------------------------------- /docs/tools/swhere.md: -------------------------------------------------------------------------------- 1 | # SWhere 2 | To allow external SDKs to be injected into Soup builds the [Local User Config](../architecture/local-user-config.md) file allows for the user to define a set of know SDKs with a list of directories and properties. These properties can be manually defined, but to make setup easier this tool will discover a set of shared SDKs and register them in the config file. 3 | 4 | ## List Of SDKs 5 | * MSVC - Find the latest Visual C++ compiler using VSWhere. 6 | * Roslyn - Find the latest Roslyn compiler for C# using VSWhere. 7 | * DotNet - Set the known location and version for the dotnet CLR. 8 | * Windows - Find the latest Windows SDK by looking in a known folder location. 9 | * NetFXTools - Set the known location for the NetFX Tools. 10 | -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/package-create-or-update-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | using System.Text.Json.Serialization; 7 | 8 | namespace Soup.Build.Api.Client; 9 | 10 | /// 11 | /// A container for the package creation or update request. 12 | /// 13 | public class PackageCreateOrUpdateModel 14 | { 15 | /// 16 | /// Gets or sets the description. 17 | /// 18 | [JsonPropertyName("description")] 19 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 20 | [StringLength(1024)] 21 | public string? Description { get; set; } 22 | } -------------------------------------------------------------------------------- /code/client/core/source/build/build-failed-exception.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | module; 6 | 7 | #include 8 | 9 | export module Soup.Core:BuildFailedException; 10 | 11 | import Opal; 12 | 13 | using namespace Opal; 14 | 15 | namespace Soup::Core 16 | { 17 | /// 18 | /// The exception thrown to indicate that a build operation has failed 19 | /// 20 | export class BuildFailedException : public std::exception 21 | { 22 | public: 23 | /// 24 | /// Initializes a new instance of the class. 25 | /// 26 | BuildFailedException() 27 | { 28 | } 29 | }; 30 | } 31 | -------------------------------------------------------------------------------- /code/client/cli/recipe.sml: -------------------------------------------------------------------------------- 1 | Name: 'Soup' 2 | Version: 0.42.7 3 | Language: 'C++|0' 4 | Type: 'Executable' 5 | Source: [ 6 | 'source/**/*.cpp' 7 | ] 8 | IncludePaths: [ 9 | 'source/commands/' 10 | 'source/options/' 11 | ] 12 | Dependencies: { 13 | # Ensure the core build extensions are runtime dependencies 14 | Runtime: [ 15 | '../core/' 16 | '../../generate/' 17 | '../../monitor/host/' 18 | ] 19 | Other: [ 20 | '../../tools/copy/' 21 | '../../tools/mkdir/' 22 | '../../tools/parse-modules/' 23 | '[Wren]Soup|Wren@0' 24 | ] 25 | Build: [ 26 | # TODO: 'Soup.Test.Cpp@0.4.0' 27 | ] 28 | Test: [ 29 | # TODO: 'Soup.Test.Assert@0.3.0' 30 | ] 31 | } 32 | Tests: { 33 | Source: [ 34 | 'tests/**/*.cpp' 35 | ] 36 | IncludePaths: [ 37 | 'tests/' 38 | ] 39 | } -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/compression-zip-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // name<@version> 6 | ``` 7 | 8 | `path` - An optional parameter that directly follows the install command. If present this specifies the directory to look for a Recipe file to load. If not present then the command will use the current active directory. 9 | 10 | `name<@version>` - A parameter to specify the name and optional version of the package you would like to install. 11 | 12 | ## Examples 13 | Install the latest `json11` package and register it in the MyProject Recipe file. 14 | ``` 15 | soup install ./Code/MyProject/ json11 16 | ``` 17 | 18 | Install version `1.1.0` of the `json11` package and register it in the current folder Recipe file. 19 | ``` 20 | soup install json11@1.1.0 21 | ``` -------------------------------------------------------------------------------- /code/monitor/client/windows/functions/cache/undocumented-api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Monitor::Windows::Functions::Cache::UndocumentedApi 4 | { 5 | /// 6 | /// Entry Point 7 | /// 8 | int (WINAPI* EntryPoint)() = nullptr; 9 | 10 | /// 11 | /// Undocumented api for copy 12 | /// Note: Used in xcopy 13 | /// 14 | BOOL (WINAPI* PrivCopyFileExA)( 15 | LPCSTR lpExistingFileName, 16 | LPCSTR lpNewFileName, 17 | LPPROGRESS_ROUTINE lpProgressRoutine, 18 | LPVOID lpData, 19 | LPBOOL pbCancel, 20 | DWORD dwCopyFlags) = nullptr; 21 | BOOL (WINAPI* PrivCopyFileExW)( 22 | LPCWSTR lpExistingFileName, 23 | LPCWSTR lpNewFileName, 24 | LPPROGRESS_ROUTINE lpProgressRoutine, 25 | LPVOID lpData, 26 | LPBOOL pbCancel, 27 | DWORD dwCopyFlags) = nullptr; 28 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/build/recipe-build-location-manager-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunRecipeBuildLocationManagerTests; 6 | 7 | import :RecipeBuildLocationManagerTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunRecipeBuildLocationManagerTests() 11 | { 12 | auto className = "RecipeBuildLocationManagerTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "GetOutputDirectory_Simple", [&testClass]() { testClass->GetOutputDirectory_Simple(); }); 16 | state += Soup::Test::RunTest(className, "GetOutputDirectory_RootRecipe", [&testClass]() { testClass->GetOutputDirectory_RootRecipe(); }); 17 | 18 | return state; 19 | } -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/package-lock.sml: -------------------------------------------------------------------------------- 1 | Version: 5 2 | Closures: { 3 | Root: { 4 | 'C#': { 5 | Opal: { Version: '../opal/', Build: 'Build0', Tool: 'Tool0' } 6 | 'Soup.Api.Client': { Version: '../api.client/', Build: 'Build0', Tool: 'Tool0' } 7 | 'Soup.Build.Utilities': { Version: '../utilities/', Build: 'Build0', Tool: 'Tool0' } 8 | 'Soup.PackageManager': { Version: './', Build: 'Build0', Tool: 'Tool0' } 9 | 'Soup.PackageManager.Core': { Version: '../package-manager.core/', Build: 'Build0', Tool: 'Tool0' } 10 | } 11 | } 12 | Build0: { 13 | Wren: { 14 | 'Soup|CSharp': { Version: 0.16.0 } 15 | 'Soup|CSharp.Nuget': { Version: 0.6.0 } 16 | } 17 | } 18 | Tool0: { 19 | 'C++': { 20 | 'mwasplund|copy': { Version: 1.2.0 } 21 | 'mwasplund|mkdir': { Version: 1.2.0 } 22 | } 23 | } 24 | } -------------------------------------------------------------------------------- /code/generate-sharp/soup-native-interop/load-build-graph-result.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Soup.Native; 8 | 9 | public class LoadBuildGraph 10 | { 11 | public int RootPackageGraphId { get; set; } 12 | public IList PackageGraphs { get; init; } = []; 13 | public IList Packages { get; init; } = []; 14 | public IDictionary> PackageTargetDirectories { get; init; } = new Dictionary>(); 15 | } 16 | 17 | public class LoadBuildGraphResult 18 | { 19 | public bool IsSuccess { get; set; } 20 | public string? Message { get; set; } 21 | public LoadBuildGraph? Graph { get; set; } 22 | } -------------------------------------------------------------------------------- /code/monitor/client/windows/functions/cache/lib-loader-api.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace Monitor::Windows::Functions::Cache::LibLoaderApi 4 | { 5 | /// 6 | /// Loads the specified module into the address space of the calling process. 7 | /// 8 | HMODULE (WINAPI* LoadLibraryA)( 9 | LPCSTR lpLibFileName) = ::LoadLibraryA; 10 | HMODULE (WINAPI* LoadLibraryW)( 11 | LPCWSTR lpLibFileName) = ::LoadLibraryW; 12 | 13 | /// 14 | /// Loads the specified module into the address space of the calling process. 15 | /// 16 | HMODULE (WINAPI* LoadLibraryExA)( 17 | LPCSTR lpLibFileName, 18 | HANDLE hFile, 19 | DWORD dwFlags) = ::LoadLibraryExA; 20 | HMODULE (WINAPI* LoadLibraryExW)( 21 | LPCWSTR lpLibFileName, 22 | HANDLE hFile, 23 | DWORD dwFlags) = ::LoadLibraryExW; 24 | } -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/file-parameter.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.IO; 6 | 7 | namespace Soup.Build.Api.Client; 8 | 9 | public class FileParameter 10 | { 11 | public FileParameter(Stream data) 12 | : this(data, null, null) 13 | { 14 | } 15 | 16 | public FileParameter(Stream data, string? fileName) 17 | : this(data, fileName, null) 18 | { 19 | } 20 | 21 | public FileParameter(Stream data, string? fileName, string? contentType) 22 | { 23 | this.Data = data; 24 | this.FileName = fileName; 25 | this.ContentType = contentType; 26 | } 27 | 28 | public Stream Data { get; private set; } 29 | 30 | public string? FileName { get; private set; } 31 | 32 | public string? ContentType { get; private set; } 33 | } -------------------------------------------------------------------------------- /docs/cli/build.md: -------------------------------------------------------------------------------- 1 | # Build 2 | ## Overview 3 | Build a recipe and all recursive dependencies. 4 | ``` 5 | soup build [-flavor |-force] 6 | ``` 7 | 8 | `path` - An optional parameter that directly follows the build command. If present this specifies the directory to look for a Recipe file to build. If not present then the command will use the current active directory. 9 | 10 | `-flavor ` - An optional parameter to specify the build flavor. Common values include `Debug` or `Release`. 11 | 12 | `-force` - An optional parameter that forces the build to ignore incremental state and rebuild the world. 13 | 14 | ## Examples 15 | Build a Recipe in the current directory for release. 16 | ``` 17 | soup build 18 | ``` 19 | 20 | Build a debug Recipe in a different directory. 21 | ``` 22 | soup build C:\Code\MyProject\ -flavor debug 23 | ``` 24 | -------------------------------------------------------------------------------- /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04 2 | 3 | # ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none" 4 | 5 | # # Optionally install the cmake for vcpkg 6 | # COPY ./reinstall-cmake.sh /tmp/ 7 | 8 | # RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \ 9 | # chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \ 10 | # fi \ 11 | # && rm -f /tmp/reinstall-cmake.sh 12 | 13 | # [Optional] Uncomment this section to install additional vcpkg ports. 14 | # RUN su vscode -c "${VCPKG_ROOT}/vcpkg install " 15 | 16 | # [Optional] Uncomment this section to install additional packages. 17 | # RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \ 18 | # && apt-get -y install --no-install-recommends 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Run command '...' 16 | 2. Copy file '...' 17 | 3. Delete folder '...' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - Soup Version: [run `soup version`] 28 | - OS: [e.g. Windows] 29 | - Client Version [e.g. 1.2.3] 30 | 31 | **Additional context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /code/generate-sharp/package-manager.unittests/soup.build.package-manager.unittests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | false 5 | 6 | 7 | 8 | 9 | 10 | 11 | runtime; build; native; contentfiles; analyzers; buildtransitive 12 | all 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/views/task-graph-view.axaml.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia; 6 | using Avalonia.Controls; 7 | using Avalonia.Controls.Notifications; 8 | using Soup.View.ViewModels; 9 | 10 | namespace Soup.View.Views; 11 | 12 | public partial class TaskGraphView : UserControl 13 | { 14 | public TaskGraphView() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) 20 | { 21 | base.OnAttachedToVisualTree(e); 22 | 23 | var dataContext = (ContentPaneViewModel?)this.DataContext; 24 | if (dataContext is not null) 25 | { 26 | dataContext.NotificationManager = new WindowNotificationManager(TopLevel.GetTopLevel(this)!); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /docs/samples/c.md: -------------------------------------------------------------------------------- 1 | # Samples 2 | The set of C++ samples. 3 | 4 | ## [Build Extension](c/build-extension.md) 5 | This is a console application that uses a custom build extension to set a preprocessor definition to show how a user can easily author their own custom build logic that can be shared with others. 6 | 7 | ## [Console Application](c/console-application.md) 8 | This is the smallest amount of code to get a console application building using Soup. 9 | 10 | ## [Dynamic Library](c/dynamic-library.md) 11 | This is a console application that has a single dynamic library dependency. 12 | 13 | ## [Static Library](c/static-library.md) 14 | This is a console application that has a single static library dependency. 15 | 16 | ## [Windows Application](c/windows-application.md) 17 | This is a windows win32 application that demonstrates how to create a windows GUI application. 18 | -------------------------------------------------------------------------------- /code/client/cli/source/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | import Monitor.Host; 20 | import Opal; 21 | import Soup.Core; 22 | 23 | using namespace Opal; 24 | 25 | #include "program.h" 26 | 27 | int main(int argc, char** argv) 28 | { 29 | std::vector args; 30 | for (int i = 0; i < argc; i++) 31 | { 32 | args.push_back(argv[i]); 33 | } 34 | 35 | auto program = Soup::Client::Program(); 36 | return program.Run(std::move(args)); 37 | } 38 | -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/runtime-system.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Microsoft.Win32; 6 | using System.Runtime.Versioning; 7 | 8 | namespace Opal.System; 9 | 10 | /// 11 | /// A windows platform specific process executable using system 12 | /// 13 | public class RuntimeSystem : ISystem 14 | { 15 | /// 16 | /// Initializes a new instance of the class. 17 | /// 18 | public RuntimeSystem() 19 | { 20 | } 21 | 22 | /// 23 | /// Gets the registry value 24 | /// 25 | [SupportedOSPlatform("windows")] 26 | public object? GetRegistryValue(string keyName, string? valueName, object? defaultValue) 27 | { 28 | return Registry.GetValue(keyName, valueName, null); 29 | } 30 | } -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/views/dependency-graph-view.axaml.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia; 6 | using Avalonia.Controls; 7 | using Avalonia.Controls.Notifications; 8 | using Soup.View.ViewModels; 9 | 10 | namespace Soup.View.Views; 11 | 12 | public partial class DependencyGraphView : UserControl 13 | { 14 | public DependencyGraphView() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) 20 | { 21 | base.OnAttachedToVisualTree(e); 22 | 23 | var dataContext = (ContentPaneViewModel?)this.DataContext; 24 | if (dataContext is not null) 25 | { 26 | dataContext.NotificationManager = new WindowNotificationManager(TopLevel.GetTopLevel(this)!); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /code/generate-sharp/utilities.unittests/recipe/package-name-unittests.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Xunit; 6 | 7 | namespace Soup.Build.Utilities.UnitTests; 8 | 9 | public class PackageNameUnitTests 10 | { 11 | [Fact] 12 | public void DefaultInitializer() 13 | { 14 | var uut = new PackageName(null, string.Empty); 15 | Assert.Null(uut.Owner); 16 | Assert.Equal("", uut.Name); 17 | } 18 | 19 | [Fact] 20 | public void Parse_Public() 21 | { 22 | var uut = PackageName.Parse("Other"); 23 | Assert.Null(uut.Owner); 24 | Assert.Equal("Other", uut.Name); 25 | } 26 | 27 | [Fact] 28 | public void Parse_Public_Owner() 29 | { 30 | var uut = PackageName.Parse("User1|Other"); 31 | Assert.Equal("User1", uut.Owner); 32 | Assert.Equal("Other", uut.Name); 33 | } 34 | } -------------------------------------------------------------------------------- /samples/c/windows-application/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by windows-project.rc 4 | 5 | #define IDS_APP_TITLE 103 6 | 7 | #define IDR_MAINFRAME 128 8 | #define IDD_WINDOWSPROJECT_DIALOG 102 9 | #define IDD_ABOUTBOX 103 10 | #define IDM_ABOUT 104 11 | #define IDM_EXIT 105 12 | #define IDI_WINDOWSPROJECT 107 13 | #define IDI_SMALL 108 14 | #define IDC_WINDOWSPROJECT 109 15 | #define IDC_MYICON 2 16 | #ifndef IDC_STATIC 17 | #define IDC_STATIC -1 18 | #endif 19 | // Next default values for new objects 20 | // 21 | #ifdef APSTUDIO_INVOKED 22 | #ifndef APSTUDIO_READONLY_SYMBOLS 23 | 24 | #define _APS_NO_MFC 130 25 | #define _APS_NEXT_RESOURCE_VALUE 129 26 | #define _APS_NEXT_COMMAND_VALUE 32771 27 | #define _APS_NEXT_CONTROL_VALUE 1000 28 | #define _APS_NEXT_SYMED_VALUE 110 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /samples/cpp/windows-application/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by windows-project.rc 4 | 5 | #define IDS_APP_TITLE 103 6 | 7 | #define IDR_MAINFRAME 128 8 | #define IDD_WINDOWSPROJECT_DIALOG 102 9 | #define IDD_ABOUTBOX 103 10 | #define IDM_ABOUT 104 11 | #define IDM_EXIT 105 12 | #define IDI_WINDOWSPROJECT 107 13 | #define IDI_SMALL 108 14 | #define IDC_WINDOWSPROJECT 109 15 | #define IDC_MYICON 2 16 | #ifndef IDC_STATIC 17 | #define IDC_STATIC -1 18 | #endif 19 | // Next default values for new objects 20 | // 21 | #ifdef APSTUDIO_INVOKED 22 | #ifndef APSTUDIO_READONLY_SYMBOLS 23 | 24 | #define _APS_NO_MFC 130 25 | #define _APS_NEXT_RESOURCE_VALUE 129 26 | #define _APS_NEXT_COMMAND_VALUE 32771 27 | #define _APS_NEXT_CONTROL_VALUE 1000 28 | #define _APS_NEXT_SYMED_VALUE 110 29 | #endif 30 | #endif 31 | -------------------------------------------------------------------------------- /docs/cli/target.md: -------------------------------------------------------------------------------- 1 | # Target 2 | ## Overview 3 | Print the unique target directory for a recipe that would be built using the provided configuration parameters. 4 | ``` 5 | soup target [-flavor ] 6 | ``` 7 | 8 | `path` - An optional parameter that directly follows the build command. If present this specifies the directory to look for a Recipe file to build. If not present then the command will use the current active directory. 9 | 10 | `-flavor ` - An optional parameter to specify the build flavor. Common values include `Debug` or `Release`. 11 | 12 | ## Examples 13 | Print the target directory for a Recipe in the current directory for debug with default configurations. 14 | ``` 15 | soup target 16 | ``` 17 | 18 | Print the target directory for a release Recipe in a different directory with the release flavor. 19 | ``` 20 | soup target ./Code/MyProject/ -flavor Release 21 | ``` 22 | -------------------------------------------------------------------------------- /code/generate-sharp/package-manager/soup.build.package-manager.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | Exe 4 | net9.0 5 | true 6 | true 7 | false 8 | false 9 | package-manager 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /docs/architecture/local-user-config.md: -------------------------------------------------------------------------------- 1 | # Local User Config 2 | 3 | The Local User config allows for a set of properties to be set for an individual user. Currently the only state that is used from this file is the list of SDKs. The [SWhere](../tools/swhere.md) can be used to automatically fill in this file with the VSWhere tooling. 4 | 5 | ## "SDK" 6 | A special table that allows for registering external SDKs. These allow for passing in Properties and a list of directories that should be allowed read access. 7 | 8 | ### "Name" 9 | The unique name of the SDK. 10 | 11 | ### "SourceDirectories" 12 | The list of directory strings that will be granted read access to allow the build to integrate with resources outside the normal input/output directories. 13 | 14 | ### "Properties" 15 | The list of properties that will be passed into the build so the Generate phase can pick up information about the external SDKs. -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/views/preprocessor-task-graph-view.axaml.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia; 6 | using Avalonia.Controls; 7 | using Avalonia.Controls.Notifications; 8 | using Soup.View.ViewModels; 9 | 10 | namespace Soup.View.Views; 11 | 12 | public partial class PreprocessorTaskGraphView : UserControl 13 | { 14 | public PreprocessorTaskGraphView() 15 | { 16 | InitializeComponent(); 17 | } 18 | 19 | protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) 20 | { 21 | base.OnAttachedToVisualTree(e); 22 | 23 | var dataContext = (ContentPaneViewModel?)this.DataContext; 24 | if (dataContext is not null) 25 | { 26 | dataContext.NotificationManager = new WindowNotificationManager(TopLevel.GetTopLevel(this)!); 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/view-models/view-model-base.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using ReactiveUI; 6 | using System; 7 | using System.Collections.Generic; 8 | using System.Runtime.CompilerServices; 9 | 10 | namespace Soup.View.ViewModels; 11 | 12 | public class ViewModelBase : ReactiveObject 13 | { 14 | public bool CheckRaiseAndSetIfChanged( 15 | ref TRet backingField, 16 | TRet newValue, 17 | [CallerMemberName] string? propertyName = null) 18 | { 19 | ArgumentNullException.ThrowIfNull(propertyName); 20 | 21 | if (EqualityComparer.Default.Equals(backingField, newValue)) 22 | { 23 | return false; 24 | } 25 | 26 | this.RaisePropertyChanging(propertyName); 27 | backingField = newValue; 28 | this.RaisePropertyChanged(propertyName); 29 | return true; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/views/main-window.axaml.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia; 6 | using Avalonia.Controls; 7 | using Avalonia.Controls.Notifications; 8 | using Soup.View.ViewModels; 9 | 10 | namespace Soup.View; 11 | 12 | public partial class MainWindow : Window 13 | { 14 | public MainWindow() 15 | { 16 | InitializeComponent(); 17 | if (this.DataContext is MainWindowViewModel viewModel) 18 | { 19 | viewModel.StorageProvider = this.StorageProvider; 20 | } 21 | } 22 | 23 | protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) 24 | { 25 | base.OnAttachedToVisualTree(e); 26 | 27 | if (this.DataContext is MainWindowViewModel viewModel) 28 | { 29 | viewModel.NotificationManager = new WindowNotificationManager(GetTopLevel(this)!); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/source-generation-context.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Text.Json.Serialization; 6 | 7 | namespace Soup.Build.Api.Client; 8 | 9 | [JsonSourceGenerationOptions( 10 | WriteIndented = false, 11 | PropertyNamingPolicy = JsonKnownNamingPolicy.CamelCase, 12 | GenerationMode = JsonSourceGenerationMode.Metadata)] 13 | [JsonSerializable(typeof(GenerateClosureRequestModel))] 14 | [JsonSerializable(typeof(GenerateClosureResultModel))] 15 | [JsonSerializable(typeof(LanguageModel))] 16 | [JsonSerializable(typeof(PackageCreateOrUpdateModel))] 17 | [JsonSerializable(typeof(PackageModel))] 18 | [JsonSerializable(typeof(PackageVersionModel))] 19 | [JsonSerializable(typeof(SearchPackagesModel))] 20 | internal sealed partial class SourceGenerationContext : JsonSerializerContext 21 | { 22 | } -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/language-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | using System.Text.Json.Serialization; 7 | 8 | namespace Soup.Build.Api.Client; 9 | 10 | /// 11 | /// A class representing the package result. 12 | /// 13 | public class LanguageModel 14 | { 15 | /// 16 | /// Gets or sets the name. 17 | /// 18 | [JsonPropertyName("name")] 19 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 20 | [Required(AllowEmptyStrings = true)] 21 | public required string Name { get; set; } 22 | 23 | /// 24 | /// Gets or sets the description. 25 | /// 26 | [JsonPropertyName("description")] 27 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 28 | public string? Description { get; set; } 29 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/logger/event-type-filter.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Opal; 6 | 7 | public class EventTypeFilter : IEventFilter 8 | { 9 | private TraceEvents types; 10 | 11 | public EventTypeFilter(TraceEvents eventTypes) 12 | { 13 | this.types = eventTypes; 14 | } 15 | 16 | public void Set(TraceEvents eventType) 17 | { 18 | this.types = eventType; 19 | } 20 | 21 | public void Disable(TraceEvents eventType) 22 | { 23 | this.types &= ~eventType; 24 | } 25 | 26 | public void Enable(TraceEvents eventType) 27 | { 28 | this.types |= eventType; 29 | } 30 | 31 | public bool IsEnabled(TraceEvents eventType) 32 | { 33 | return (this.types & eventType) == eventType; 34 | } 35 | 36 | public virtual bool ShouldTrace(TraceEvents eventType) 37 | { 38 | return IsEnabled(eventType); 39 | } 40 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/i-process-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | namespace Opal.System; 6 | 7 | /// 8 | /// The process manager interface 9 | /// Interface mainly used to allow for unit testing client code. 10 | /// 11 | public interface IProcessManager 12 | { 13 | /// 14 | /// Gets the process file name. 15 | /// 16 | abstract Path GetCurrentProcessFileName(); 17 | 18 | /// 19 | /// Creates a process for the provided executable path. 20 | /// 21 | /// The executable. 22 | /// The arguments. 23 | /// The working directory. 24 | abstract IProcess CreateProcess( 25 | string executable, 26 | string arguments, 27 | Path workingDirectory); 28 | } 29 | -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/package-summary-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | using System.Text.Json.Serialization; 7 | 8 | namespace Soup.Build.Api.Client; 9 | 10 | /// 11 | /// A container for the package summary result. 12 | /// 13 | public class PackageSummaryModel 14 | { 15 | /// 16 | /// Gets or sets the name. 17 | /// 18 | [JsonPropertyName("name")] 19 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 20 | [Required(AllowEmptyStrings = true)] 21 | public required string Name { get; set; } 22 | 23 | /// 24 | /// Gets or sets the description. 25 | /// 26 | [JsonPropertyName("description")] 27 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 28 | public string? Description { get; set; } 29 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/i-process.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Threading.Tasks; 6 | 7 | namespace Opal.System; 8 | 9 | /// 10 | /// The process interface 11 | /// Interface mainly used to allow for unit testing client code. 12 | /// 13 | public interface IProcess 14 | { 15 | /// 16 | /// Execute a process for the provided. 17 | /// 18 | void Start(); 19 | 20 | /// 21 | /// Wait for the process to exit. 22 | /// 23 | Task WaitForExitAsync(); 24 | 25 | /// 26 | /// Get the exit code. 27 | /// 28 | int GetExitCode(); 29 | 30 | /// 31 | /// Get the standard output. 32 | /// 33 | string GetStandardOutput(); 34 | 35 | /// 36 | /// Get the standard error output. 37 | /// 38 | string GetStandardError(); 39 | } -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/app.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /scripts/windows/build.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | SETLOCAL 3 | SET Flavor=%1 4 | SET ScriptsDir=%~dp0 5 | 6 | REM - Build Client 7 | echo %ScriptsDir%/build-client.cmd %Flavor% 8 | call %ScriptsDir%/build-client.cmd %Flavor% 9 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% 10 | 11 | REM - Build SWhere tool 12 | echo %ScriptsDir%/build-swhere.cmd %Flavor% 13 | call %ScriptsDir%/build-swhere.cmd %Flavor% 14 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% 15 | 16 | REM - Build PackageManager 17 | echo %ScriptsDir%/build-packagemanager.cmd %Flavor% 18 | call %ScriptsDir%/build-packagemanager.cmd %Flavor% 19 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% 20 | 21 | REM - Build Tools 22 | echo %ScriptsDir%/build-tools.cmd %Flavor% 23 | call %ScriptsDir%/build-tools.cmd %Flavor% 24 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% 25 | 26 | REM - Build View 27 | echo %ScriptsDir%/build-view.cmd %Flavor% 28 | call %ScriptsDir%/build-view.cmd %Flavor% 29 | if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL% -------------------------------------------------------------------------------- /code/tools/parse-modules/early-exit-exception.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | module; 6 | 7 | #include 8 | 9 | export module parse.modules:EarlyExitException; 10 | 11 | namespace Soup::ParseModules 12 | { 13 | /// 14 | /// A special exception overload that indicates an early exit for the application that was handled 15 | /// 16 | export class EarlyExitException : public std::runtime_error 17 | { 18 | public: 19 | /// 20 | /// Initialize a new instance of the EarlyExitException class 21 | /// 22 | EarlyExitException(const std::string& what_arg) : 23 | std::runtime_error(what_arg) 24 | { 25 | } 26 | 27 | EarlyExitException(const EarlyExitException& other) : 28 | std::runtime_error(other) 29 | { 30 | } 31 | 32 | virtual ~EarlyExitException() noexcept 33 | { 34 | } 35 | }; 36 | } -------------------------------------------------------------------------------- /scripts/linux/release: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Stop on first error 4 | set -e 5 | 6 | SCRIPTS_DIR=$(dirname "$0") 7 | ROOT_DIR=$SCRIPTS_DIR/../.. 8 | OUT_DIR=$ROOT_DIR/out 9 | RUN_DIR=$OUT_DIR/run 10 | RELEASE_DIR=$OUT_DIR/release 11 | VERSION=$($RUN_DIR/bin/soup "version") 12 | 13 | # Cleanup previous runs 14 | rm -rf $RELEASE_DIR 15 | mkdir -p $RELEASE_DIR 16 | 17 | echo "Pack the release tarbal" 18 | tar -a -cf $RELEASE_DIR/soup-build-$VERSION-linux-x64.tar.gz -C $RUN_DIR . 19 | 20 | echo "Create the debian package" 21 | DEB_DIR=$RELEASE_DIR/soup-build_$VERSION-1_amd64 22 | mkdir -p $DEB_DIR/DEBIAN 23 | 24 | cp -p -R $RUN_DIR/bin/ $DEB_DIR 25 | cp -p -R $RUN_DIR/lib/ $DEB_DIR 26 | 27 | echo "Package: soup-build 28 | Version: $VERSION 29 | Maintainer: Matthew Asplund 30 | Depends: libc6 31 | Architecture: amd64 32 | Homepage: https://www.soupbuild.com 33 | Description: Soup Build System" \ 34 | > $DEB_DIR/DEBIAN/control 35 | 36 | dpkg --build $DEB_DIR -------------------------------------------------------------------------------- /code/generate-sharp/opal.unittests/opal.unittests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | false 5 | 6 | 7 | 8 | 9 | 10 | runtime; build; native; contentfiles; analyzers; buildtransitive 11 | all 12 | 13 | 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | all 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /code/generate-sharp/swhere/source-set-utilities.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.Generic; 6 | using Path = Opal.Path; 7 | 8 | namespace Soup.Build.Discover; 9 | 10 | public static class SourceSetUtilities 11 | { 12 | /// 13 | /// Add a new source path and cleanup sub folders 14 | /// 15 | public static void Add(HashSet sourceSet, Path value) 16 | { 17 | bool isIncluded = false; 18 | var current = value; 19 | while (true) 20 | { 21 | if (sourceSet.Contains(current)) 22 | { 23 | isIncluded = true; 24 | break; 25 | } 26 | 27 | var next = current.GetParent(); 28 | if (current == next) 29 | break; 30 | 31 | current = next; 32 | } 33 | 34 | if (!isIncluded) 35 | { 36 | // TODO: Remove already added values that this folder contains 37 | _ = sourceSet.Add(value); 38 | } 39 | } 40 | } -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/package-local-or-public-exact-reference-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Text.Json.Serialization; 6 | 7 | namespace Soup.Build.Api.Client; 8 | 9 | /// 10 | /// A class representing a local or public reference to an exact package. 11 | /// 12 | public class PackageLocalOrPublicExactReferenceModel 13 | { 14 | /// 15 | /// Gets or sets the local package id. 16 | /// 17 | [JsonPropertyName("localId")] 18 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 19 | public int? LocalId { get; set; } 20 | 21 | /// 22 | /// Gets or sets the public package reference. 23 | /// 24 | [JsonPropertyName("public")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 26 | public PackagePublicExactReferenceModel? Public { get; set; } 27 | } -------------------------------------------------------------------------------- /code/generate-sharp/utilities.unittests/soup.utilities.unittests.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net9.0 4 | false 5 | 6 | 7 | 8 | 9 | 10 | runtime; build; native; contentfiles; analyzers; buildtransitive 11 | all 12 | 13 | 14 | runtime; build; native; contentfiles; analyzers; buildtransitive 15 | all 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /code/client/core/tests/gen/operation-graph/operation-graph-writer-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunOperationGraphWriterTests; 6 | 7 | import :OperationGraphWriterTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunOperationGraphWriterTests() 11 | { 12 | auto className = "OperationGraphWriterTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "Serialize_Empty", [&testClass]() { testClass->Serialize_Empty(); }); 16 | state += Soup::Test::RunTest(className, "Serialize_SingleSimple", [&testClass]() { testClass->Serialize_SingleSimple(); }); 17 | state += Soup::Test::RunTest(className, "Serialize_SingleComplex", [&testClass]() { testClass->Serialize_SingleComplex(); }); 18 | state += Soup::Test::RunTest(className, "Serialize_Multiple", [&testClass]() { testClass->Serialize_Multiple(); }); 19 | 20 | return state; 21 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/value-table/value-table-manager-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunValueTableManagerTests; 6 | 7 | import :ValueTableManagerTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunValueTableManagerTests() 11 | { 12 | auto className = "ValueTableManagerTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "TryLoadFromFile_MissingFile", [&testClass]() { testClass->TryLoadFromFile_MissingFile(); }); 16 | state += Soup::Test::RunTest(className, "TryLoadFromFile_GarbageFile", [&testClass]() { testClass->TryLoadFromFile_GarbageFile(); }); 17 | state += Soup::Test::RunTest(className, "TryLoadFromFile_SimpleFile", [&testClass]() { testClass->TryLoadFromFile_SimpleFile(); }); 18 | state += Soup::Test::RunTest(className, "SaveState", [&testClass]() { testClass->SaveState(); }); 19 | 20 | return state; 21 | } -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/language-reference-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.ComponentModel.DataAnnotations; 6 | using System.Text.Json.Serialization; 7 | 8 | namespace Soup.Build.Api.Client; 9 | 10 | /// 11 | /// A class representing the language version reference. 12 | /// 13 | public class LanguageReferenceModel 14 | { 15 | /// 16 | /// Gets or sets the name. 17 | /// 18 | [JsonPropertyName("name")] 19 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 20 | [Required(AllowEmptyStrings = true)] 21 | public required string Name { get; set; } 22 | 23 | /// 24 | /// Gets or sets the version. 25 | /// 26 | [JsonPropertyName("version")] 27 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 28 | [Required] 29 | public SemanticVersionModel Version { get; set; } = new SemanticVersionModel(); 30 | } -------------------------------------------------------------------------------- /docs/cli/run.md: -------------------------------------------------------------------------------- 1 | # Run 2 | ## Overview 3 | Run a recipe that was previously built using the provided configuration parameters. 4 | ``` 5 | soup run [-flavor ] [-args etc.] 6 | ``` 7 | 8 | `path` - An optional parameter that directly follows the build command. If present this specifies the directory to look for a Recipe file to build. If not present then the command will use the current active directory. 9 | 10 | `-flavor ` - An optional parameter to specify the build flavor. Common values include `Debug` or `Release`. 11 | 12 | `-args` - An optional parameter signals that all of the following arguments are meant to be passed into the child executable. 13 | 14 | ## Examples 15 | Run a Recipe in the current directory for debug with default configurations. 16 | ``` 17 | soup run 18 | ``` 19 | 20 | Run a release Recipe in a different directory and pass in a single parameter to the child executable. 21 | ``` 22 | soup run ./Code/MyProject/ -flavor Release -args MyParameter 23 | ``` 24 | -------------------------------------------------------------------------------- /code/client/cli/source/options/restore-options.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "shared-options.h" 7 | 8 | namespace Soup::Client 9 | { 10 | /// 11 | /// Restore Command 12 | /// 13 | // TODO: [Verb("restore")] 14 | class RestoreOptions : public SharedOptions 15 | { 16 | public: 17 | /// 18 | /// Gets or sets the path to restore 19 | /// 20 | // [[Args::Option("path", Index = 0, HelpText = "Path to the package to restore.")]] 21 | std::string Path; 22 | 23 | /// 24 | /// Show the usage details for this command 25 | /// 26 | static void ShowUsage() 27 | { 28 | std::cout << std::endl; 29 | std::cout << "Usage: soup restore " << std::endl; 30 | std::cout << "\tpackage_file: Must be a zip file." << std::endl; 31 | } 32 | 33 | private: 34 | std::string _package; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/views/operation-graph-view.axaml.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia; 6 | using Avalonia.Controls; 7 | using Avalonia.Controls.Notifications; 8 | using Soup.View.ViewModels; 9 | 10 | namespace Soup.View.Views; 11 | 12 | /// 13 | /// The operation graph page that can be used on its own or navigated to within a Frame. 14 | /// 15 | public sealed partial class OperationGraphView : UserControl 16 | { 17 | public OperationGraphView() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) 23 | { 24 | base.OnAttachedToVisualTree(e); 25 | 26 | var dataContext = (ContentPaneViewModel?)this.DataContext; 27 | if (dataContext is not null) 28 | { 29 | dataContext.NotificationManager = new WindowNotificationManager(TopLevel.GetTopLevel(this)!); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/logger/scoped-trace-listener-register.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | using System.Diagnostics.CodeAnalysis; 7 | 8 | namespace Opal; 9 | 10 | /// 11 | /// A scoped trace listener registration helper. 12 | /// 13 | [SuppressMessage("Design", "CA1063:Implement IDisposable Correctly", Justification = "RAII disposable")] 14 | public class ScopedTraceListenerRegister : IDisposable 15 | { 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public ScopedTraceListenerRegister(TraceListener listener) 20 | { 21 | Log.RegisterListener(listener); 22 | } 23 | 24 | [SuppressMessage("Usage", "CA1816:Dispose methods should call SuppressFinalize", Justification = "RAII disposable")] 25 | public void Dispose() 26 | { 27 | Log.RegisterListener(null); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/utilities/view-locator.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia.Controls; 6 | using Avalonia.Controls.Templates; 7 | using Soup.View.ViewModels; 8 | using Soup.View.Views; 9 | using System; 10 | 11 | namespace Soup.View; 12 | 13 | public class ViewLocator : IDataTemplate 14 | { 15 | public Control Build(object? param) 16 | { 17 | return param switch 18 | { 19 | DependencyGraphViewModel => new DependencyGraphView(), 20 | PreprocessorTaskGraphViewModel => new PreprocessorTaskGraphView(), 21 | PreprocessorOperationGraphViewModel => new PreprocessorOperationGraphView(), 22 | OperationGraphViewModel => new OperationGraphView(), 23 | TaskGraphViewModel => new TaskGraphView(), 24 | _ => throw new InvalidOperationException("Failed to get the view type"), 25 | }; 26 | } 27 | 28 | public bool Match(object? data) 29 | { 30 | return data is ViewModelBase; 31 | } 32 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/operation-graph/operation-results-writer-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunOperationResultsWriterTests; 6 | 7 | import :OperationResultsWriterTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunOperationResultsWriterTests() 11 | { 12 | auto className = "OperationResultsWriterTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "Serialize_Empty", [&testClass]() { testClass->Serialize_Empty(); }); 16 | state += Soup::Test::RunTest(className, "Serialize_SingleSimple", [&testClass]() { testClass->Serialize_SingleSimple(); }); 17 | state += Soup::Test::RunTest(className, "Serialize_SingleComplex", [&testClass]() { testClass->Serialize_SingleComplex(); }); 18 | state += Soup::Test::RunTest(className, "Serialize_Multiple", [&testClass]() { testClass->Serialize_Multiple(); }); 19 | 20 | return state; 21 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/operation-graph/operation-graph-manager-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunOperationGraphManagerTests; 6 | 7 | import :OperationGraphManagerTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunOperationGraphManagerTests() 11 | { 12 | auto className = "OperationGraphManagerTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "TryLoadFromFile_MissingFile", [&testClass]() { testClass->TryLoadFromFile_MissingFile(); }); 16 | state += Soup::Test::RunTest(className, "TryLoadFromFile_GarbageFile", [&testClass]() { testClass->TryLoadFromFile_GarbageFile(); }); 17 | state += Soup::Test::RunTest(className, "TryLoadFromFile_SimpleFile", [&testClass]() { testClass->TryLoadFromFile_SimpleFile(); }); 18 | state += Soup::Test::RunTest(className, "SaveState", [&testClass]() { testClass->SaveState(); }); 19 | 20 | return state; 21 | } -------------------------------------------------------------------------------- /code/tools/mkdir/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | import Opal; 6 | 7 | void PrintUsage() 8 | { 9 | std::cout << "mkdir [path]" << std::endl; 10 | } 11 | 12 | int main(int argc, char** argv) 13 | { 14 | if (argc != 2) 15 | { 16 | PrintUsage(); 17 | return 1; 18 | } 19 | 20 | try 21 | { 22 | auto directory = Opal::Path::Parse(argv[1]); 23 | auto fileSystem = Opal::System::STLFileSystem(); 24 | 25 | if (fileSystem.Exists(directory)) 26 | { 27 | auto now = std::chrono::system_clock::now(); 28 | #ifdef _WIN32 29 | auto nowFileTime = std::chrono::clock_cast(now); 30 | #else 31 | auto nowFileTime = std::chrono::file_clock::from_sys(now); 32 | #endif 33 | fileSystem.SetLastWriteTime(directory, nowFileTime); 34 | } 35 | else 36 | { 37 | fileSystem.CreateDirectory(directory); 38 | } 39 | } 40 | catch(const std::exception& e) 41 | { 42 | std::cerr << e.what() << std::endl; 43 | return 2; 44 | } 45 | 46 | return 0; 47 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/local-user-config/local-user-config-extensions-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunLocalUserConfigExtensionsTests; 6 | 7 | import :LocalUserConfigExtensionsTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunLocalUserConfigExtensionsTests() 11 | { 12 | auto className = "LocalUserConfigExtensionsTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "TryLoadLocalUserConfigFromFile_MissingFile", [&testClass]() { testClass->TryLoadLocalUserConfigFromFile_MissingFile(); }); 16 | state += Soup::Test::RunTest(className, "TryLoadLocalUserConfigFromFile_GarbageFile", [&testClass]() { testClass->TryLoadLocalUserConfigFromFile_GarbageFile(); }); 17 | state += Soup::Test::RunTest(className, "TryLoadLocalUserConfigFromFile_SimpleFile", [&testClass]() { testClass->TryLoadLocalUserConfigFromFile_SimpleFile(); }); 18 | 19 | return state; 20 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/operation-graph/operation-results-manager-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunOperationResultsManagerTests; 6 | 7 | import :OperationResultsManagerTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunOperationResultsManagerTests() 11 | { 12 | auto className = "OperationResultsManagerTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "TryLoadFromFile_MissingFile", [&testClass]() { testClass->TryLoadFromFile_MissingFile(); }); 16 | state += Soup::Test::RunTest(className, "TryLoadFromFile_GarbageFile", [&testClass]() { testClass->TryLoadFromFile_GarbageFile(); }); 17 | state += Soup::Test::RunTest(className, "TryLoadFromFile_SimpleFile", [&testClass]() { testClass->TryLoadFromFile_SimpleFile(); }); 18 | state += Soup::Test::RunTest(className, "SaveState", [&testClass]() { testClass->SaveState(); }); 19 | 20 | return state; 21 | } -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/semantic-version.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Text.Json.Serialization; 6 | 7 | namespace Soup.Build.Api.Client; 8 | 9 | /// 10 | /// The semantic version class. 11 | /// 12 | public class SemanticVersion 13 | { 14 | /// 15 | /// Gets or sets the version major. 16 | /// 17 | [JsonPropertyName("major")] 18 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 19 | public int Major { get; set; } 20 | 21 | /// 22 | /// Gets or sets the version minor. 23 | /// 24 | [JsonPropertyName("minor")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 26 | public int? Minor { get; set; } 27 | 28 | /// 29 | /// Gets or sets the version patch. 30 | /// 31 | [JsonPropertyName("patch")] 32 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 33 | public int? Patch { get; set; } 34 | } -------------------------------------------------------------------------------- /code/generate/extension-task-details.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | 7 | namespace Soup::Core::Generate 8 | { 9 | class ExtensionTaskDetails 10 | { 11 | public: 12 | ExtensionTaskDetails( 13 | std::string name, 14 | Path scriptFile, 15 | std::optional bundlesFile, 16 | std::vector runBeforeList, 17 | std::vector runAfterList) : 18 | Name(std::move(name)), 19 | ScriptFile(std::move(scriptFile)), 20 | BundlesFile(std::move(bundlesFile)), 21 | RunBeforeList(std::move(runBeforeList)), 22 | RunAfterList(std::move(runAfterList)), 23 | RunAfterClosureList(), 24 | HasRun(false) 25 | { 26 | } 27 | 28 | std::string Name; 29 | Path ScriptFile; 30 | std::optional BundlesFile; 31 | std::vector RunBeforeList; 32 | std::vector RunAfterList; 33 | std::vector RunAfterClosureList; 34 | bool HasRun; 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /code/monitor/host/scoped-monitor-process-manager-register.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "imonitor-process-manager.h" 7 | 8 | namespace Monitor 9 | { 10 | /// 11 | /// A scoped process manager registration helper 12 | /// 13 | export class ScopedMonitorProcessManagerRegister 14 | { 15 | public: 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | ScopedMonitorProcessManagerRegister(std::shared_ptr listener) 20 | { 21 | IMonitorProcessManager::Register(std::move(listener)); 22 | } 23 | 24 | /// 25 | /// Finalizes an instance of the class. 26 | /// 27 | ~ScopedMonitorProcessManagerRegister() 28 | { 29 | IMonitorProcessManager::Register(nullptr); 30 | } 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /code/monitor/shared/windows/process-payload.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | export namespace Monitor::Windows 4 | { 5 | constexpr const char* TBLOG_PIPE_NAMEA = "\\\\.\\pipe\\monitor"; 6 | constexpr const wchar_t* TBLOG_PIPE_NAMEW = L"\\\\.\\pipe\\monitor"; 7 | #ifdef UNICODE 8 | constexpr const char* TBLOG_PIPE_NAME = TBLOG_PIPE_NAMEW; 9 | #else 10 | constexpr const char* TBLOG_PIPE_NAME = TBLOG_PIPE_NAMEA; 11 | #endif 12 | 13 | struct ProcessPayload 14 | { 15 | DWORD nParentProcessId; 16 | DWORD nTraceProcessId; 17 | DWORD nGeneology; 18 | DWORD rGeneology[64]; 19 | WCHAR wzParents[256]; 20 | CHAR zWorkingDirectory[256]; 21 | DWORD EnableAccessChecks; 22 | DWORD cReadAccessDirectories; 23 | CHAR zReadAccessDirectories[4096]; 24 | DWORD cWriteAccessDirectories; 25 | CHAR zWriteAccessDirectories[4096]; 26 | }; 27 | 28 | // Shared payload guid used to get/set the payload when creating the child process 29 | constexpr GUID ProcessPayloadResourceId = { 0xd8e2dc69, 0x3004, 0x453e, { 0x94, 0x15, 0x19, 0x0e, 0x79, 0xe8, 0x93, 0x52 } }; 30 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/recipe/recipe-extensions-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunRecipeExtensionsTests; 6 | 7 | import :RecipeExtensionsTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunRecipeExtensionsTests() 11 | { 12 | auto className = "RecipeExtensionsTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "TryLoadRecipeFromFile_MissingFile", [&testClass]() { testClass->TryLoadRecipeFromFile_MissingFile(); }); 16 | state += Soup::Test::RunTest(className, "TryLoadRecipeFromFile_GarbageFile", [&testClass]() { testClass->TryLoadRecipeFromFile_GarbageFile(); }); 17 | state += Soup::Test::RunTest(className, "TryLoadRecipeFromFile_SimpleFile", [&testClass]() { testClass->TryLoadRecipeFromFile_SimpleFile(); }); 18 | state += Soup::Test::RunTest(className, "SaveToFile_SimpleFile", [&testClass]() { testClass->SaveToFile_SimpleFile(); }); 19 | 20 | return state; 21 | } -------------------------------------------------------------------------------- /docs/developer-setup.md: -------------------------------------------------------------------------------- 1 | # Developer Setup 2 | 3 | ## Requirements 4 | 5 | ### Windows 6 | * Windows 11 7 | * Build Tools 8 | * [Visual Studio 2022](https://visualstudio.microsoft.com/downloads/) with "Desktop development with c++" workload. 9 | * OR 10 | * [Build Tools For Visual Studio 2022](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022) with "c++ build tools" workload. 11 | * [Latest Release](https://github.com/soup-build/soup/releases) 12 | 13 | ### Linux 14 | * Verified on Ubuntu 22.04.1 LTS WSL 15 | * Install GCC 12 16 | ``` 17 | sudo apt install g++-12 18 | ``` 19 | * Install .Net SDK 6.0 20 | ``` 21 | sudo apt install dotnet-sdk-6.0 22 | ``` 23 | * [Latest Release](https://github.com/soup-build/soup/releases) 24 | 25 | ## Setup 26 | Clone the repository and all submodules recursively. 27 | 28 | ``` 29 | git clone --recursive https://github.com/soup-build/soup.git 30 | ``` 31 | 32 | ## Build 33 | 34 | ### Build the Client 35 | ``` 36 | cd code/client/cli 37 | soup restore 38 | soup build 39 | ``` 40 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/views/graph-viewer-item.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 31 | -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/views/preprocessor-operation-graph-view.axaml.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using Avalonia; 6 | using Avalonia.Controls; 7 | using Avalonia.Controls.Notifications; 8 | using Soup.View.ViewModels; 9 | 10 | namespace Soup.View.Views; 11 | 12 | /// 13 | /// The operation graph page that can be used on its own or navigated to within a Frame. 14 | /// 15 | public sealed partial class PreprocessorOperationGraphView : UserControl 16 | { 17 | public PreprocessorOperationGraphView() 18 | { 19 | InitializeComponent(); 20 | } 21 | 22 | protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e) 23 | { 24 | base.OnAttachedToVisualTree(e); 25 | 26 | var dataContext = (ContentPaneViewModel?)this.DataContext; 27 | if (dataContext is not null) 28 | { 29 | dataContext.NotificationManager = new WindowNotificationManager(TopLevel.GetTopLevel(this)!); 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /docs/cli.md: -------------------------------------------------------------------------------- 1 | # Command Line Interface (CLI) 2 | Soup is at its core a command line application. The CLI is designed to be as clean and simple as possible while still allowing for easy execution of common build related tasks. 3 | 4 | ``` 5 | soup [arguments] 6 | ``` 7 | 8 | * [Build](cli/build.md) - Perform a build with a specified root Package. 9 | 10 | * [Init](cli/init.md) - Initialize a new Package with default properties. 11 | 12 | * [Install](cli/install.md) - Install a new dependency for a specified Package. 13 | 14 | * [Publish](cli/publish.md) - Publish a given package to the public feed. 15 | 16 | * [Restore](cli/restore.md) - Restore all external package references in the target project closure. 17 | 18 | * [Run](cli/run.md) - Invoke the executable result (if applicable) for a specified package. 19 | 20 | * [Target](cli/target.md) - Prints the target directory for a specified package. 21 | 22 | * [Version](cli/version.md) - Print the version of the current installed Soup application. 23 | 24 | * [View](cli/view.md) - Launch the Soup View tool. -------------------------------------------------------------------------------- /code/client/core/tests/gen/build/build-engine-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunBuildEngineTests; 6 | 7 | import :BuildEngineTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunBuildEngineTests() 11 | { 12 | auto className = "BuildEngineTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "Execute_NoDependencies", [&testClass]() { testClass->Execute_NoDependencies(); }); 16 | state += Soup::Test::RunTest(className, "Execute_NoDependencies_UpToDate", [&testClass]() { testClass->Execute_NoDependencies_UpToDate(); }); 17 | state += Soup::Test::RunTest(className, "Execute_NoDependencies_HasPreprocessors", [&testClass]() { testClass->Execute_NoDependencies_HasPreprocessors(); }); 18 | state += Soup::Test::RunTest(className, "Execute_NoDependencies_HasPreprocessors_UpToDate", [&testClass]() { testClass->Execute_NoDependencies_HasPreprocessors_UpToDate(); }); 19 | 20 | return state; 21 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/logger/i-event-filter.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | 7 | namespace Opal; 8 | 9 | [Flags] 10 | public enum TraceEvents 11 | { 12 | /// 13 | /// None. 14 | /// 15 | None = 0, 16 | 17 | /// 18 | /// High Priority message. 19 | /// 20 | HighPriority = 1 << 0, 21 | 22 | /// 23 | /// Informational message. 24 | /// 25 | Information = 1 << 1, 26 | 27 | /// 28 | /// Diagnostic trace. 29 | /// 30 | Diagnostic = 1 << 2, 31 | 32 | /// 33 | /// Noncritical problem. 34 | /// 35 | Warning = 1 << 3, 36 | 37 | /// 38 | /// Recoverable error. 39 | /// 40 | Error = 1 << 4, 41 | 42 | /// 43 | /// Fatal error or application crash. 44 | /// 45 | Critical = 1 << 5, 46 | } 47 | 48 | public interface IEventFilter 49 | { 50 | bool ShouldTrace(TraceEvents eventType); 51 | } 52 | -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/semantic-version-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Text.Json.Serialization; 6 | 7 | namespace Soup.Build.Api.Client; 8 | 9 | /// 10 | /// A class representing the semantic version model 11 | /// 12 | public class SemanticVersionModel 13 | { 14 | /// 15 | /// Gets or sets the version major. 16 | /// 17 | [JsonPropertyName("major")] 18 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 19 | public int Major { get; set; } 20 | 21 | /// 22 | /// Gets or sets the version minor. 23 | /// 24 | [JsonPropertyName("minor")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 26 | public int? Minor { get; set; } 27 | 28 | /// 29 | /// Gets or sets the version patch. 30 | /// 31 | [JsonPropertyName("patch")] 32 | [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] 33 | public int? Patch { get; set; } 34 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/logger/test-trace-listener.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Collections.Generic; 6 | 7 | namespace Opal; 8 | 9 | /// 10 | /// Test logger that wraps the base . 11 | /// 12 | public class TestTraceListener : TraceListener 13 | { 14 | private readonly List messages; 15 | 16 | /// 17 | /// Initializes a new instance of the class. 18 | /// 19 | public TestTraceListener() 20 | : base(null, true, false) 21 | { 22 | this.messages = []; 23 | } 24 | 25 | /// 26 | /// Get the messages. 27 | /// 28 | public IReadOnlyList Messages => this.messages; 29 | 30 | /// 31 | /// Writes a message and newline terminator. 32 | /// 33 | /// The message. 34 | protected override void WriteLine(string message) 35 | { 36 | this.messages.Add(message); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /code/generate-sharp/api.client/models/semantic-version-exact-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Text.Json.Serialization; 6 | 7 | namespace Soup.Build.Api.Client; 8 | 9 | /// 10 | /// A class representing the semantic version fully qualified model 11 | /// 12 | public class SemanticVersionExactModel 13 | { 14 | /// 15 | /// Gets or sets the version major. 16 | /// 17 | [JsonPropertyName("major")] 18 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 19 | public int Major { get; set; } 20 | 21 | /// 22 | /// Gets or sets the version minor. 23 | /// 24 | [JsonPropertyName("minor")] 25 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 26 | public int Minor { get; set; } 27 | 28 | /// 29 | /// Gets or sets the version patch. 30 | /// 31 | [JsonPropertyName("patch")] 32 | [JsonIgnore(Condition = JsonIgnoreCondition.Never)] 33 | public int Patch { get; set; } 34 | } -------------------------------------------------------------------------------- /code/monitor/client/Helpers.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | bool EndsWithIgnoreCase(std::wstring_view lhs, std::wstring_view value) 4 | { 5 | auto lhsLength = lhs.size(); 6 | auto valueLength = value.size(); 7 | if (lhsLength < valueLength) 8 | return false; 9 | 10 | auto offset = lhsLength - valueLength; 11 | auto lhsEnd = lhs.substr(offset, valueLength); 12 | return std::equal( 13 | lhsEnd.begin(), 14 | lhsEnd.end(), 15 | value.begin(), 16 | value.end(), 17 | [](wchar_t a, wchar_t b) 18 | { 19 | return std::tolower(a) == std::tolower(b); 20 | }); 21 | } 22 | 23 | bool EndsWithIgnoreCase(std::string_view lhs, std::string_view value) 24 | { 25 | auto lhsLength = lhs.size(); 26 | auto valueLength = value.size(); 27 | if (lhsLength < valueLength) 28 | return false; 29 | 30 | auto offset = lhsLength - valueLength; 31 | auto lhsEnd = lhs.substr(offset, valueLength); 32 | return std::equal( 33 | lhsEnd.begin(), 34 | lhsEnd.end(), 35 | value.begin(), 36 | value.end(), 37 | [](char a, char b) 38 | { 39 | return std::tolower(a) == std::tolower(b); 40 | }); 41 | } 42 | -------------------------------------------------------------------------------- /code/client/cli/source/commands/version-command.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | #pragma once 6 | #include "i-command.h" 7 | #include "version-options.h" 8 | 9 | namespace Soup::Client 10 | { 11 | /// 12 | /// Version Command 13 | /// 14 | class VersionCommand : public ICommand 15 | { 16 | public: 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | VersionCommand(VersionOptions options) : 21 | _options(std::move(options)) 22 | { 23 | } 24 | 25 | /// 26 | /// Main entry point for a unique command 27 | /// 28 | virtual void Run() override final 29 | { 30 | Log::Diag("VersionsCommand::Run"); 31 | 32 | // TODO var version = Assembly.GetExecutingAssembly().GetName().Version; 33 | // Log::Message($"{version.Major}.{version.Minor}.{version.Build}"); 34 | Log::HighPriority("0.42.7"); 35 | } 36 | 37 | private: 38 | VersionOptions _options; 39 | }; 40 | } 41 | -------------------------------------------------------------------------------- /code/client/core/source/utilities/handled-exception.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | module; 6 | 7 | #include 8 | 9 | export module Soup.Core:HandledException; 10 | 11 | namespace Soup::Core 12 | { 13 | /// 14 | /// A special exception overload that indicates an early exit for the application that was handled 15 | /// 16 | export class HandledException : public std::exception 17 | { 18 | public: 19 | /// 20 | /// Initialize a new instance of the HandledException class 21 | /// 22 | HandledException(int exitCode) : 23 | std::exception(), 24 | m_exitCode(exitCode) 25 | { 26 | } 27 | 28 | HandledException(const HandledException& other) : 29 | std::exception(), 30 | m_exitCode(other.m_exitCode) 31 | { 32 | } 33 | 34 | virtual ~HandledException() noexcept 35 | { 36 | } 37 | 38 | int GetExitCode() const 39 | { 40 | return m_exitCode; 41 | } 42 | 43 | private: 44 | int m_exitCode; 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /code/client/core/tests/local-user-config/local-user-config-tests.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | module; 6 | 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | export module Soup.Core.Tests:LocalUserConfigTests; 15 | 16 | import Monitor.Host; 17 | import Opal; 18 | import Soup.Core; 19 | import Soup.Test.Assert; 20 | 21 | using namespace Opal; 22 | using namespace Opal::System; 23 | using namespace Soup::Test; 24 | 25 | namespace Soup::Core::UnitTests 26 | { 27 | export class LocalUserConfigTests 28 | { 29 | public: 30 | // [[Fact]] 31 | void InitializerDefault() 32 | { 33 | auto uut = LocalUserConfig(); 34 | 35 | Assert::IsFalse(uut.HasSDKs(), "Verify has no SDKs."); 36 | } 37 | 38 | // [[Fact]] 39 | void OperatorEqualDefault() 40 | { 41 | auto uut = LocalUserConfig(); 42 | 43 | Assert::AreEqual(LocalUserConfig(), uut, "Verify equal."); 44 | } 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /docs/architecture/parameters-table.md: -------------------------------------------------------------------------------- 1 | # Parameters Table 2 | 3 | The Parameters table contains the generated parameters from the application along with the overridden properties passed into the CLI arguments. 4 | 5 | ## Known Keys 6 | 7 | ### "PackageDirectory" 8 | The absolute path to the active package that is getting build. 9 | 10 | ### "TargetDirectory" 11 | The absolute path to the output target folder. This is the only location that is allowed to be written to during build evaluation. 12 | 13 | ### "Dependencies" 14 | The table of direct dependency references containing the same information that is provided by the Application for the current package. 15 | "Reference" and "TargetDirectory". 16 | 17 | ### "SDKs" 18 | The SDKs table that comes from the global user config. 19 | 20 | ### "Architecture" 21 | The known parameter for the architecture (x64, ARM, etc) 22 | 23 | ### "Compiler" 24 | The known parameter for the compiler. 25 | 26 | ### "Flavor" 27 | The known parameter for the flavor (Release, Debug, etc). 28 | 29 | ### "System" 30 | The known parameter for the system (Windows, Linux, etc). 31 | -------------------------------------------------------------------------------- /code/client/core/source/build/ievaluate-engine.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | module; 6 | 7 | #include 8 | 9 | export module Soup.Core:IEvaluateEngine; 10 | 11 | import Opal; 12 | import :OperationGraph; 13 | import :OperationResults; 14 | 15 | using namespace Opal; 16 | 17 | namespace Soup::Core 18 | { 19 | /// 20 | /// The core build evaluation interface that knows how to perform a build from a provided Operation Graph. 21 | /// 22 | export class IEvaluateEngine 23 | { 24 | public: 25 | /// 26 | /// Execute the entire operation graph that is referenced by this build evaluate engine 27 | /// Returns true if any of the operations were evaluated 28 | /// 29 | virtual bool Evaluate( 30 | const OperationGraph& operationGraph, 31 | OperationResults& operationResults, 32 | const Path& temporaryDirectory, 33 | const std::vector& globalAllowedReadAccess, 34 | const std::vector& globalAllowedWriteAccess) = 0; 35 | }; 36 | } -------------------------------------------------------------------------------- /code/client/core/tests/gen/package/package-manager-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunPackageManagerTests; 6 | 7 | import :PackageManagerTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunPackageManagerTests() 11 | { 12 | auto className = "PackageManagerTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "RestorePackages", [&testClass]() { testClass->RestorePackages(); }); 16 | state += Soup::Test::RunTest(className, "InitializePackage", [&testClass]() { testClass->InitializePackage(); }); 17 | state += Soup::Test::RunTest(className, "InstallPackageReference_Version", [&testClass]() { testClass->InstallPackageReference_Version(); }); 18 | state += Soup::Test::RunTest(className, "InstallPackageReference_NoVersion", [&testClass]() { testClass->InstallPackageReference_NoVersion(); }); 19 | state += Soup::Test::RunTest(className, "PublishPackage", [&testClass]() { testClass->PublishPackage(); }); 20 | 21 | return state; 22 | } -------------------------------------------------------------------------------- /code/generate-sharp/soup-view/view-models/value-table-item-view-model.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using ReactiveUI; 6 | using System.Collections.ObjectModel; 7 | 8 | namespace Soup.View.ViewModels; 9 | 10 | public enum ValueTableItemType 11 | { 12 | Table, 13 | List, 14 | Value, 15 | }; 16 | 17 | public class ValueTableItemViewModel : ViewModelBase 18 | { 19 | public string Title { get; set; } 20 | 21 | public ValueTableItemType Type { get; set; } 22 | public ObservableCollection Children { get; init; } = []; 23 | 24 | private bool isExpanded; 25 | public bool IsExpanded 26 | { 27 | get => this.isExpanded; 28 | set => this.RaiseAndSetIfChanged(ref this.isExpanded, value); 29 | } 30 | 31 | private bool isSelected; 32 | public bool IsSelected 33 | { 34 | get => this.isSelected; 35 | set => this.RaiseAndSetIfChanged(ref this.isSelected, value); 36 | } 37 | 38 | public ValueTableItemViewModel(string title) 39 | { 40 | this.Title = title; 41 | } 42 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/runtime-process-manager.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System; 6 | 7 | namespace Opal.System; 8 | 9 | /// 10 | /// A windows platform specific process executable using system 11 | /// 12 | public class RuntimeProcessManager : IProcessManager 13 | { 14 | /// 15 | /// Initializes a new instance of the class. 16 | /// 17 | public RuntimeProcessManager() 18 | { 19 | } 20 | 21 | /// 22 | /// Gets the current process file name 23 | /// 24 | public Path GetCurrentProcessFileName() 25 | { 26 | return new Path(AppContext.BaseDirectory); 27 | } 28 | 29 | /// 30 | /// Creates a process for the provided executable path 31 | /// 32 | public IProcess CreateProcess( 33 | string executable, 34 | string arguments, 35 | Path workingDirectory) 36 | { 37 | return new RuntimeProcess( 38 | executable, 39 | arguments, 40 | workingDirectory); 41 | } 42 | } -------------------------------------------------------------------------------- /code/generate-sharp/opal/system/i-library.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Soup. All rights reserved. 3 | // 4 | 5 | using System.Diagnostics.CodeAnalysis; 6 | 7 | namespace Opal.System; 8 | 9 | /// 10 | /// The library interface 11 | /// Interface mainly used to allow for unit testing client code. 12 | /// 13 | [SuppressMessage("Design", "CA1040:Avoid empty interfaces", Justification = "TODO")] 14 | public interface ILibrary 15 | { 16 | ///// 17 | ///// Get a function by name and casted to the requested type 18 | ///// 19 | //// void* GetFunction(std::string_view name) = 0; 20 | 21 | ///// 22 | ///// Get a function by name and casted to the requested type 23 | ///// 24 | ////template 25 | ////T GetFunction(std::string_view name) 26 | ////{ 27 | //// auto typeProcessAddress = (T)GetFunction(name); 28 | 29 | //// // Verify the type matches 30 | //// if (typeProcessAddress == nullptr) 31 | //// throw "Failed to cast finction address."; 32 | 33 | //// return typeProcessAddress; 34 | ////} 35 | } 36 | -------------------------------------------------------------------------------- /code/client/core/tests/gen/operation-graph/operation-results-tests.gen.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #include 4 | 5 | export module Soup.Core.Tests:RunOperationResultsTests; 6 | 7 | import :OperationResultsTests; 8 | import Soup.Test.Assert; 9 | 10 | export TestState RunOperationResultsTests() 11 | { 12 | auto className = "OperationResultsTests"; 13 | auto testClass = std::make_shared(); 14 | TestState state = { 0, 0 }; 15 | state += Soup::Test::RunTest(className, "Initialize_Default", [&testClass]() { testClass->Initialize_Default(); }); 16 | state += Soup::Test::RunTest(className, "Initialize_ListOperations_Single", [&testClass]() { testClass->Initialize_ListOperations_Single(); }); 17 | state += Soup::Test::RunTest(className, "TryFindResult_Missing", [&testClass]() { testClass->TryFindResult_Missing(); }); 18 | state += Soup::Test::RunTest(className, "TryFindResult_Found", [&testClass]() { testClass->TryFindResult_Found(); }); 19 | state += Soup::Test::RunTest(className, "AddOrUpdateOperationResult", [&testClass]() { testClass->AddOrUpdateOperationResult(); }); 20 | 21 | return state; 22 | } -------------------------------------------------------------------------------- /code/monitor/shared/module.cpp: -------------------------------------------------------------------------------- 1 | module; 2 | 3 | #ifdef _WIN32 4 | 5 | #include 6 | 7 | #ifdef CreateProcess 8 | #undef CreateProcess 9 | #endif 10 | 11 | #pragma warning(push) 12 | #if _MSC_VER > 1400 13 | #pragma warning(disable:6102 6103) 14 | #endif 15 | #include 16 | #pragma warning(pop) 17 | 18 | #endif 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | export module Monitor.Shared; 36 | 37 | #ifdef _WIN32 38 | 39 | #include "windows/detour-event-type.h" 40 | #include "windows/process-payload.h" 41 | 42 | export void ThrowIfFailed(int32_t result, std::string_view message) 43 | { 44 | if (result != NO_ERROR) 45 | { 46 | throw std::runtime_error(message.data()); 47 | } 48 | } 49 | 50 | #elif defined(__linux__) 51 | 52 | #include "linux/detour-event-type.h" 53 | 54 | #endif 55 | 56 | #include "message.h" -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Matthew Asplund 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /code/client/cli/tests/gen/test-main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | import Opal; 5 | import Soup.Core; 6 | import Soup.Test.Assert; 7 | 8 | using namespace Opal; 9 | using namespace Soup::Test; 10 | 11 | #include "commands/build-command-tests.gen.h" 12 | #include "commands/initialize-command-tests.gen.h" 13 | #include "commands/install-command-tests.gen.h" 14 | #include "commands/publish-command-tests.gen.h" 15 | #include "commands/version-command-tests.gen.h" 16 | 17 | int main() 18 | { 19 | std::cout << "Running Tests..." << std::endl; 20 | 21 | TestState state = { 0, 0 }; 22 | 23 | state += RunBuildCommandTests(); 24 | state += RunInitializeCommandTests(); 25 | state += RunPublishCommandTests(); 26 | state += RunVersionCommandTests(); 27 | 28 | // Touch stamp file to ensure incremental builds work 29 | // auto testFile = std::fstream("TestHarness.stamp", std::fstream::out); 30 | // testFile << "TOUCH"; 31 | 32 | std::cout << state.PassCount << " PASSED." << std::endl; 33 | std::cout << state.FailCount << " FAILED." << std::endl; 34 | 35 | if (state.FailCount > 0) 36 | return 1; 37 | else 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /code/monitor/client/main.cpp: -------------------------------------------------------------------------------- 1 | 2 | // TODO: Warning unsafe method 3 | #define _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef _WIN32 17 | 18 | #include 19 | #include 20 | 21 | #ifdef CreateProcess 22 | #undef CreateProcess 23 | #endif 24 | 25 | #include 26 | #include 27 | 28 | #define DllExport __declspec(dllexport) 29 | 30 | #elif defined(__linux__) 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #endif 38 | 39 | import Opal; 40 | import Monitor.Shared; 41 | 42 | #ifdef _WIN32 43 | 44 | import Detours; 45 | 46 | #include "windows/connection-manager.h" 47 | #include "message-sender.h" 48 | #include "windows/dll-main.h" 49 | 50 | #elif defined(__linux__) 51 | 52 | #include "linux/connection-manager.h" 53 | #include "message-sender.h" 54 | #include "linux/startup.h" 55 | 56 | #endif --------------------------------------------------------------------------------