createArtifact function

Result<Artifact> createArtifact(
  1. JbConfiguration config
)

Implementation

Result<Artifact> createArtifact(JbConfiguration config) {
  Never Function() mandatory(String what) =>
      () => _fail('"$what" must be provided in the jb configuration file.');
  return catching$(() => (
        group: config.group.ifBlank(mandatory('group')),
        module: config.module.ifBlank(mandatory('module')),
        name: config.name.ifBlank(mandatory('name')),
        version: config.version.ifBlank(mandatory('version')),
        description: config.description,
        developers: config.developers,
        scm: config.scm,
        url: config.url,
        licenses: config.licenses
            .map((id) => allLicenses[id].orThrow(() => invalidLicense([id])))
            .toList(),
      ));
}