Blame src/builder-context.h

rpm-build c487f7
/*
rpm-build c487f7
 * Copyright © 2015 Red Hat, Inc
rpm-build c487f7
 *
rpm-build c487f7
 * This program is free software; you can redistribute it and/or
rpm-build c487f7
 * modify it under the terms of the GNU Lesser General Public
rpm-build c487f7
 * License as published by the Free Software Foundation; either
rpm-build c487f7
 * version 2.1 of the License, or (at your option) any later version.
rpm-build c487f7
 *
rpm-build c487f7
 * This library is distributed in the hope that it will be useful,
rpm-build c487f7
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rpm-build c487f7
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
rpm-build c487f7
 * Lesser General Public License for more details.
rpm-build c487f7
 *
rpm-build c487f7
 * You should have received a copy of the GNU Lesser General Public
rpm-build c487f7
 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
rpm-build c487f7
 *
rpm-build c487f7
 * Authors:
rpm-build c487f7
 *       Alexander Larsson <alexl@redhat.com>
rpm-build c487f7
 */
rpm-build c487f7
rpm-build c487f7
#ifndef __BUILDER_CONTEXT_H__
rpm-build c487f7
#define __BUILDER_CONTEXT_H__
rpm-build c487f7
rpm-build c487f7
#include <gio/gio.h>
rpm-build c487f7
#include <libsoup/soup.h>
rpm-build c487f7
#include <curl/curl.h>
rpm-build c487f7
#include "builder-options.h"
rpm-build c487f7
#include "builder-utils.h"
rpm-build c487f7
#include "builder-sdk-config.h"
rpm-build c487f7
rpm-build c487f7
G_BEGIN_DECLS
rpm-build c487f7
rpm-build c487f7
/* BuilderContext defined in builder-cache.h to fix include loop */
rpm-build c487f7
rpm-build c487f7
#define BUILDER_TYPE_CONTEXT (builder_context_get_type ())
rpm-build c487f7
#define BUILDER_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), BUILDER_TYPE_CONTEXT, BuilderContext))
rpm-build c487f7
#define BUILDER_IS_CONTEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), BUILDER_TYPE_CONTEXT))
rpm-build c487f7
rpm-build c487f7
GType builder_context_get_type (void);
rpm-build c487f7
rpm-build c487f7
GFile *         builder_context_get_app_dir (BuilderContext *self);
rpm-build c487f7
GFile *         builder_context_get_app_dir_raw (BuilderContext *self);
rpm-build c487f7
GFile *         builder_context_get_run_dir (BuilderContext *self);
rpm-build c487f7
GFile *         builder_context_get_base_dir (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_base_dir (BuilderContext *self,
rpm-build c487f7
                                              GFile          *base_dir);
rpm-build c487f7
GFile *         builder_context_get_state_dir (BuilderContext *self);
rpm-build c487f7
GFile *         builder_context_get_cache_dir (BuilderContext *self);
rpm-build c487f7
GFile *         builder_context_get_build_dir (BuilderContext *self);
rpm-build c487f7
GFile *         builder_context_allocate_build_subdir (BuilderContext *self,
rpm-build c487f7
                                                       const char *name,
rpm-build c487f7
                                                       GError **error);
rpm-build c487f7
GFile *         builder_context_get_ccache_dir (BuilderContext *self);
rpm-build c487f7
GFile *         builder_context_get_download_dir (BuilderContext *self);
rpm-build c487f7
GPtrArray *     builder_context_get_sources_dirs (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_sources_dirs (BuilderContext *self,
rpm-build c487f7
                                                  GPtrArray      *sources_dirs);
rpm-build c487f7
GFile *         builder_context_find_in_sources_dirs (BuilderContext *self,
rpm-build c487f7
                                                      ...) G_GNUC_NULL_TERMINATED;
rpm-build c487f7
GFile *         builder_context_find_in_sources_dirs_va (BuilderContext *self,
rpm-build c487f7
                                                         va_list args);
rpm-build c487f7
GPtrArray *     builder_context_get_sources_urls (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_sources_urls (BuilderContext *self,
rpm-build c487f7
                                                  GPtrArray      *sources_urls);
rpm-build c487f7
gboolean        builder_context_download_uri (BuilderContext *self,
rpm-build c487f7
                                              const char     *url,
rpm-build c487f7
                                              const char    **mirrors,
rpm-build c487f7
                                              GFile          *dest,
rpm-build c487f7
                                              const char     *checksums[BUILDER_CHECKSUMS_LEN],
rpm-build c487f7
                                              GChecksumType   checksums_type[BUILDER_CHECKSUMS_LEN],
rpm-build c487f7
                                              GError        **error);
rpm-build c487f7
SoupSession *   builder_context_get_soup_session (BuilderContext *self);
rpm-build c487f7
CURL *          builder_context_get_curl_session (BuilderContext *self);
rpm-build c487f7
const char *    builder_context_get_arch (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_arch (BuilderContext *self,
rpm-build c487f7
                                          const char     *arch);
rpm-build c487f7
const char *    builder_context_get_default_branch (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_default_branch (BuilderContext *self,
rpm-build c487f7
                                                    const char     *default_branch);
rpm-build c487f7
void            builder_context_set_source_date_epoch (BuilderContext *self,
rpm-build c487f7
                                                       gint64 source_date_epoch);
rpm-build c487f7
const char *    builder_context_get_stop_at (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_stop_at (BuilderContext *self,
rpm-build c487f7
                                             const char     *module);
rpm-build c487f7
int             builder_context_get_jobs (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_jobs (BuilderContext *self,
rpm-build c487f7
                                          int n_jobs);
rpm-build c487f7
void            builder_context_set_keep_build_dirs (BuilderContext *self,
rpm-build c487f7
                                                     gboolean        keep_build_dirs);
rpm-build c487f7
gboolean        builder_context_get_delete_build_dirs (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_delete_build_dirs (BuilderContext *self,
rpm-build c487f7
                                                       gboolean        delete_build_dirs);
rpm-build c487f7
gboolean        builder_context_get_keep_build_dirs (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_sandboxed (BuilderContext *self,
rpm-build c487f7
                                               gboolean        sandboxed);
rpm-build c487f7
gboolean        builder_context_get_sandboxed (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_global_cleanup (BuilderContext *self,
rpm-build c487f7
                                                    const char    **cleanup);
rpm-build c487f7
const char **   builder_context_get_global_cleanup (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_global_cleanup_platform (BuilderContext *self,
rpm-build c487f7
                                                             const char    **cleanup);
rpm-build c487f7
const char **   builder_context_get_global_cleanup_platform (BuilderContext *self);
rpm-build c487f7
BuilderOptions *builder_context_get_options (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_options (BuilderContext *self,
rpm-build c487f7
                                             BuilderOptions *option);
rpm-build c487f7
gboolean        builder_context_get_build_runtime (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_build_runtime (BuilderContext *self,
rpm-build c487f7
                                                   gboolean        build_runtime);
rpm-build c487f7
gboolean        builder_context_get_build_extension (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_build_extension (BuilderContext *self,
rpm-build c487f7
                                                     gboolean        build_extension);
rpm-build c487f7
gboolean        builder_context_get_separate_locales (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_separate_locales (BuilderContext *self,
rpm-build c487f7
                                                      gboolean        separate_locales);
rpm-build c487f7
void            builder_context_set_bundle_sources (BuilderContext *self,
rpm-build c487f7
                                                    gboolean        bundle_sources);
rpm-build c487f7
gboolean        builder_context_get_bundle_sources (BuilderContext *self);
rpm-build c487f7
gboolean        builder_context_get_rebuild_on_sdk_change (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_rebuild_on_sdk_change (BuilderContext *self,
rpm-build c487f7
                                                           gboolean        rebuild_on_sdk_change);
rpm-build c487f7
char *          builder_context_get_checksum_for (BuilderContext *self,
rpm-build c487f7
                                                  const char *name);
rpm-build c487f7
gboolean        builder_context_set_checksum_for (BuilderContext  *self,
rpm-build c487f7
                                                  const char      *name,
rpm-build c487f7
                                                  const char      *checksum,
rpm-build c487f7
                                                  GError         **error);
rpm-build c487f7
rpm-build c487f7
BuilderContext *builder_context_new (GFile *run_dir,
rpm-build c487f7
                                     GFile *app_dir,
rpm-build c487f7
                                     const char *state_subdir);
rpm-build c487f7
gboolean        builder_context_set_enable_ccache (BuilderContext *self,
rpm-build c487f7
                                                   gboolean        enabled,
rpm-build c487f7
                                                   GError        **error);
rpm-build c487f7
gboolean        builder_context_enable_rofiles (BuilderContext *self,
rpm-build c487f7
                                                GError        **error);
rpm-build c487f7
gboolean        builder_context_disable_rofiles (BuilderContext *self,
rpm-build c487f7
                                                 GError        **error);
rpm-build c487f7
gboolean        builder_context_get_rofiles_active (BuilderContext *self);
rpm-build c487f7
gboolean        builder_context_get_use_rofiles (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_use_rofiles (BuilderContext *self,
rpm-build c487f7
                                                 gboolean use_rofiles);
rpm-build c487f7
gboolean        builder_context_get_run_tests (BuilderContext *self);
rpm-build c487f7
void            builder_context_set_run_tests (BuilderContext *self,
rpm-build c487f7
                                               gboolean run_tests);
rpm-build c487f7
void            builder_context_set_no_shallow_clone (BuilderContext *self,
rpm-build c487f7
                                                      gboolean        no_shallow_clone);
rpm-build c487f7
gboolean        builder_context_get_no_shallow_clone (BuilderContext *self);
rpm-build c487f7
char **         builder_context_extend_env_pre (BuilderContext *self,
rpm-build c487f7
                                                 char          **envp);
rpm-build c487f7
char **         builder_context_extend_env_post (BuilderContext *self,
rpm-build c487f7
                                                 char          **envp);
rpm-build c487f7
rpm-build c487f7
gboolean        builder_context_load_sdk_config (BuilderContext       *self,
rpm-build c487f7
                                                 const char           *sdk_path,
rpm-build c487f7
                                                 GError              **error);
rpm-build c487f7
rpm-build c487f7
BuilderSdkConfig * builder_context_get_sdk_config (BuilderContext *self);
rpm-build c487f7
rpm-build c487f7
G_DEFINE_AUTOPTR_CLEANUP_FUNC (BuilderContext, g_object_unref)
rpm-build c487f7
rpm-build c487f7
G_END_DECLS
rpm-build c487f7
rpm-build c487f7
#endif /* __BUILDER_CONTEXT_H__ */