Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfixes/210 fix livereload #225

Merged
merged 3 commits into from
Sep 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions aadarchi-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,12 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-vfs2</artifactId>
<version>2.9.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-hdfs-client</artifactId>
</exclusion>
</exclusions>
</dependency>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
import org.twdata.maven.mojoexecutor.MojoExecutor;
import org.twdata.maven.mojoexecutor.MojoExecutor.Element;

/**
* Generates html slide with a "correct" set of parameters.
* Those parameters specifically allow usage of revealjs.
* @author nicolas-delsaux
*
*/
@Mojo(name = "generate-html-slides", defaultPhase = LifecyclePhase.PREPARE_PACKAGE)
public class GenerateHtmlSlides extends AbstractAsciidoctorCallingMojo {
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import java.io.File;
import java.io.IOException;
import java.lang.annotation.Annotation;
import java.net.ServerSocket;
import java.nio.file.FileSystems;
import java.nio.file.Path;
Expand All @@ -37,9 +38,17 @@

import net_alchim31_livereload.LRServer; //#from net.alchim31:livereload-jvm:0.2.0

/**
* Allow faster edit loop by rebuilding documentation and making it available through live-reload protocol.
* @author nicolas-delsaux
*
*/
@Mojo(name = "livereload", defaultPhase = LifecyclePhase.PACKAGE)
public class LiveReload extends AbstractMojo {

@Parameter(defaultValue = "${mojo.groupId}")
private String mojoGroupId;
@Parameter(defaultValue = "${mojo.artifactId}")
private String mojoArtifactId;
@Component
private MavenProject mavenProject;

Expand Down Expand Up @@ -85,10 +94,7 @@ public class LiveReload extends AbstractMojo {
* </ul>
*/
@Parameter(name="goals-to-execute")
private List<String> goalsToExecute = Arrays.asList("prepare-package",
"io.github.Riduidel.agile-architecture-documentation-system:aadarchi-maven-plugin@generate-html-docs",
"io.github.Riduidel.agile-architecture-documentation-system:aadarchi-maven-plugin@generate-html-slides"
);
private List<String> goalsToExecute = null;

@Override
public void execute() throws MojoExecutionException, MojoFailureException {
Expand Down Expand Up @@ -130,8 +136,14 @@ public void execute() throws MojoExecutionException, MojoFailureException {
)
);
}

private Element[] goals() {
if(goalsToExecute==null) {
goalsToExecute = Arrays.asList("prepare-package",
String.format("%s:%s:generate-html-docs",mojoGroupId, mojoArtifactId),
String.format("%s:%s:generate-html-slides",mojoGroupId, mojoArtifactId)
);
}
// First, get our artifact name
return goalsToExecute.stream()
.map(text -> element(name("goal"), text))
Expand Down