Skip to content

Commit

Permalink
0001420: Generate property documentation automatically from symmetric…
Browse files Browse the repository at this point in the history
…-server.conf
  • Loading branch information
erilong committed Feb 14, 2014
1 parent a16b3a7 commit 50ddd73
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 3 deletions.
20 changes: 18 additions & 2 deletions symmetric-assemble/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,22 @@
<artifactId>exec-maven-plugin</artifactId>
<version>1.2.1</version>
<executions>
<execution>
<id>generate-server-parameters</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<includePluginDependencies>true</includePluginDependencies>
<mainClass>org.jumpmind.properties.DefaultParameterParser</mainClass>
<arguments>
<argument>${basedir}/../symmetric-server/src/main/deploy/conf/symmetric-server.properties</argument>
<argument>${docbook.build}/server-parameters.xml</argument>
<argument>false</argument>
</arguments>
</configuration>
</execution>
<execution>
<id>generate-startup-parameters</id>
<phase>generate-sources</phase>
Expand All @@ -171,7 +187,7 @@
<includePluginDependencies>true</includePluginDependencies>
<mainClass>org.jumpmind.properties.DefaultParameterParser</mainClass>
<arguments>
<argument>/symmetric-default.properties</argument>
<argument>classpath:/symmetric-default.properties</argument>
<argument>${docbook.build}/startup-parameters.xml</argument>
<argument>false</argument>
</arguments>
Expand All @@ -187,7 +203,7 @@
<includePluginDependencies>true</includePluginDependencies>
<mainClass>org.jumpmind.properties.DefaultParameterParser</mainClass>
<arguments>
<argument>/symmetric-default.properties</argument>
<argument>classpath:/symmetric-default.properties</argument>
<argument>${docbook.build}/runtime-parameters.xml</argument>
<argument>true</argument>
</arguments>
Expand Down
9 changes: 9 additions & 0 deletions symmetric-assemble/src/docbook/parameters.xml
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,13 @@
<xi:include href="runtime-parameters.xml" />
</para>
</section>
<section id="ap01-server">
<title>Server Configuration</title>
<para>
Server configuration is read from <literal>conf/symmetric-server.conf</literal> for settings needed by the server
before the parameter system has been initialized.
<xi:include href="server-parameters.xml" />
</para>
</section>

</appendix>
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
*/
package org.jumpmind.properties;

import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
Expand All @@ -30,6 +31,7 @@
import java.util.Set;
import java.util.TreeMap;

import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
Expand Down Expand Up @@ -111,7 +113,12 @@ public static void main(String[] args) throws Exception {
if (args.length == 0) {
System.err.println("Usage: <input_properties_file> <output_docbook_file> [true|false]");
}
DefaultParameterParser parmParser = new DefaultParameterParser(args[0]);
DefaultParameterParser parmParser = null;
if (args[0].startsWith("classpath:")) {
parmParser = new DefaultParameterParser(args[0].replaceAll("classpath:", ""));
} else {
parmParser = new DefaultParameterParser(FileUtils.openInputStream(new File(args[0])));
}
FileWriter writer = new FileWriter(args[1]);
boolean isDatabaseOverridable = Boolean.parseBoolean(args[2]);
Map<String, ParameterMetaData> map = parmParser.parse();
Expand Down

0 comments on commit 50ddd73

Please sign in to comment.