Skip to content

Commit

Permalink
[#18] Support logicalVersion in create/edit manifest mojos
Browse files Browse the repository at this point in the history
  • Loading branch information
spyrkob committed Nov 1, 2024
1 parent 32e353a commit 9c2e5a1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Set;
import java.util.TreeSet;
Expand Down Expand Up @@ -62,6 +63,12 @@ public class CreateManifestMojo extends AbstractMojo {
@Parameter(name="manifestDescription", property = "manifestDescription")
private String manifestDescription;

/**
* Optional logicalVersion of the generated manifest.
*/
@Parameter(name="manifestLogicalVersion", property = "manifestLogicalVersion")
private String manifestLogicalVersion;

@Inject
private MavenProject project;

Expand Down Expand Up @@ -125,7 +132,7 @@ public void execute() throws MojoExecutionException, MojoFailureException {
}


final ChannelManifest channelManifest = new ChannelManifest(manifestName, manifestId, manifestDescription, streams);
final ChannelManifest channelManifest = new ChannelManifest(manifestName, manifestId, manifestLogicalVersion, manifestDescription, Collections.emptyList(), streams);

try {
final String yaml = ChannelManifestMapper.toYaml(channelManifest);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ public class EditManifestMojo extends AbstractMojo {
@Parameter(name="manifestRequirements")
private List<Requirement> manifestRequirements;

/**
* Optional logicalVersion of the generated manifest.
*/
@Parameter(name="manifestLogicalVersion")
private String manifestLogicalVersion;

@Override
public void execute() throws MojoExecutionException {
final Path streamsManifestFile = Path.of(manifestPath);
Expand Down Expand Up @@ -88,6 +94,7 @@ public void execute() throws MojoExecutionException {
final ChannelManifest combinedManifest = new ChannelManifest(source.getSchemaVersion(),
manifestName,
manifestId,
manifestLogicalVersion,
manifestDescription,
requirements,
source.getStreams());
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
<maven.version>3.6.3</maven.version> <!-- Note that PME depends on 3.5.0 -->
<maven-resolver.version>1.6.2</maven-resolver.version>
<pme.version>4.7</pme.version>
<channel.version>1.1.0.Final</channel.version>
<channel.version>1.2.1.Final</channel.version>
<jupiter.version>5.7.2</jupiter.version>
<assertj.version>3.22.0</assertj.version>
<itf.version>0.13.1</itf.version>
<itf.version>0.12.0</itf.version>
</properties>

<dependencyManagement>
Expand Down

0 comments on commit 9c2e5a1

Please sign in to comment.