Skip to content

Commit

Permalink
Add install command (#33)
Browse files Browse the repository at this point in the history
* Switch over to toml11

* Remove cpptoml

* Switch over to using a separate internal representation for the recipe to maintain order and allow for comments

* Round trip comments

* Fix value bug

* Switch to iniailize command

* Match new update/create package api

* Add basic auth api

* Fix breaking issues in latest msvc

* Fix some stuff

* Add (disabled) botan client

* Add missing exports

* Add missing exports

* Enable HTTPS requests

* Add console manager to read password

* Better status results for api

* Cleanup messages

* Fix up package manager publish test

* Fix bad merge

* Add package create test

* Add install at version

* Add recursive install

* Add install packages method to the package manager

Co-authored-by: Matthew Asplund <[email protected]>
  • Loading branch information
mwasplund and Matthew Asplund authored Apr 22, 2020
1 parent 6b9b88c commit 931acc2
Show file tree
Hide file tree
Showing 32 changed files with 1,354 additions and 314 deletions.
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
"random": "cpp",
"regex": "cpp",
"string_view": "cpp",
"complex": "cpp"
"complex": "cpp",
"*.inc": "cpp"
}
}
2 changes: 1 addition & 1 deletion Source/Client/Commands/BuildCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ namespace Soup::Client
// arguments.PlatformLibraries.push_back(Path("winspool.lib"));
// arguments.PlatformLibraries.push_back(Path("comdlg32.lib"));
arguments.PlatformLibraries.push_back("advapi32.lib");
// arguments.PlatformLibraries.push_back(Path("shell32.lib"));
arguments.PlatformLibraries.push_back("shell32.lib");
// arguments.PlatformLibraries.push_back(Path("ole32.lib"));
arguments.PlatformLibraries.push_back("oleaut32.lib");
// arguments.PlatformLibraries.push_back(Path("uuid.lib"));
Expand Down
10 changes: 8 additions & 2 deletions Source/Client/Commands/InstallCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,14 @@ namespace Soup::Client
{
Log::Diag("InstallCommand::Run");

auto packageStore = Path("C:/users/mwasp/.soup/packages/");
PackageManager::InstallPackage(_options.Package, packageStore);
if (_options.Package.empty())
{
PackageManager::InstallPackages();
}
else
{
PackageManager::InstallPackageReference(_options.Package);
}
}

private:
Expand Down
5 changes: 2 additions & 3 deletions Source/Client/Commands/PublishCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ namespace Soup::Client
virtual void Run() override final
{
Log::Diag("PublishCommand::Run");

auto packageStore = Path("C:/users/mwasp/.soup/packages/");
PackageManager::PublishPackage(packageStore);

PackageManager::PublishPackage();
}

private:
Expand Down
2 changes: 1 addition & 1 deletion Source/Client/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.6.0");
Log::HighPriority("0.6.1");
}

private:
Expand Down
4 changes: 0 additions & 4 deletions Source/Client/Options/ArgumentsParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ namespace Soup::Client
{
options->Package = std::move(argument);
}
else
{
throw std::runtime_error("Missing required package name argument.");
}

options->Verbosity = CheckVerbosity(unusedArgs);

Expand Down
9 changes: 7 additions & 2 deletions Source/Client/Program.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,21 @@ namespace Soup::Client

return 0;
}
catch (const HandledException&)
{
Log::Info("Exception Handled: Exiting");
return -1;
}
catch (const std::exception& ex)
{
Log::Error("Exception Handled: Exiting");
Log::Error("Exception Caught: Exiting");
Log::Error(ex.what());
return -2;
}
catch (...)
{
Log::Error("Unknown exception encountered");
return -1;
return -3;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Client/Recipe.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Name = "Soup"
Version = "0.6.0"
Version = "0.6.1"
Type = "Executable"

# Ensure the core build extensions are runtime dependencies
Expand Down
5 changes: 3 additions & 2 deletions Source/Core.UnitTests/Api/SoupApiTests.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ namespace Soup::Api::UnitTests
testNetworkManager->RegisterClient(testHttpClient);

// Setup the expected http requests
auto packageResult = std::string(
auto packageResult = Network::HttpResponse(
Network::HttpStatusCode::Ok,
R"({
"name": "MyPackage"
})");
testHttpClient->SetResponse("/v1/packages/MyPackage", packageResult);
testHttpClient->AddGetResponse("/v1/packages/MyPackage", packageResult);

auto packageName = "MyPackage";
auto result = SoupApi::GetPackage(packageName);
Expand Down
Loading

0 comments on commit 931acc2

Please sign in to comment.