Job constructor
Job({
- required String name,
- String? key,
- required String? description,
- required String packageName,
- Map<
String, dynamic> ? environments, - BuilderJob? builder,
- PublisherJob? publisher,
Creates a new Job instance.
nameis the name of the job.platformis the platform for which the job is executed.modeis the mode of the job (build or publish).packageNameis the package name associated with the job.argumentsare the arguments associated with the job.keyis the unique key of the job (optional).descriptionis the description of the job (optional).environmentsare 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.");
}
}