-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40 from Unix4ever/feature/improved-luarocks-opera…
…tions-#154493924 [#154493924] improved Luarocks operations
- Loading branch information
Showing
145 changed files
with
1,609 additions
and
401 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* | ||
----------------------------------------------------------------------------- | ||
This file is a part of Gsage engine | ||
Copyright (c) 2014-2016 Artem Chernyshev | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
----------------------------------------------------------------------------- | ||
*/ | ||
|
||
#define POCO_NO_UNWINDOWS | ||
#include "GsageFacade.h" | ||
|
||
#include <stdio.h> | ||
#include <thread> | ||
|
||
#include "Logger.h" | ||
|
||
#ifndef RESOURCES_FOLDER | ||
#define RESOURCES_FOLDER "./resources" | ||
#endif | ||
|
||
#include "sol.hpp" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
int main(int argc, char *argv[]) | ||
{ | ||
Gsage::GsageFacade facade; | ||
if(argc == 1) { | ||
LOG(ERROR) << "Usage: executable config.json"; | ||
return 1; | ||
} | ||
|
||
std::string coreConfig(argv[1]); | ||
Gsage::DataProxy env; | ||
env.put("workdir", RESOURCES_FOLDER); | ||
Gsage::FileLoader::init(Gsage::FileLoader::Json, env); | ||
Gsage::DataProxy config; | ||
if(!Gsage::FileLoader::getSingletonPtr()->load(coreConfig, Gsage::DataProxy(), config)) | ||
{ | ||
LOG(ERROR) << "Failed to load file " << coreConfig; | ||
return 1; | ||
} | ||
|
||
config.put("startupScript", ""); | ||
config.put("startLuaInterface", false); | ||
|
||
if(!facade.initialize(config, RESOURCES_FOLDER, 0)) | ||
{ | ||
LOG(ERROR) << "Failed to initialize game engine"; | ||
return 1; | ||
} | ||
|
||
Gsage::DataProxy deps = facade.getConfig().get("packager.deps", Gsage::DataProxy::create(Gsage::DataWrapper::JSON_OBJECT)); | ||
if(!facade.installLuaPackages(deps)) { | ||
LOG(ERROR) << "Failed to install packages"; | ||
return 1; | ||
} | ||
|
||
return facade.getExitCode(); | ||
} | ||
#ifdef __cplusplus | ||
} | ||
#endif |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
0
GsageCore/include/Logger.h → Core/include/Logger.h
100755 → 100644
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
----------------------------------------------------------------------------- | ||
This file is part of Gsage engine | ||
Copyright (c) 2014-2019 Gsage Authors | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
----------------------------------------------------------------------------- | ||
*/ | ||
|
||
#include "GsageDefinitions.h" | ||
|
||
#if GSAGE_PLATFORM == GSAGE_WIN32 | ||
#ifndef __COMMAND_LINE_TOOLS_H__ | ||
#define __COMMAND_LINE_TOOLS_H__ | ||
|
||
#include <memory> | ||
#include "sol_forward.hpp" | ||
|
||
namespace Gsage { | ||
// this package is here to fix built-in Lua behaviour of using standard shell | ||
// on Windows, which leads to opening countless cmd windows | ||
|
||
/** | ||
* Represents command line run pipe object | ||
*/ | ||
struct CommandPipe { | ||
void close(); | ||
sol::object next(sol::this_state s); | ||
CommandPipe* lines(); | ||
void execute(const std::string& command); | ||
sol::object read(sol::object arg, sol::this_state s); | ||
std::string readLine(); | ||
|
||
unsigned long exitCode; | ||
std::stringstream data; | ||
}; | ||
|
||
typedef std::shared_ptr<CommandPipe> CommandPipePtr; | ||
|
||
/** | ||
* Run shell command and returns status | ||
*/ | ||
int luaCmd(const std::string& command); | ||
|
||
CommandPipePtr luaPopen(const std::string& command); | ||
} | ||
|
||
#endif | ||
#endif |
File renamed without changes.
Oops, something went wrong.