builder: Add build_context_get_build_dir()

tingping/wmclass
Alexander Larsson 2016-02-17 09:09:45 +01:00
parent 393163200d
commit e233705379
3 changed files with 11 additions and 2 deletions

View File

@ -41,6 +41,7 @@ struct BuilderContext {
GFile *download_dir;
GFile *state_dir;
GFile *build_dir;
GFile *cache_dir;
GFile *ccache_dir;
@ -135,6 +136,7 @@ builder_context_constructed (GObject *object)
self->state_dir = g_file_get_child (self->base_dir, ".xdg-app-builder");
self->download_dir = g_file_get_child (self->state_dir, "downloads");
self->build_dir = g_file_get_child (self->state_dir, "build");
self->cache_dir = g_file_get_child (self->state_dir, "cache");
self->ccache_dir = g_file_get_child (self->state_dir, "ccache");
}
@ -200,6 +202,12 @@ builder_context_get_cache_dir (BuilderContext *self)
return self->cache_dir;
}
GFile *
builder_context_get_build_dir (BuilderContext *self)
{
return self->build_dir;
}
GFile *
builder_context_get_ccache_dir (BuilderContext *self)
{

View File

@ -39,6 +39,7 @@ GFile * builder_context_get_app_dir (BuilderContext *self);
GFile * builder_context_get_base_dir (BuilderContext *self);
GFile * builder_context_get_state_dir (BuilderContext *self);
GFile * builder_context_get_cache_dir (BuilderContext *self);
GFile * builder_context_get_build_dir (BuilderContext *self);
GFile * builder_context_get_ccache_dir (BuilderContext *self);
GFile * builder_context_get_download_dir (BuilderContext *self);
SoupSession * builder_context_get_soup_session (BuilderContext *self);

View File

@ -749,7 +749,7 @@ builder_module_build (BuilderModule *self,
g_autoptr(GFile) configure_file = NULL;
g_autoptr(GFile) cmake_file = NULL;
const char *makefile_names[] = {"Makefile", "makefile", "GNUmakefile", NULL};
g_autoptr(GFile) build_parent_dir = NULL;
GFile *build_parent_dir = NULL;
g_autoptr(GFile) build_dir = NULL;
g_autoptr(GFile) build_link = NULL;
g_autofree char *build_dir_relative = NULL;
@ -768,7 +768,7 @@ builder_module_build (BuilderModule *self,
g_autoptr(GError) my_error = NULL;
int count;
build_parent_dir = g_file_get_child (builder_context_get_state_dir (context), "build");
build_parent_dir = builder_context_get_build_dir (context);
if (!gs_file_ensure_directory (build_parent_dir, TRUE,
NULL, error))