createGeneratePomTask function

Task createGeneratePomTask(
  1. Result<Artifact> artifact,
  2. Iterable<MapEntry<String, DependencySpec>> dependencies,
  3. ResolvedLocalDependencies localDependencies
)

Create the generatePom task.

Implementation

Task createGeneratePomTask(
    Result<Artifact> artifact,
    Iterable<MapEntry<String, DependencySpec>> dependencies,
    ResolvedLocalDependencies localDependencies) {
  return Task(
      (List<String> args) => _pom(
          args,
          createPom(
              switch (artifact) {
                Ok(value: var theArtifact) => theArtifact,
                Fail(exception: var e) => throw e,
              },
              dependencies,
              localDependencies)),
      name: createPomTaskName,
      phase: publishPhase,
      runCondition: artifact.runCondition(),
      argsValidator: const OptionalArgValidator(
          'One argument may be provided: the POM destination'),
      description: 'Generate Maven POM for publishing the project');
}