Skip to content

Commit

Permalink
Add Windows Installer (#62)
Browse files Browse the repository at this point in the history
* Remove json11 sub

* Remove toml11

* Update build extension sample

* Create the wix installer

* Add release docs

* Update docs and bump version
  • Loading branch information
mwasplund authored Aug 14, 2020
1 parent b49e274 commit 8e44e6a
Show file tree
Hide file tree
Showing 40 changed files with 292 additions and 71 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,13 @@
.vs/
*.user
.vscode/ipch/
packages/

# Build
out/
bin/
obj/
obj/

# Wix
msi/
wix/
6 changes: 0 additions & 6 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@
[submodule "Dependencies/Antlr4"]
path = Dependencies/Antlr4
url = https://github.com/mwasplund/Antlr4.git
[submodule "Dependencies/Json11"]
path = Dependencies/Json11
url = https://github.com/mwasplund/Json11.git
[submodule "Dependencies/toml11"]
path = Dependencies/toml11
url = https://github.com/mwasplund/toml11.git
[submodule "Dependencies/cpp-httplib"]
path = Dependencies/cpp-httplib
url = https://github.com/mwasplund/cpp-httplib.git
Expand Down
1 change: 0 additions & 1 deletion Dependencies/Json11
Submodule Json11 deleted from e5e56f
2 changes: 1 addition & 1 deletion Dependencies/Opal
Submodule Opal updated 1 files
+1 −1 Source/Recipe.toml
1 change: 0 additions & 1 deletion Dependencies/toml11
Submodule toml11 deleted from d5ebcd
30 changes: 30 additions & 0 deletions Docs/Create-Release.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Create Release

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

Create a PR with this change.

## Build Client
Build the release client executable
```
build release
```

## Create the release artifacts
Zip up the contents of the bin folder into Soup.zip

[Soup]\Source\Client\CLI\out\bin\MSVC\release\win32\x64\


## Build the Installer
Open [Soup]\Source\Installer\Installer.sln in Visual Studio 2019

Rebuild solution

## Create a GitHub Release
Tag the new release
* title: "Soup 0.\*.\* (Alpha)"
* tag: "v0.\*.\*-alpha

Upload the Soup.zip and Soup.msi files.
15 changes: 9 additions & 6 deletions Docs/Getting-Started.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,24 @@ Note: While Clang will work, there is still work to auto-detect an installation
* [Visual Studio 2019](https://visualstudio.microsoft.com/downloads/) with "Desktop development with c++" workload.
* OR
* [Build Tools For Visual Studio 2019](https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019) with "c++ build tools" workload.
* [Latest Release](https://github.com/mwasplund/Soup/releases)
* [Latest Release](https://github.com/mwasplund/Soup/releases/latest)

## Setup
Place the Soup release somewhere safe and add it to your path in a command prompt.

### Run Installer
Download and run the Soup.msi installer.

Note: The installer is not yet signed and you will have to ignore some scary warnings. We will start paying for the cerfiticate when it is no longer in Alpha.

### Download Archive
Unzip the Soup release somewhere safe and add it to your path in a command prompt.

```
set PATH=%PATH%;C:\Soup\bin\
```
Or add it to the "Path" System Environment Variable to always have it available!

## Create First Project

Run Initialize command to create a new project!
```
mkdir MyProject
Expand All @@ -29,17 +35,14 @@ soup initialize
```

## Build First Project

```
soup build
```

## Run First Project

```
soup run
```

## Enjoy!

Check out the other [Samples](./Samples.md).
30 changes: 16 additions & 14 deletions Docs/Samples/Simple-Build-Extension.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Name = "SimpleBuildExtension"
Type = "DynamicLibrary"
Version = "1.0.0"
Dependencies = [
"[email protected].2",
"[email protected].3",
"[email protected]",
"[email protected]",
]
Expand Down Expand Up @@ -44,23 +44,23 @@ namespace SimpleBuildExtension
/// <summary>
/// Get the run before list
/// </summary>
Soup::Build::IList<const char*>& GetRunBeforeList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunBeforeList() const noexcept override final
{
return _runBeforeList;
}
/// <summary>
/// Get the run after list
/// </summary>
Soup::Build::IList<const char*>& GetRunAfterList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunAfterList() const noexcept override final
{
return _runAfterList;
}
/// <summary>
/// The Core Execute task
/// </summary>
Soup::Build::ApiCallResult Execute(
Soup::Build::ApiCallResult TryExecute(
Soup::Build::IBuildState& buildState) noexcept override final
{
auto buildStateWrapper = Soup::Build::Utilities::BuildStateWrapper(buildState);
Expand All @@ -70,12 +70,12 @@ namespace SimpleBuildExtension
// We cannot throw accross the DLL boundary for a build extension
// So all internal errors must be converted to error codes
Execute(buildStateWrapper);
return 0;
return Soup::Build::ApiCallResult::Success;
}
catch(...)
{
buildStateWrapper.LogError("Unknown Error!");
return -1;
return Soup::Build::ApiCallResult::Error;
}
}
Expand Down Expand Up @@ -126,23 +126,23 @@ namespace SimpleBuildExtension
/// <summary>
/// Get the run before list
/// </summary>
Soup::Build::IList<const char*>& GetRunBeforeList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunBeforeList() const noexcept override final
{
return _runBeforeList;
}
/// <summary>
/// Get the run after list
/// </summary>
Soup::Build::IList<const char*>& GetRunAfterList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunAfterList() const noexcept override final
{
return _runAfterList;
}
/// <summary>
/// The Core Execute task
/// </summary>
Soup::Build::ApiCallResult Execute(
Soup::Build::ApiCallResult TryExecute(
Soup::Build::IBuildState& buildState) noexcept override final
{
auto buildStateWrapper = Soup::Build::Utilities::BuildStateWrapper(buildState);
Expand All @@ -152,12 +152,12 @@ namespace SimpleBuildExtension
// We cannot throw accross the DLL boundary for a build extension
// So all internal errors must be converted to error codes
Execute(buildStateWrapper);
return 0;
return Soup::Build::ApiCallResult::Success;
}
catch(...)
{
buildStateWrapper.LogError("Unknown Error!");
return -1;
return Soup::Build::ApiCallResult::Error;
}
}
Expand Down Expand Up @@ -205,20 +205,22 @@ import Soup.Build.Utilities;
#include "AfterBuildTask.h"
#include "BeforeBuildTask.h"
#define DllExport __declspec( dllexport )
#define DllExport __declspec(dllexport)
extern "C"
{
DllExport int RegisterBuildExtension(Soup::Build::IBuildSystem& buildSystem)
{
// Register the before build task
auto beforeBuildtask = Opal::Memory::Reference<SimpleBuildExtension::BeforeBuildTask>(
new SimpleBuildExtension::BeforeBuildTask());
buildSystem.RegisterTask(beforeBuildtask.GetRaw());
if (buildSystem.TryRegisterTask(beforeBuildtask.GetRaw()) != Soup::Build::ApiCallResult::Success)
return -1;
// Register the after build task
auto afterBuildtask = Opal::Memory::Reference<SimpleBuildExtension::AfterBuildTask>(
new SimpleBuildExtension::AfterBuildTask());
buildSystem.RegisterTask(afterBuildtask.GetRaw());
if (buildSystem.TryRegisterTask(afterBuildtask.GetRaw()) != Soup::Build::ApiCallResult::Success)
return -1;
return 0;
}
Expand Down
10 changes: 5 additions & 5 deletions Samples/SimpleBuildExtension/Extension/AfterBuildTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ namespace SimpleBuildExtension
/// <summary>
/// Get the run before list
/// </summary>
Soup::Build::IList<const char*>& GetRunBeforeList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunBeforeList() const noexcept override final
{
return _runBeforeList;
}

/// <summary>
/// Get the run after list
/// </summary>
Soup::Build::IList<const char*>& GetRunAfterList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunAfterList() const noexcept override final
{
return _runAfterList;
}

/// <summary>
/// The Core Execute task
/// </summary>
Soup::Build::ApiCallResult Execute(
Soup::Build::ApiCallResult TryExecute(
Soup::Build::IBuildState& buildState) noexcept override final
{
auto buildStateWrapper = Soup::Build::Utilities::BuildStateWrapper(buildState);
Expand All @@ -45,12 +45,12 @@ namespace SimpleBuildExtension
// We cannot throw accross the DLL boundary for a build extension
// So all internal errors must be converted to error codes
Execute(buildStateWrapper);
return 0;
return Soup::Build::ApiCallResult::Success;
}
catch(...)
{
buildStateWrapper.LogError("Unknown Error!");
return -1;
return Soup::Build::ApiCallResult::Error;
}
}

Expand Down
10 changes: 5 additions & 5 deletions Samples/SimpleBuildExtension/Extension/BeforeBuildTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,23 @@ namespace SimpleBuildExtension
/// <summary>
/// Get the run before list
/// </summary>
Soup::Build::IList<const char*>& GetRunBeforeList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunBeforeList() const noexcept override final
{
return _runBeforeList;
}

/// <summary>
/// Get the run after list
/// </summary>
Soup::Build::IList<const char*>& GetRunAfterList() noexcept override final
const Soup::Build::IReadOnlyList<const char*>& GetRunAfterList() const noexcept override final
{
return _runAfterList;
}

/// <summary>
/// The Core Execute task
/// </summary>
Soup::Build::ApiCallResult Execute(
Soup::Build::ApiCallResult TryExecute(
Soup::Build::IBuildState& buildState) noexcept override final
{
auto buildStateWrapper = Soup::Build::Utilities::BuildStateWrapper(buildState);
Expand All @@ -45,12 +45,12 @@ namespace SimpleBuildExtension
// We cannot throw accross the DLL boundary for a build extension
// So all internal errors must be converted to error codes
Execute(buildStateWrapper);
return 0;
return Soup::Build::ApiCallResult::Success;
}
catch(...)
{
buildStateWrapper.LogError("Unknown Error!");
return -1;
return Soup::Build::ApiCallResult::Error;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Samples/SimpleBuildExtension/Extension/Recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Name = "SimpleBuildExtension"
Type = "DynamicLibrary"
Version = "1.0.0"
Dependencies = [
"[email protected].2",
"[email protected].3",
"[email protected]",
"[email protected]",
]
Expand Down
8 changes: 5 additions & 3 deletions Samples/SimpleBuildExtension/Extension/Register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,22 @@ import Soup.Build.Utilities;
#include "AfterBuildTask.h"
#include "BeforeBuildTask.h"

#define DllExport __declspec( dllexport )
#define DllExport __declspec(dllexport)
extern "C"
{
DllExport int RegisterBuildExtension(Soup::Build::IBuildSystem& buildSystem)
{
// Register the before build task
auto beforeBuildtask = Opal::Memory::Reference<SimpleBuildExtension::BeforeBuildTask>(
new SimpleBuildExtension::BeforeBuildTask());
buildSystem.RegisterTask(beforeBuildtask.GetRaw());
if (buildSystem.TryRegisterTask(beforeBuildtask.GetRaw()) != Soup::Build::ApiCallResult::Success)
return -1;

// Register the after build task
auto afterBuildtask = Opal::Memory::Reference<SimpleBuildExtension::AfterBuildTask>(
new SimpleBuildExtension::AfterBuildTask());
buildSystem.RegisterTask(afterBuildtask.GetRaw());
if (buildSystem.TryRegisterTask(afterBuildtask.GetRaw()) != Soup::Build::ApiCallResult::Success)
return -1;

return 0;
}
Expand Down
6 changes: 6 additions & 0 deletions Scripts/install.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SET ScriptsDir=%~dp0
SET SourceDir=%ScriptsDir%..\Source
SET InstallerDir=%SourceDir%\Installer\SoupInstaller\msi
pushd %InstallerDir%
start msiexec /package Soup.msi /passive
popd
6 changes: 6 additions & 0 deletions Scripts/uninstall.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SET ScriptsDir=%~dp0
SET SourceDir=%ScriptsDir%..\Source
SET InstallerDir=%SourceDir%\Installer\SoupInstaller\msi
pushd %InstallerDir%
start msiexec /uninstall Soup.msi
popd
3 changes: 1 addition & 2 deletions Source/Build/Contracts/Recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ the stable Binary Interface layer between the Build Evaluation
engine and the Extensions."""
Version = "0.3.0"
Dependencies = [
"../../../Dependencies/Opal/Source/",
# "[email protected]",
"[email protected]",
]

Public = "Module.cpp"
3 changes: 1 addition & 2 deletions Source/Build/Evaluate/Recipe.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ Dependencies = [
# "[email protected]",
"../Utilities/",
# "[email protected]",
"../../../Dependencies/Opal/Source/",
# "[email protected]",
"[email protected]",
]

Public = "Module.cpp"
Expand Down
Loading

0 comments on commit 8e44e6a

Please sign in to comment.