From 87c9269152f8c631123525b796cf07dc0cca7398 Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Wed, 5 Feb 2014 09:20:54 +0100 Subject: Documentation + Documentation building --- pdf-as-lib/build.gradle | 106 ++++++++++++++++++++------------ pdf-as-lib/doc.sh | 17 +++++ pdf-as-lib/libs/config_pdfas.properties | 64 +++++++++++++++++++ pdf-as-lib/libs/pdfdoclet-1.0.3-all.jar | Bin 0 -> 2373872 bytes 4 files changed, 147 insertions(+), 40 deletions(-) create mode 100755 pdf-as-lib/doc.sh create mode 100644 pdf-as-lib/libs/config_pdfas.properties create mode 100644 pdf-as-lib/libs/pdfdoclet-1.0.3-all.jar (limited to 'pdf-as-lib') diff --git a/pdf-as-lib/build.gradle b/pdf-as-lib/build.gradle index 7145ffdb..788c6361 100644 --- a/pdf-as-lib/build.gradle +++ b/pdf-as-lib/build.gradle @@ -2,9 +2,9 @@ apply plugin: 'java' apply plugin: 'eclipse' jar { - manifest { - attributes 'Implementation-Title': 'PDF-AS-4 Library', 'Implementation-Version': version, 'JARMANIFEST': 'PDF-AS-LIB' - } + manifest { + attributes 'Implementation-Title': 'PDF-AS-4 Library', 'JARMANIFEST': 'PDF-AS-LIB' + } } buildscript { @@ -12,13 +12,13 @@ buildscript { mavenLocal() mavenCentral() } - dependencies { - classpath("commons-io:commons-io:2.4") - } + dependencies { classpath("commons-io:commons-io:2.4") } } -configurations { - generateJavaFromWsdlDeps +configurations { + generateJavaFromWsdlDeps + + pdfDoclet { extendsFrom compile } } task createConf(type: Zip, dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) { @@ -29,33 +29,11 @@ task createConf(type: Zip, dependsOn: JavaPlugin.PROCESS_RESOURCES_TASK_NAME) { compileJava.dependsOn(createConf) -/*task generateJavaFromWsdl(type: JavaExec) { - classpath configurations.generateJavaFromWsdlDeps - //main "org.apache.cxf.tools.wsdlto.WSDLToJava" - main "org.apache.axis.wsdl.WSDL2Java" - args "-o " + projectDir + "/src/main/java", "-v", "" + projectDir + "/src/main/resources/wsdl/MOA-SPSS-1.3.wsdl" - - compileJava.dependsOn += name - - def branch = new org.apache.commons.io.output.ByteArrayOutputStream() - errorOutput = new org.apache.commons.io.output.TeeOutputStream(System.err, branch) - doLast { - def str = branch.toString() - if (str.contains('Usage : wsdl2java') || str.contains('WSDLToJava Error')) { - throw new TaskExecutionException( - tasks[name], - new IOException("WSDLToJava has failed, please see output") - ) - } - } -}*/ repositories { mavenLocal() - mavenCentral() - maven { - url "http://nexus.iaik.tugraz.at/nexus/content/groups/internal" - } + mavenCentral() + maven { url "http://nexus.iaik.tugraz.at/nexus/content/groups/internal" } } dependencies { @@ -65,7 +43,7 @@ dependencies { compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '1.8.2' compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.1' compile group: 'org.apache.commons', name: 'commons-io', version: '1.3.2' - compile group: 'commons-collections', name: 'commons-collections', version: '3.2' + compile group: 'commons-collections', name: 'commons-collections', version: '3.2' compile group: 'org.apache.axis2', name: 'axis2', version: '1.6.2' compile group: 'org.apache.axis2', name: 'axis2-jaxws', version: '1.6.2' compile group: 'org.apache.axis2', name: 'axis2-transport-local', version: '1.6.2' @@ -79,17 +57,65 @@ dependencies { compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.5' compile group: 'com.google.zxing', name: 'core', version: '2.2' compile group: 'com.google.zxing', name: 'javase', version: '2.2' - testCompile group: 'junit', name: 'junit', version: '4.+' + pdfDoclet files('libs/pdfdoclet-1.0.3-all.jar') + testCompile group: 'junit', name: 'junit', version: '4.+' +} + +/*javadoc { + revision = getCheckedOutGitCommitHash() + project.configure(options) { + memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + charSet = "ISO-8859-1" + docTitle = "PDF-AS 4.0 Library" + exclude = '/**' + include = 'at/gv/egiz/pdfas/lib/api/**' + windowTitle = "PDF-AS 4.0 Library" + header = "PDF-AS 4.0 Library $version [$revision]" + use = "true" + links("http://java.sun.com/j2ee/1.4/docs/api", "http://java.sun.com/j2se/1.5.0/docs/api") + } +}*/ + +task apidocs(type: Javadoc) { + classpath = configurations.compile + source = sourceSets.main.allJava + project.configure(options) { + destinationDir = new File(projectDir, '../docs') + memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + charSet = "ISO-8859-1" + docTitle = "PDF-AS " + pdfasversion + " Documentation" + version = pdfasversion + include = include('at/gv/egiz/pdfas/lib/api/**') + windowTitle = "PDF-AS " + pdfasversion + " Library" + header = "PDF-AS " + pdfasversion + " Library " + pdfasversion + " [" + revision + "]" + use = "true" + links("http://java.sun.com/j2ee/1.4/docs/api", "http://java.sun.com/j2se/1.5.0/docs/api") + } +} + +/*task apidocspdf(type: Javadoc) { + classpath = configurations.compile + source = sourceSets.main.allJava + options.docletpath = configurations.pdfDoclet.files.asType(List) + options.doclet = "com.tarsec.javadoc.pdfdoclet.PDFDoclet" + options.addStringOption("pdf", "../docs/api.pdf") +}*/ + +task apidocspdf << { + def proc = "./doc.sh".execute() + proc.in.eachLine {line -> println line} + proc.err.eachLine {line -> println 'ERROR: ' + line} + proc.waitFor() } test { - systemProperties 'property': 'value' + systemProperties 'property': 'value' } uploadArchives { - repositories { - flatDir { - dirs 'repos' - } - } + repositories { + flatDir { + dirs 'repos' + } + } } diff --git a/pdf-as-lib/doc.sh b/pdf-as-lib/doc.sh new file mode 100755 index 00000000..20bc22d7 --- /dev/null +++ b/pdf-as-lib/doc.sh @@ -0,0 +1,17 @@ + #!/bin/sh + +# Set the JAVA_HOME variable correctly !! +#JAVA_HOME=/usr/local/java/j2se + +#PATH=$JAVA_HOME/bin + +DOCLET=com.tarsec.javadoc.pdfdoclet.PDFDoclet +JARS=./libs/pdfdoclet-1.0.3-all.jar +PACKAGES="at.gv.egiz.pdfas.lib.api at.gv.egiz.pdfas.lib.api.sign at.gv.egiz.pdfas.lib.api.verify" +PDF=../docs/PDF_AS_API.pdf +CFG=./libs/config_pdfas.properties +SRC=./src/main/java + +export DOCLET JARS PACKAGES PDF CFG SRC + +javadoc -doclet $DOCLET -docletpath $JARS -pdf $PDF -config $CFG -sourcepath $SRC $PACKAGES diff --git a/pdf-as-lib/libs/config_pdfas.properties b/pdf-as-lib/libs/config_pdfas.properties new file mode 100644 index 00000000..36302789 --- /dev/null +++ b/pdf-as-lib/libs/config_pdfas.properties @@ -0,0 +1,64 @@ +# +# Example configuration for "laby.pdf" +# + +# Prints @author tags if set to "yes". +tag.author=no + +# Prints @version tags if set to "yes". +tag.version=no + +# Prints @since tags if set to "yes". +tag.since=no + +# Show the Summary Tables if set to "yes". +summary.table=yes + +# Encrypts the document if set to "yes". +encrypted=no + +# The following property is ignored +# if "encrypted" is not set to yes. +allow.printing=yes + +# Creates hyperlinks if set to "yes". +# For print documents, use "no", so +# there will be no underscores. +create.links=yes + +# Creates an alphabetical index of all +# classes and members at the end of the +# document if set to "yes". +create.index=yes + +# Creates a navigation frame (or PDF +# outline tree) if set to "yes". +create.frame=yes + +# Creates a title page at the beginning +# of the document if set to "yes". +api.title.page=yes + +# Defines the path of the HTML file that +# should be used as the title page. +#api.title.file=example/laby/laby_title.html + +# Defines the title on the title page if +# no external HTML page is used. +api.title=PDF-AS 4.0 Documentation + +# Defines the copyright text on the +# title page. +api.copyright=EGIZ E-Government Innovationszentrum + +# Defines the author text on the +# title page. +#api.author= + +# Defines packages whose classes should not +# be printed fully qualified. For example, every +# Java developer probably knows that "String" is in +# the "java.lang" package, so instead of wasting +# page spage, just get rid of that package qualifier: +# dontspec=java.lang +dontspec=java.lang,java.io,java.util diff --git a/pdf-as-lib/libs/pdfdoclet-1.0.3-all.jar b/pdf-as-lib/libs/pdfdoclet-1.0.3-all.jar new file mode 100644 index 00000000..61d5d81b Binary files /dev/null and b/pdf-as-lib/libs/pdfdoclet-1.0.3-all.jar differ -- cgit v1.2.3