forked from enlightenment/edi
Improve the python build provider
This commit is contained in:
parent
2fb3280d07
commit
4614a105aa
|
@ -23,6 +23,15 @@ _relative_path_exists(const char *base, const char *relative)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_exec_cmd(const char *cmd)
|
||||||
|
{
|
||||||
|
ecore_exe_pipe_run(cmd,
|
||||||
|
ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
|
||||||
|
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR |
|
||||||
|
ECORE_EXE_PIPE_WRITE | ECORE_EXE_USE_SH, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_python_project_supported(const char *path)
|
_python_project_supported(const char *path)
|
||||||
{
|
{
|
||||||
|
@ -41,15 +50,33 @@ _python_file_hidden_is(const char *file)
|
||||||
return EINA_FALSE;
|
return EINA_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_python_build(void)
|
||||||
|
{
|
||||||
|
if (chdir(edi_project_get()) == 0)
|
||||||
|
_exec_cmd("./setup.py build");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_python_test(void)
|
_python_test(void)
|
||||||
{
|
{
|
||||||
chdir(edi_project_get());
|
if (chdir(edi_project_get()) == 0)
|
||||||
ecore_exe_pipe_run("python -m unittest", ECORE_EXE_PIPE_READ_LINE_BUFFERED | ECORE_EXE_PIPE_READ |
|
_exec_cmd("./setup.py test");
|
||||||
ECORE_EXE_PIPE_ERROR_LINE_BUFFERED | ECORE_EXE_PIPE_ERROR |
|
}
|
||||||
ECORE_EXE_PIPE_WRITE | ECORE_EXE_USE_SH, NULL);
|
|
||||||
|
static void
|
||||||
|
_python_clean(void)
|
||||||
|
{
|
||||||
|
if (chdir(edi_project_get()) == 0)
|
||||||
|
_exec_cmd("./setup.py clean --all");
|
||||||
}
|
}
|
||||||
|
|
||||||
Edi_Build_Provider _edi_build_provider_python =
|
Edi_Build_Provider _edi_build_provider_python =
|
||||||
{"python", _python_project_supported, _python_file_hidden_is,
|
{
|
||||||
NULL, _python_test, NULL};
|
"python",
|
||||||
|
_python_project_supported,
|
||||||
|
_python_file_hidden_is,
|
||||||
|
_python_build,
|
||||||
|
_python_test,
|
||||||
|
_python_clean
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue