From 80bd9d681e5240bc33672760717d77121148129f Mon Sep 17 00:00:00 2001 From: Mark Vogelgesang Date: Sun, 1 Jan 2017 23:36:20 -0500 Subject: [PATCH 1/2] "#65 Updated to allow for user to set directory where ApexDoc html files will be placed. Defaults to the former constant, ApexDocumentation." --- src/org/salesforce/apexdoc/ApexDoc.java | 4 +-- src/org/salesforce/apexdoc/Constants.java | 29 ++++++++++----------- src/org/salesforce/apexdoc/FileManager.java | 7 ----- 3 files changed, 16 insertions(+), 24 deletions(-) diff --git a/src/org/salesforce/apexdoc/ApexDoc.java b/src/org/salesforce/apexdoc/ApexDoc.java index 8da4f97..674239f 100644 --- a/src/org/salesforce/apexdoc/ApexDoc.java +++ b/src/org/salesforce/apexdoc/ApexDoc.java @@ -52,7 +52,7 @@ public void run(IProgressMonitor monitor) throws InvocationTargetException, Inte // Eclipse PlugIn invocation public static void RunApexDoc(String[] args, IProgressMonitor monitor) { String sourceDirectory = ""; - String targetDirectory = ""; + String targetDirectory = "ApexDocumentation"; String homefilepath = ""; String authorfilepath = ""; String hostedSourceURL = ""; @@ -138,7 +138,7 @@ private static void printHelp() { System.out.println(" Invalid Arguments detected. The correct syntax is:\n"); System.out.println("apexdoc -s [-t ] [-g ] [-h ] [-a ] [-p ]\n"); System.out.println(" - The folder location which contains your apex .cls classes"); - System.out.println(" - Optional. Specifies your target folder where documentation will be generated."); + System.out.println(" - Optional. Specifies your target folder where documentation will be generated. Defaults to ApexDocumentation."); System.out.println(" - Optional. Specifies a URL where the source is hosted (so ApexDoc can provide links to your source)."); System.out.println(" - Optional. Specifies the html file that contains the contents for the home page\'s content area."); System.out.println(" - Optional. Specifies the text file that contains project information for the documentation header."); diff --git a/src/org/salesforce/apexdoc/Constants.java b/src/org/salesforce/apexdoc/Constants.java index 9e808bc..0221b46 100644 --- a/src/org/salesforce/apexdoc/Constants.java +++ b/src/org/salesforce/apexdoc/Constants.java @@ -1,36 +1,35 @@ package org.salesforce.apexdoc; public class Constants { - + public static final String HEADER_OPEN = "" + "" + - "" + - "" + - " " + + "" + + "" + + " " + "" + ""; - - public static final String HEADER_CLOSE = + + public static final String HEADER_CLOSE = "" + "" + "" + ""; - - public static final String FOOTER = "
" + - "
Powered By ApexDoc" + + + public static final String FOOTER = "
" + + "
Powered By ApexDoc" + "
"; - public static final String ROOT_DIRECTORY = "ApexDocumentation"; public static final String DEFAULT_HOME_CONTENTS = "

Project Home

"; - public static final String PROJECT_DETAIL = + public static final String PROJECT_DETAIL = "
" + "" + "" + - "
" + "" + "" + + "" + "

Project Demo

" + - "Check out the gitHub project at:
" + + "Check out the gitHub project at:
" + "http://github.com/SalesforceFoundation/ApexDoc
"; public static String getHeader(String projectDetail) { @@ -42,5 +41,5 @@ public static String getHeader(String projectDetail) { } return header; } - -} \ No newline at end of file + +} diff --git a/src/org/salesforce/apexdoc/FileManager.java b/src/org/salesforce/apexdoc/FileManager.java index 86ed5ad..5f307d3 100644 --- a/src/org/salesforce/apexdoc/FileManager.java +++ b/src/org/salesforce/apexdoc/FileManager.java @@ -52,12 +52,6 @@ public FileManager(String path) { private boolean createHTML(TreeMap mapFNameToContent, IProgressMonitor monitor) { try { - if (path.endsWith("/") || path.endsWith("\\")) { - path += Constants.ROOT_DIRECTORY; // + "/" + fileName + ".html"; - } else { - path += "/" + Constants.ROOT_DIRECTORY; // + "/" + fileName + ".html"; - } - (new File(path)).mkdirs(); for (String fileName : mapFNameToContent.keySet()) { @@ -382,7 +376,6 @@ private String getPageLinks(TreeMap mapGroupNameToClassGroup } private void docopy(String source, String target) throws Exception { - InputStream is = this.getClass().getResourceAsStream(source); // InputStreamReader isr = new InputStreamReader(is); // BufferedReader reader = new BufferedReader(isr); From 61f758f6364b4a5a5ea6432482016e870fee24bd Mon Sep 17 00:00:00 2001 From: Mark Vogelgesang Date: Sun, 1 Jan 2017 23:37:46 -0500 Subject: [PATCH 2/2] "#65 Updated version in pom.xml to be consistent with release versions. Added version number for maven-jar-plugin to resolve Maven errors." --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 2705bf0..dcff23a 100644 --- a/pom.xml +++ b/pom.xml @@ -2,7 +2,7 @@ 4.0.0 ApexDoc ApexDoc - 1.2.0-SNAPSHOT + 1.1.8 ApexDoc A documentation generator for Apex using JavaDoc style comment blocks @@ -30,6 +30,7 @@ org.apache.maven.plugins maven-jar-plugin + 3.0.0