def build(self, force=False): self.makedirs() self.notify_part_progress('Building') self.code.build() self.mark_done( 'build', states.BuildState(self.build_properties, self.code.options))
def mark_build_done(self): build_properties = self.code.get_build_properties() self.mark_done( 'build', states.BuildState(build_properties, self._part_properties, self._project_options))
def mark_build_done(self): build_properties = self.plugin.get_build_properties() plugin_manifest = self.plugin.get_manifest() machine_manifest = self._get_machine_manifest() self.mark_done('build', states.BuildState( build_properties, self._part_properties, self._project_options, plugin_manifest, machine_manifest))
def mark_build_done(self): build_properties = self.code.get_build_properties() # TODO figure out # build_properties.extend(['disable-parallel']) self.mark_done('build', states.BuildState( build_properties, self._part_properties, self._project_options))
def mark_build_done(self): build_properties = self.plugin.get_build_properties() plugin_manifest = self.plugin.get_manifest() machine_manifest = self._get_machine_manifest() # Extract any requested metadata available in the build directory, # followed by the install directory (which takes precedence) metadata_files = [] metadata = snapcraft.extractors.ExtractedMetadata() for path in self._part_properties.get("parse-info", []): file_path = os.path.join(self.plugin.builddir, path) found = False with contextlib.suppress(errors.MissingMetadataFileError): metadata.update(extract_metadata(self.name, file_path)) found = True file_path = os.path.join(self.plugin.installdir, path) with contextlib.suppress(errors.MissingMetadataFileError): metadata.update(extract_metadata(self.name, file_path)) found = True if found: metadata_files.append(path) else: # If this metadata file is not found in either build or # install, check the pull state to make sure it was found # there. If not, we need to let the user know. state = self.get_pull_state() if not state or path not in state.extracted_metadata["files"]: raise errors.MissingMetadataFileError(self.name, path) self.mark_done( steps.BUILD, states.BuildState( property_names=build_properties, part_properties=self._part_properties, project=self._project_options, plugin_assets=plugin_manifest, machine_assets=machine_manifest, metadata=metadata, metadata_files=metadata_files, scriptlet_metadata=self._scriptlet_metadata[steps.BUILD], ), )
def build_state_variant(request): """Return variants of build_state.""" project, property_names, part_properties = request.param return states.BuildState(property_names, part_properties, project)
def build_state(): """Return a BuildState.""" project, property_names, part_properties = _DEFAULT return states.BuildState(property_names, part_properties, project)