Skip to content

Commit

Permalink
Update main.yml (#52)
Browse files Browse the repository at this point in the history
* Update main.yml

* Update file checks

* Update version
  • Loading branch information
mwasplund authored Aug 3, 2020
1 parent 15f0411 commit b709458
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 23 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@ on: [push]

jobs:
build:

runs-on: windows-latest

steps:
- uses: actions/checkout@v1
- name: Run a one-line script
run: echo Hello, world!
- name: Run a multi-line script
run: |
echo Add other actions to build,
echo test, and deploy your project.
with:
submodules: true
- name: Setup Soup
uses: SoupBuild/Setup-Soup@v1
with:
version: v0.8.0-alpha
- name: Build Client
run: soup build Source/Client/CLI/ -v:d
- name: Run Tests
run: Scripts/InPath/AllTest.bat
18 changes: 11 additions & 7 deletions Scripts/Build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ SET DetoursDir=%SourceDir%\Monitor\Detours
SET BinaryDirectorPath=out\bin\MSVC\%Flavor%\win32
SET ClientCLIBinaryDirectory=%ClientCLIDir%\%BinaryDirectorPath%
SET DetoursBinaryDirectory=%DetoursDir%\%BinaryDirectorPath%
REM - Build the host
echo soup build %ClientCLIDir% -flavor %Flavor%
call soup build %ClientCLIDir% -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
REM - Build Each version of the detours dll

REM - Build each version of the detours dll
echo soup build %DetoursDir% -architecture x64 -flavor %Flavor%
call soup build %DetoursDir% -architecture x64 -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%
echo copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll
copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll > nul
echo soup build %DetoursDir% -architecture x86 -flavor %Flavor%
call soup build %DetoursDir% -architecture x86 -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

REM - Build the host
echo soup build %ClientCLIDir% -flavor %Flavor%
call soup build %ClientCLIDir% -flavor %Flavor%
if %ERRORLEVEL% NEQ 0 exit /B %ERRORLEVEL%

REM - Copy the detour dlls
echo copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll
copy %DetoursBinaryDirectory%\x64\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.64.dll > nul
echo copy %DetoursBinaryDirectory%\x86\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.32.dll
copy %DetoursBinaryDirectory%\x86\Monitor.Detours.dll %ClientCLIBinaryDirectory%\x64\Monitor.Detours.32.dll > nul
2 changes: 1 addition & 1 deletion Source/Client/CLI/Commands/VersionCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace Soup::Client

// TODO var version = Assembly.GetExecutingAssembly().GetName().Version;
// Log::Message($"{version.Major}.{version.Minor}.{version.Build}");
Log::HighPriority("0.8.0");
Log::HighPriority("0.8.1");
}

private:
Expand Down
26 changes: 18 additions & 8 deletions Source/Extensions/RecipeBuild/Tasks/ResolveToolsTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ namespace RecipeBuild
auto windows10KitIncludePath = windows10KitPath + Path("/include/");
auto windows10KitLibPath = windows10KitPath + Path("/Lib/");

auto windowsKitVersion = FindNewestWindows10KitVersion(windows10KitIncludePath);
auto windowsKitVersion = FindNewestWindows10KitVersion(buildState, windows10KitIncludePath);

buildState.LogInfo("Using Windows Kit Version: " + windowsKitVersion);
auto windows10KitVersionIncludePath = windows10KitIncludePath + Path(windowsKitVersion);
Expand Down Expand Up @@ -281,23 +281,33 @@ namespace RecipeBuild
}

std::string FindNewestWindows10KitVersion(
Soup::Build::Utilities::BuildStateWrapper& buildState,
const Path& windows10KitIncludePath)
{
// Check the default tools version
buildState.LogDebug("FindNewestWindows10KitVersion: " + windows10KitIncludePath.ToString());
auto currentVersion = SemanticVersion(0, 0, 0);
for (auto& child : System::IFileSystem::Current().GetDirectoryChildren(windows10KitIncludePath))
{
auto name = child.Path.GetFileName();
buildState.LogDebug("CheckFile: " + name);
auto platformVersion = name.substr(0, 3);
if (platformVersion != "10.")
throw std::runtime_error("Unexpected Kit Version: " + name);

// Parse the version string
auto version = SemanticVersion::Parse(name.substr(3));
if (version > currentVersion)
currentVersion = version;
if (platformVersion == "10.")
{
// Parse the version string
auto version = SemanticVersion::Parse(name.substr(3));
if (version > currentVersion)
currentVersion = version;
}
else
{
buildState.LogWarning("Unexpected Kit Version: " + name);
}
}

if (currentVersion == SemanticVersion(0, 0, 0))
throw std::runtime_error("Could not find a minimum Windows 10 Kit Version");

// The first line is the version
auto version = "10." + currentVersion.ToString();
return version;
Expand Down

0 comments on commit b709458

Please sign in to comment.