Job constructor

Job({
  1. required String name,
  2. String? key,
  3. required String? description,
  4. required String packageName,
  5. Map<String, dynamic>? environments,
  6. BuilderJob? builder,
  7. PublisherJob? publisher,
})

Creates a new Job instance.

  • name is the name of the job.
  • platform is the platform for which the job is executed.
  • mode is the mode of the job (build or publish).
  • packageName is the package name associated with the job.
  • arguments are the arguments associated with the job.
  • key is the unique key of the job (optional).
  • description is the description of the job (optional).
  • environments are the environment variables for the job (optional).

Implementation

Job({
  required this.name,
  this.key,
  required this.description,
  required this.packageName,
  this.environments,
  this.builder,
  this.publisher,
}) : assert(
       (builder != null && publisher == null) ||
           (builder == null && publisher != null),
       "Either builder or publisher must be provided, not both.",
     ) {
  if (builder != null) {
    builder?.parent = this;
  } else if (publisher != null) {
    publisher?.parent = this;
  } else {
    throw Exception("Either builder or publisher must be provided.");
  }
}