Skip to content

Commit

Permalink
Mwasplund/buildorder (#35)
Browse files Browse the repository at this point in the history
* Switch to using packages for toml and json

* Move opal out

* Switch to public hosted opal

* Switch to public definitions

* Switch to public wrapper

* Move Build projects around

* Add run before/after lists

* Cleanup project heirarchy

* Fix up tests

* Log out run before/after lists

* Update some spacing issues and capture tasks in a map

* Add build order checks

* Add fiddler to preprocessor definition

* Check for forbidden user

* Break the samples into sub folder

Co-authored-by: Matthew Asplund <[email protected]>
  • Loading branch information
mwasplund and Matthew Asplund authored May 10, 2020
1 parent b1bbc3f commit 94cf2d2
Show file tree
Hide file tree
Showing 325 changed files with 2,240 additions and 6,960 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,6 @@
[submodule "Dependencies/openssl"]
path = Dependencies/openssl
url = https://github.com/openssl/openssl.git
[submodule "Dependencies/Opal"]
path = Dependencies/Opal
url = https://github.com/mwasplund/Opal.git
1 change: 1 addition & 0 deletions Dependencies/Opal
Submodule Opal added at 659736
2 changes: 1 addition & 1 deletion Dependencies/cpp-httplib
Submodule cpp-httplib updated 1 files
+3 −3 httplib.h
156 changes: 3 additions & 153 deletions Docs/Samples.md
Original file line number Diff line number Diff line change
@@ -1,161 +1,11 @@
# Samples
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.

## Simple Console Application

## [Simple Console Application](Samples/SimpleConsoleApplication)
This is the smallest amount of code to get a console application building using Soup.

### Recipe.toml
The Recipe file that sets the name, type, version and the single source file.
```
Name = "SimpleConsoleApplication"
Type = "Executable"
Version = "1.1.3"
Source = [
"Main.cpp"
]
```

### Main.cpp
A simple main method that prints our "Hello World, Soup Style!" and returns a success status.
```
#include <iostream>
int main()
{
std::cout << "Hello World, Soup Style!" << std::endl;
return 0;
}
```

### .gitignore
A simple git ignore file to exclude all Soup build output.
```
out/
```

## Module Console Application

## [Module Console Application](Samples/ModuleConsoleApplication)
This is a console application that uses a single module interface file used inside the same projects.

### Recipe.toml
The Recipe file that sets the name, type, version, the public interface module and the single source file.
```
Name = "ModuleConsoleApplication"
Type = "Executable"
Version = "1.2.5"
Public = "Module.cpp"
Source = [
"Main.cpp"
]
```

### Module.cpp
A module interface file that exports a single sample class.
```
module;
// Include all standard library headers in the global module
#include <string>
export module ModuleConsoleApplication;
export class Helper
{
public:
static std::string GetName()
{
return "Soup";
}
};
```

### Main.cpp
A simple main method that prints our "Hello World, Soup Style!" by using the module from the previous file.
```
#include <iostream>
import ModuleConsoleApplication;
int main()
{
std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl;
return 0;
}
```

### .gitignore
A simple git ignore file to exclude all Soup build output.
```
out/
```

## Static Library Reference

## [Static Library Reference](Samples/StaticLibraryReference)
This is a console application that has a single static library dependency.

### MyLibrary/Recipe.toml
The Recipe file that defines the static library "MyLibrary".
```
Name = "MyLibrary"
Version = "1.0.0"
Public = "Module.cpp"
```

### MyLibrary/Module.cpp
A module interface file that exports a single sample class.
```
module;
// Include all standard library headers in the global module
#include <string>
export module MyLibrary;
export namespace MyLibrary
{
class Helper
{
public:
static std::string GetName()
{
return "Soup";
}
};
}
```

### MyApplication/Recipe.toml
The Recipe file that defines the executable "MyApplication".
```
Name = "MyApplication"
Type = "Executable"
Version = "1.0.0"
Dependencies = [
"../MyLibrary/"
]
Source = [
"Main.cpp"
]
```

### MyApplication/Main.cpp
A simple main method that prints our "Hello World, Soup Style!" by using the module from the library.
```
#include <iostream>
import MyLibrary;
using namespace MyLibrary;
int main()
{
std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl;
return 0;
}
```

### .gitignore
A simple git ignore file to exclude all Soup build output.
```
out/
```
54 changes: 54 additions & 0 deletions Docs/Samples/ModuleConsoleApplication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# Module Console Application
This is a console application that uses a single module interface file used inside the same projects.

## Recipe.toml
The Recipe file that sets the name, type, version, the public interface module and the single source file.
```
Name = "ModuleConsoleApplication"
Type = "Executable"
Version = "1.2.5"
Public = "Module.cpp"
Source = [
"Main.cpp"
]
```

## Module.cpp
A module interface file that exports a single sample class.
```
module;
// Include all standard library headers in the global module
#include <string>
export module ModuleConsoleApplication;
export class Helper
{
public:
static std::string GetName()
{
return "Soup";
}
};
```

## Main.cpp
A simple main method that prints our "Hello World, Soup Style!" by using the module from the previous file.
```
#include <iostream>
import ModuleConsoleApplication;
int main()
{
std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl;
return 0;
}
```

## .gitignore
A simple git ignore file to exclude all Soup build output.
```
out/
```
31 changes: 31 additions & 0 deletions Docs/Samples/SimpleConsoleApplication.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Simple Console Application
This is the smallest amount of code to get a console application building using Soup.

## Recipe.toml
The Recipe file that sets the name, type, version and the single source file.
```
Name = "SimpleConsoleApplication"
Type = "Executable"
Version = "1.1.3"
Source = [
"Main.cpp"
]
```

## Main.cpp
A simple main method that prints our "Hello World, Soup Style!" and returns a success status.
```
#include <iostream>
int main()
{
std::cout << "Hello World, Soup Style!" << std::endl;
return 0;
}
```

## .gitignore
A simple git ignore file to exclude all Soup build output.
```
out/
```
68 changes: 68 additions & 0 deletions Docs/Samples/StaticLibraryReference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Static Library Reference
This is a console application that has a single static library dependency.

## MyLibrary/Recipe.toml
The Recipe file that defines the static library "MyLibrary".
```
Name = "MyLibrary"
Version = "1.0.0"
Public = "Module.cpp"
```

## MyLibrary/Module.cpp
A module interface file that exports a single sample class.
```
module;
// Include all standard library headers in the global module
#include <string>
export module MyLibrary;
export namespace MyLibrary
{
class Helper
{
public:
static std::string GetName()
{
return "Soup";
}
};
}
```

## MyApplication/Recipe.toml
The Recipe file that defines the executable "MyApplication".
```
Name = "MyApplication"
Type = "Executable"
Version = "1.0.0"
Dependencies = [
"../MyLibrary/"
]
Source = [
"Main.cpp"
]
```

## MyApplication/Main.cpp
A simple main method that prints our "Hello World, Soup Style!" by using the module from the library.
```
#include <iostream>
import MyLibrary;
using namespace MyLibrary;
int main()
{
std::cout << "Hello World, " << Helper::GetName() << " Style!" << std::endl;
return 0;
}
```

## .gitignore
A simple git ignore file to exclude all Soup build output.
```
out/
```
16 changes: 13 additions & 3 deletions Scripts/alltest.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,27 @@
SET ScriptsDir=%~dp0
SET SourceDir=%ScriptsDir%..\Source\

pushd %SourceDir%\Compiler\Clang.UnitTests\
pushd %SourceDir%\Build\Extensions.UnitTests\
call soup build
call soup run
popd

pushd %SourceDir%\Compiler\MSVC.UnitTests\
pushd %SourceDir%\Extensions\Compiler\Core.UnitTests\
call soup build
call soup run
popd

pushd %SourceDir%\Core.UnitTests\
pushd %SourceDir%\Extensions\Compiler\Clang.UnitTests\
call soup build
call soup run
popd

pushd %SourceDir%\Extensions\Compiler\MSVC.UnitTests\
call soup build
call soup run
popd

pushd %SourceDir%\Client\Core.UnitTests\
call soup build
call soup run
popd
2 changes: 1 addition & 1 deletion Scripts/soup.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
SET ScriptsDir=%~dp0
SET ClientDir=%ScriptsDir%..\Source\Client
SET ClientDir=%ScriptsDir%..\Source\Client\CLI
SET OutDir=%ClientDir%\out
SET BinaryDir=%OutDir%\bin
SET RunDir=%OutDir%\run
Expand Down
2 changes: 1 addition & 1 deletion Scripts/soupd.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@echo off
SET ScriptsDir=%~dp0
SET ClientDir=%ScriptsDir%..\Source\Client
SET ClientDir=%ScriptsDir%..\Source\Client\CLI
SET OutDir=%ClientDir%\out
SET BinaryDir=%OutDir%\bin
SET RunDir=%OutDir%\run
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ namespace Soup::Build
{
public:
virtual const char* GetName() const noexcept = 0;
virtual IList<const char*>& GetRunBeforeList() noexcept = 0;
virtual IList<const char*>& GetRunAfterList() noexcept = 0;

virtual OperationResult Execute(IBuildState& state) noexcept = 0;
};
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 94cf2d2

Please sign in to comment.