Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Covert to new SML Recipe language #133

Merged
merged 24 commits into from
Sep 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,7 @@ obj/

# Wix
msi/
wix/
wix/

# Antlr
.antlr/
4 changes: 2 additions & 2 deletions Docs/Architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ There are four ways to declare the state for an invocation of a build. Through t
The [Command Line Interface (CLI)](CLI.md) is the first thing a user will see when they interact with the Soup build system. The CLI is primarily there to take user input through a set of parameters and flags to pass temporary configuration values into the build execution. The command parameters will be used to generate a unique output folder for the given build to allow for individual builds to coexist for the same package (i.e. Release vs Debug). The argument properties will be combined with a set of generated properties from the application that are passed into the next phase of the build through a [Parameters Table](Architecture/Parameters-Table.md).

### Recipe
The build definition will use a declarative **Recipe** configuration file is how the user will configure their project. The Recipe file will utilize the [toml](https://github.com/toml-lang/toml) language (and possibly a custom config language in the future) as a clean, human readable, configuration definition that supports a core set of data types. The file can be thought of as a simple property bag for setting shared parameters into the build system for an individual package.
The build definition will use a declarative **Recipe** configuration file is how the user will configure their project. The Recipe file will utilize the SML (Simple Markup Language) language (and possibly a custom config language in the future) as a clean, human readable, configuration definition that supports a core set of data types. The file can be thought of as a simple property bag for setting shared parameters into the build system for an individual package.

There are a few "known" property values that will be used within the build engine itself; however, the entire contents will be provided as initial input to the build engine.

Expand Down Expand Up @@ -43,7 +43,7 @@ This work can be broken down into five phases:
* Default parameters are set for "Build" dependencies. This allows the build runtime to be different from the target of the build itself (ie. building for Debug/Linux, while using Release/Windows.) Generate unique output folder for this build configuration.

1. **Parse Declaration**
* The Recipe toml file is read from disk and parsed into a property bag.
* The Recipe SML file is read from disk and parsed into a property bag.
* Search for a Root Recipe file, and read from disk if present. Update the output directory if specified.

1. **Build Dependencies** -
Expand Down
21 changes: 11 additions & 10 deletions Docs/Architecture/Recipe.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,37 @@
# Recipe

The Recipe file is the definition for a code package and will always be located at the root of the package directory structure. It is written in the [TOML](https://toml.io/en/) declarative language. (Note: TOML is not perfect and there is an open item to investigate other options).
The Recipe file is the definition for a code package and will always be located at the root of the package directory structure. It is written in the SML (Simple Markup Language) declarative language. (Note: Adopted as a variation on TOML, still iterating on design).

## Shared Properties

### Name
The **Name** property is required for all packages. It consists of a string value for the unique package name. Note: Unique here is within a build context. When local this is set of packages within a single language dependency graph. When published this is globally unique for a language.
```
Name = "MyAwesomePackage"
Name: "MyAwesomePackage"
```

### Language
The **Language** property is required for all packages. It consists of a string value that contains the language type and minimum build version. This language tells Soup what default [Build Tasks](Build-Task.md) to inject into the build.
```
Language = "C#|0.1"
Language: "C#|0.1"
```

### Version
The **Version** property is required for all published packages. It consists of a string value that contains the semantic version of the package.
```
Version = "1.0.0"
Version: "1.0.0"
```

### Dependencies
The **Dependencies** property is a table of different dependency types that each consist of a list of dependency values. A dependency value can either be a string value with a [Package Reference](Package-Reference.md) or a table with a required **Reference** property that contains the Package Reference. The runtime will recursively build the dependencies and inject shared properties and allow read access for builds.
```
[Dependencies]
Runtime = [
"../MyOtherPackage/",
"CoolPublicPackage@1.0.1",
{ Reference = "AnotherCoolPublicPackage@2.0.1" },
]
Dependencies: {
Runtime: [
"../MyOtherPackage/",
"CoolPublicPackage@1.0.1",
{ Reference: "AnotherCoolPublicPackage@2.0.1" },
]
}
```

#### Build Dependencies
Expand Down
2 changes: 1 addition & 1 deletion Docs/Create-Release.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Create Release

## Bump Client version
Ensure that the client build number is updated in recipe.toml, VersionCommand.h and in the Script.cs.
Ensure that the client build number is updated in Recipe.sml, VersionCommand.h and in the Script.cs.

Create a PR with this change.

Expand Down
44 changes: 23 additions & 21 deletions Docs/Samples/CSharp/Build-Extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,23 @@ This is a console application that has a custom build extension that alters the

[Source](https://github.com/SoupBuild/Soup/tree/main/Samples/CSharp/BuildExtension)

## Extension/Recipe.toml
## Extension/Recipe.sml
The Recipe file that defines the build extension dynamic library "Samples.BuildExtension.Extension" that will register new build tasks.
```
Name = "Samples.CSharp.BuildExtension.Extension"
Language = "C#|0.1"
Version = "1.0.0"
Source = [
Name: "Samples.CSharp.BuildExtension.Extension"
Language: "C#|0.1"
Version: "1.0.0"
Source: [
"CustomBuildTask.cs"
]

[Dependencies]
Runtime = [
{ Reference = "Soup.Build@0.1.4", ExcludeRuntime = true },
{ Reference = "Soup.Build.Extensions@0.2.0" },
{ Reference = "Opal@1.0.3" },
]
Dependencies: {
Runtime: [
{ Reference = "Soup.Build@0.2.0", ExcludeRuntime = true },
{ Reference = "Soup.Build.Extensions@0.3.0" },
{ Reference = "Opal@1.1.0" },
]
}
```

## Extension/CustomBuildTask.cs
Expand Down Expand Up @@ -78,21 +79,22 @@ namespace Samples.CSharp.BuildExtension.Extension
}
```

## Executable/Recipe.toml
## Executable/Recipe.sml
The Recipe file that defines the executable "BuildExtension.Executable". The one interesting part is the relative path reference to the custom build extension through "Build" Dependencies.
```
Name = "Samples.CSharp.BuildExtension.Executable"
Language = "C#|0.1"
Type = "Executable"
Version = "1.0.1"
Source = [
Name: "Samples.CSharp.BuildExtension.Executable"
Language: "C#|0.1"
Type: "Executable"
Version: "1.0.1"
Source: [
"Program.cs"
]

[Dependencies]
Build = [
"../Extension/"
]
Dependencies: {
Build: [
"../Extension/"
]
}
```

## Executable/Program.cs
Expand Down
12 changes: 6 additions & 6 deletions Docs/Samples/CSharp/Console-Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ This is a console application with the minimal amount of code to get up and runn

[Source](https://github.com/SoupBuild/Soup/tree/main/Samples/CSharp/ConsoleApplication)

## Recipe.toml
## Recipe.sml
The Recipe file that defines the static library ""Samples.CSharp.ConsoleApplication".
```
Name = "Samples.CSharp.ConsoleApplication"
Language = "C#|0.1"
Type = "Executable"
Version = "1.1.4"
Source = [
Name: "Samples.CSharp.ConsoleApplication"
Language: "C#|0.1"
Type: "Executable"
Version: "1.1.4"
Source: [
"Program.cs",
]
```
Expand Down
37 changes: 19 additions & 18 deletions Docs/Samples/Cpp/Build-Extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ This is a console application that has a custom build extension that alters the

[Source](https://github.com/SoupBuild/Soup/tree/main/Samples/Cpp/BuildExtension)

## Extension/Recipe.toml
## Extension/Recipe.sml
The Recipe file that defines the build extension dynamic library "Samples.Cpp.BuildExtension.Extension" that will register new build tasks.
```
Name = "Samples.Cpp.BuildExtension.Extension"
Language = "C#|0.1"
Version = "1.0.0"
Source = [
Name: "Samples.Cpp.BuildExtension.Extension"
Language: "C#|0.1"
Version: "1.0.0"
Source: [
"CustomBuildTask.cs"
]

[Dependencies]
Runtime = [
{ Reference = "Soup.Build@0.1.4", ExcludeRuntime = true },
{ Reference = "Soup.Build.Extensions@0.2.0" },
{ Reference = "Opal@1.0.3" },
{ Reference = "Soup.Build@0.2.0", ExcludeRuntime = true },
{ Reference = "Soup.Build.Extensions@0.3.0" },
{ Reference = "Opal@1.1.0" },
]
```

Expand Down Expand Up @@ -78,21 +78,22 @@ namespace Samples.Cpp.BuildExtension.Extension
}
```

## Executable/Recipe.toml
## Executable/Recipe.sml
The Recipe file that defines the executable "Samples.Cpp.BuildExtension.Executable". The one interesting part is the relative path reference to the custom build extension through "Build" Dependencies.
```
Name = "Samples.Cpp.BuildExtension.Executable"
Language = "C++|0.1"
Type = "Executable"
Version = "1.0.1"
Source = [
Name: "Samples.Cpp.BuildExtension.Executable"
Language: "C++|0.1"
Type: "Executable"
Version: "1.0.1"
Source: [
"Main.cpp"
]

[Dependencies]
Build = [
"../Extension/"
]
Dependencies: {
Build: [
"../Extension/"
]
}

```

Expand Down
4 changes: 2 additions & 2 deletions Docs/Samples/Cpp/Console-Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ This is the smallest amount of code to get a console application building using

[Source](https://github.com/SoupBuild/Soup/tree/main/Samples/Cpp/ConsoleApplication)

## Recipe.toml
## Recipe.sml
The Recipe file that sets the name, type, version and the single source file.
```
Name = "Samples.Cpp.ConsoleApplication"
Name: "Samples.Cpp.ConsoleApplication"
Language = "C++|0.1"
Type = "Executable"
Version = "1.1.3"
Expand Down
31 changes: 16 additions & 15 deletions Docs/Samples/Cpp/Dynamic-Library.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ This is a console application that has a single dynamic library dependency.

[Source](https://github.com/SoupBuild/Soup/tree/main/Samples/Cpp/DynamicLibrary)

## Library/Recipe.toml
## Library/Recipe.sml
The Recipe file that defines the static library "Samples.Cpp.DynamicLibrary.Library".
```
Name = "Samples.Cpp.DynamicLibrary.Library"
Language = "C++|0.1"
Version = "1.0.0"
Interface = "Module.cpp"
Name: "Samples.Cpp.DynamicLibrary.Library"
Language: "C++|0.1"
Version: "1.0.0"
Interface: "Module.cpp"
```

## Library/Module.cpp
Expand All @@ -36,21 +36,22 @@ export namespace Samples.Cpp.DynamicLibrary.Library
}
```

## Application/Recipe.toml
## Application/Recipe.sml
The Recipe file that defines the executable "Samples.Cpp.DynamicLibrary.Application".
```
Name = "Samples.Cpp.DynamicLibrary.Application"
Language = "C++|0.1"
Type = "Executable"
Version = "1.0.0"
Source = [
Name: "Samples.Cpp.DynamicLibrary.Application"
Language: "C++|0.1"
Type: "Executable"
Version: "1.0.0"
Source: [
"Main.cpp"
]

[Dependencies]
Runtime = [
"../Library/"
]
Dependencies: {
Runtime: [
"../Library/"
]
}
```

## Application/Main.cpp
Expand Down
14 changes: 7 additions & 7 deletions Docs/Samples/Cpp/Module-Interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ A console application that uses a single module interface file used inside the s

[Source](https://github.com/SoupBuild/Soup/tree/main/Samples/Cpp/ModuleInterface)

## Recipe.toml
## Recipe.sml
The Recipe file that sets the name, type, version, the public interface module and the single source file.
```
Name = "Samples.Cpp.ModuleInterface"
Language = "C++|0.1"
Type = "Executable"
Version = "1.2.5"
Interface = "Module.cpp"
Source = [
Name: "Samples.Cpp.ModuleInterface"
Language: "C++|0.1"
Type: "Executable"
Version: "1.2.5"
Interface: "Module.cpp"
Source: [
"Main.cpp"
]
```
Expand Down
21 changes: 11 additions & 10 deletions Docs/Samples/Cpp/Parse-Json-File.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@ A console application that reads in a json file using the an external module and

[Source](https://github.com/SoupBuild/Soup/tree/main/Samples/Cpp/ParseJsonFile)

## Recipe.toml
## Recipe.sml
The Recipe file that sets the standard name, type, version, as well as the single external dependency of the [json11](https://github.com/dropbox/json11) project.
```
Name = "Samples.Cpp.ParseJsonFile"
Language = "C++|0.1"
Version = "1.0.0"
Type = "Executable"
Source = [
Name: "Samples.Cpp.ParseJsonFile"
Language: "C++|0.1"
Version: "1.0.0"
Type: "Executable"
Source: [
"Main.cpp",
]

[Dependencies]
Runtime = [
"json11@1.0.2",
]
Dependencies: {
Runtime: [
"json11@1.0.2",
]
}
```

## Message.json
Expand Down
Loading