2015-11-16 15:23:23 +00:00
|
|
|
/*
|
|
|
|
* Copyright © 2015 Red Hat, Inc
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
2016-07-29 18:27:49 +00:00
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
2015-11-16 15:23:23 +00:00
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
* Authors:
|
|
|
|
* Alexander Larsson <alexl@redhat.com>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __BUILDER_CONTEXT_H__
|
|
|
|
#define __BUILDER_CONTEXT_H__
|
|
|
|
|
|
|
|
#include <gio/gio.h>
|
|
|
|
#include <libsoup/soup.h>
|
|
|
|
#include "builder-options.h"
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
2017-02-07 15:23:13 +00:00
|
|
|
/* BuilderContext defined in builder-cache.h to fix include loop */
|
2015-11-16 15:23:23 +00:00
|
|
|
|
2016-05-06 14:03:27 +00:00
|
|
|
#define BUILDER_TYPE_CONTEXT (builder_context_get_type ())
|
2015-11-16 15:23:23 +00:00
|
|
|
#define BUILDER_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUILDER_TYPE_CONTEXT, BuilderContext))
|
|
|
|
#define BUILDER_IS_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUILDER_TYPE_CONTEXT))
|
|
|
|
|
|
|
|
GType builder_context_get_type (void);
|
|
|
|
|
2016-05-06 14:03:27 +00:00
|
|
|
GFile * builder_context_get_app_dir (BuilderContext *self);
|
2017-02-07 15:37:42 +00:00
|
|
|
GFile * builder_context_get_app_dir_raw (BuilderContext *self);
|
2017-02-21 09:25:36 +00:00
|
|
|
GFile * builder_context_get_run_dir (BuilderContext *self);
|
2016-05-06 14:03:27 +00:00
|
|
|
GFile * builder_context_get_base_dir (BuilderContext *self);
|
2017-02-21 09:25:36 +00:00
|
|
|
void builder_context_set_base_dir (BuilderContext *self,
|
|
|
|
GFile *base_dir);
|
2016-05-06 14:03:27 +00:00
|
|
|
GFile * builder_context_get_state_dir (BuilderContext *self);
|
|
|
|
GFile * builder_context_get_cache_dir (BuilderContext *self);
|
|
|
|
GFile * builder_context_get_build_dir (BuilderContext *self);
|
2017-02-21 10:48:35 +00:00
|
|
|
GFile * builder_context_allocate_build_subdir (BuilderContext *self,
|
|
|
|
const char *name,
|
|
|
|
GError **error);
|
2016-05-06 14:03:27 +00:00
|
|
|
GFile * builder_context_get_ccache_dir (BuilderContext *self);
|
|
|
|
GFile * builder_context_get_download_dir (BuilderContext *self);
|
2017-03-31 05:56:10 +00:00
|
|
|
GPtrArray * builder_context_get_sources_dirs (BuilderContext *self);
|
|
|
|
void builder_context_set_sources_dirs (BuilderContext *self,
|
|
|
|
GPtrArray *sources_dirs);
|
2017-04-21 16:23:52 +00:00
|
|
|
GFile * builder_context_find_in_sources_dirs (BuilderContext *self,
|
|
|
|
...) G_GNUC_NULL_TERMINATED;
|
|
|
|
GFile * builder_context_find_in_sources_dirs_va (BuilderContext *self,
|
|
|
|
va_list args);
|
2017-07-29 15:43:10 +00:00
|
|
|
GPtrArray * builder_context_get_sources_urls (BuilderContext *self);
|
|
|
|
void builder_context_set_sources_urls (BuilderContext *self,
|
|
|
|
GPtrArray *sources_urls);
|
|
|
|
gboolean builder_context_download_uri (BuilderContext *self,
|
|
|
|
const char *url,
|
|
|
|
GFile *dest,
|
|
|
|
char *sha256,
|
|
|
|
GError **error);
|
2016-05-06 14:03:27 +00:00
|
|
|
SoupSession * builder_context_get_soup_session (BuilderContext *self);
|
|
|
|
const char * builder_context_get_arch (BuilderContext *self);
|
|
|
|
void builder_context_set_arch (BuilderContext *self,
|
|
|
|
const char *arch);
|
2016-08-19 09:25:23 +00:00
|
|
|
const char * builder_context_get_stop_at (BuilderContext *self);
|
|
|
|
void builder_context_set_stop_at (BuilderContext *self,
|
|
|
|
const char *module);
|
2016-11-30 08:57:55 +00:00
|
|
|
int builder_context_get_jobs (BuilderContext *self);
|
|
|
|
void builder_context_set_jobs (BuilderContext *self,
|
|
|
|
int n_jobs);
|
2016-05-06 14:03:27 +00:00
|
|
|
void builder_context_set_keep_build_dirs (BuilderContext *self,
|
|
|
|
gboolean keep_build_dirs);
|
2017-08-18 14:27:59 +00:00
|
|
|
gboolean builder_context_get_delete_build_dirs (BuilderContext *self);
|
|
|
|
void builder_context_set_delete_build_dirs (BuilderContext *self,
|
|
|
|
gboolean delete_build_dirs);
|
2016-05-06 14:03:27 +00:00
|
|
|
gboolean builder_context_get_keep_build_dirs (BuilderContext *self);
|
2016-08-22 15:23:32 +00:00
|
|
|
void builder_context_set_sandboxed (BuilderContext *self,
|
|
|
|
gboolean sandboxed);
|
|
|
|
gboolean builder_context_get_sandboxed (BuilderContext *self);
|
2016-05-06 14:03:27 +00:00
|
|
|
void builder_context_set_global_cleanup (BuilderContext *self,
|
|
|
|
const char **cleanup);
|
|
|
|
const char ** builder_context_get_global_cleanup (BuilderContext *self);
|
|
|
|
void builder_context_set_global_cleanup_platform (BuilderContext *self,
|
|
|
|
const char **cleanup);
|
|
|
|
const char ** builder_context_get_global_cleanup_platform (BuilderContext *self);
|
|
|
|
BuilderOptions *builder_context_get_options (BuilderContext *self);
|
|
|
|
void builder_context_set_options (BuilderContext *self,
|
|
|
|
BuilderOptions *option);
|
|
|
|
gboolean builder_context_get_build_runtime (BuilderContext *self);
|
|
|
|
void builder_context_set_build_runtime (BuilderContext *self,
|
|
|
|
gboolean build_runtime);
|
2017-01-27 14:27:55 +00:00
|
|
|
gboolean builder_context_get_build_extension (BuilderContext *self);
|
|
|
|
void builder_context_set_build_extension (BuilderContext *self,
|
|
|
|
gboolean build_extension);
|
2016-05-06 14:03:27 +00:00
|
|
|
gboolean builder_context_get_separate_locales (BuilderContext *self);
|
|
|
|
void builder_context_set_separate_locales (BuilderContext *self,
|
|
|
|
gboolean separate_locales);
|
2017-04-05 04:54:39 +00:00
|
|
|
void builder_context_set_bundle_sources (BuilderContext *self,
|
|
|
|
gboolean bundle_sources);
|
|
|
|
gboolean builder_context_get_bundle_sources (BuilderContext *self);
|
2017-02-10 15:37:33 +00:00
|
|
|
gboolean builder_context_get_rebuild_on_sdk_change (BuilderContext *self);
|
|
|
|
void builder_context_set_rebuild_on_sdk_change (BuilderContext *self,
|
|
|
|
gboolean rebuild_on_sdk_change);
|
2017-02-22 14:11:24 +00:00
|
|
|
char * builder_context_get_checksum_for (BuilderContext *self,
|
|
|
|
const char *name);
|
2017-12-05 12:16:37 +00:00
|
|
|
gboolean builder_context_set_checksum_for (BuilderContext *self,
|
|
|
|
const char *name,
|
|
|
|
const char *checksum,
|
|
|
|
GError **error);
|
2017-02-22 14:11:24 +00:00
|
|
|
|
2017-02-21 09:25:36 +00:00
|
|
|
BuilderContext *builder_context_new (GFile *run_dir,
|
2017-11-15 20:36:21 +00:00
|
|
|
GFile *app_dir,
|
|
|
|
const char *state_subdir);
|
2016-05-06 14:03:27 +00:00
|
|
|
gboolean builder_context_enable_ccache (BuilderContext *self,
|
|
|
|
GError **error);
|
2017-02-07 15:37:42 +00:00
|
|
|
gboolean builder_context_enable_rofiles (BuilderContext *self,
|
|
|
|
GError **error);
|
2017-02-24 10:06:42 +00:00
|
|
|
gboolean builder_context_disable_rofiles (BuilderContext *self,
|
|
|
|
GError **error);
|
2017-02-07 15:37:42 +00:00
|
|
|
gboolean builder_context_get_rofiles_active (BuilderContext *self);
|
|
|
|
gboolean builder_context_get_use_rofiles (BuilderContext *self);
|
|
|
|
void builder_context_set_use_rofiles (BuilderContext *self,
|
|
|
|
gboolean use_rofiles);
|
2017-11-15 13:41:08 +00:00
|
|
|
gboolean builder_context_get_run_tests (BuilderContext *self);
|
|
|
|
void builder_context_set_run_tests (BuilderContext *self,
|
|
|
|
gboolean run_tests);
|
2016-05-06 14:03:27 +00:00
|
|
|
char ** builder_context_extend_env (BuilderContext *self,
|
|
|
|
char **envp);
|
2015-11-16 15:23:23 +00:00
|
|
|
|
2016-05-06 14:03:27 +00:00
|
|
|
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BuilderContext, g_object_unref)
|
2015-11-16 15:23:23 +00:00
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
|
|
|
#endif /* __BUILDER_CONTEXT_H__ */
|