Skip to content

Commit

Permalink
Add useMakeMode option
Browse files Browse the repository at this point in the history
  • Loading branch information
trustin committed Apr 5, 2020
1 parent 83387c9 commit 4a205f2
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
12 changes: 9 additions & 3 deletions src/main/java/kr/motd/maven/sphinx/SphinxMojo.java
Expand Up @@ -166,6 +166,12 @@ public class SphinxMojo extends AbstractMojo implements MavenReport {
@Parameter(property = "sphinx.doctreeCacheDir", defaultValue = "${project.reporting.outputDirectory}/.doctrees", required = true, alias = "doctreeCacheDir")
private File doctreeCacheDir;

/**
* Whether Sphinx should use 'make mode' ({@code -M} option) instead of 'build mode' ({@code -b} option).
*/
@Parameter(property = "sphinx.useMakeMode", defaultValue = "false", required = true, alias = "useMakeMode")
private boolean useMakeMode;


@Override
public void execute() throws MojoExecutionException {
Expand Down Expand Up @@ -348,6 +354,9 @@ public boolean canGenerateReport() {
private List<String> getSphinxRunnerCmdLine(File sourceDirectory, File outputDirectory, File doctreeCacheDir) {
final List<String> args = new ArrayList<>();

args.add(useMakeMode ? "-M" : "-b");
args.add(builder);

if (verbose) {
args.add("-v");
} else {
Expand Down Expand Up @@ -381,9 +390,6 @@ private List<String> getSphinxRunnerCmdLine(File sourceDirectory, File outputDir

args.add("-n");

args.add("-b");
args.add(builder);

args.add(sourceDirectory.getPath());
args.add(outputDirectory.getPath());

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/kr/motd/maven/sphinx/SphinxRunner.java
Expand Up @@ -43,7 +43,7 @@ public class SphinxRunner {
private static final OsDetector osDetector = new OsDetector();

public static final String DEFAULT_BINARY_URL =
"https://github.com/trustin/sphinx-binary/releases/download/v0.8.0/sphinx." +
"https://github.com/trustin/sphinx-binary/releases/download/v0.8.1/sphinx." +
osDetector.executableSuffix();

private static final String VERSION;
Expand Down
4 changes: 2 additions & 2 deletions src/site/sphinx/conf.py
Expand Up @@ -20,8 +20,8 @@

project = u'sphinx-maven-plugin'
copyright = u'2016, Trustin Lee et al'
version = '2.8'
release = '2.8.0'
version = '2.9'
release = '2.9.0'

# General options
needs_sphinx = '1.0'
Expand Down
1 change: 1 addition & 0 deletions src/site/sphinx/configuration.rst
Expand Up @@ -27,6 +27,7 @@ Parameter Description
``skip`` Whether Sphinx execution should be skipped. ``false``
``useDoctreeCache`` Whether doctree cache should be used. ``false``
``doctreeCacheDir`` The directory containing Sphinx doctree cache. Used only when ``useDoctreeCache`` is ``true`` ``${project.reporting.outputDirectory}/.doctrees``
``useMakeMode`` Whether Sphinx should use 'make mode' (``-M`` option) instead of 'build mode' (``-b`` option). ``false``
======================== ================================================================================================= ==================================================

Sample Documentation Config
Expand Down

0 comments on commit 4a205f2

Please sign in to comment.