From 10aa8f0539031315099f444ed5fa0e3f0bf590bc Mon Sep 17 00:00:00 2001 From: YuCheng Hu Date: Thu, 12 Sep 2019 17:08:03 -0400 Subject: [PATCH] Replace to use Gradle build system build the jar --- build.gradle | 105 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 build.gradle diff --git a/build.gradle b/build.gradle new file mode 100644 index 0000000..681d73f --- /dev/null +++ b/build.gradle @@ -0,0 +1,105 @@ +plugins { + id "org.asciidoctor.convert" version "2.3.0" +} + +apply plugin: 'java' + +version = '1.0.0' + +allprojects { + repositories { + maven { url "https://maven.ossez.com/repository/internal" } + } + + ext { + environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql' + + docResourcesVersion = '0.1.0' + } + + apply plugin: 'idea' +} + +configurations { + docs +} + +dependencies { + compile group: 'log4j', name: 'log4j', version: '1.2.9' + + compile group: 'commons-logging', name: 'commons-logging', version: '1.1.1' + compile group: 'commons-lang', name: 'commons-lang', version: '2.4' + compile group: 'commons-codec', name: 'commons-codec', version: '1.3' + compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.1.1' + + compile group: 'com.google.guava', name: 'guava', version: '11.0.1' + + compile 'jdom:jdom:1.0' + + testCompile 'junit:junit:3.8.1' + + docs "com.ossez.docresources:ossez-doc-resources:${docResourcesVersion}@zip" +} + +task prepareAsciidocBuildZH(type: Sync) { + dependsOn configurations.docs + // copy doc resources + from { + configurations.docs.collect { zipTree(it) } + } + // and doc sources + from "src/docs/asciidoc/" + // to a build directory of your choice + into "$buildDir/asciidoc/assemble" + +} + +task('makePDFZH', type: org.asciidoctor.gradle.AsciidoctorTask){ + dependsOn prepareAsciidocBuildZH + backends 'pdf' + sourceDir "$buildDir/asciidoc/assemble" + sources { + include 'index-single.adoc' + } + options doctype: 'book', eruby: 'erubis' + logDocuments = true + attributes 'icons': 'font', + 'sectanchors': '', + 'sectnums': '', + 'toc': '', + 'source-highlighter' : 'coderay', + revnumber: project.version +} + + + +asciidoctor { + dependsOn makePDFZH + backends 'html5' + sourceDir "$buildDir/asciidoc/assemble" + resources { + from(sourceDir) { + include 'images/*', 'css/**', 'js/**' + } + } + options doctype: 'book', eruby: 'erubis' + logDocuments = true + attributes 'docinfo': 'shared', + // use provided stylesheet + stylesdir: "css/", + stylesheet: 'ossez.css', + 'linkcss': true, + 'icons': 'font', + 'sectanchors': '', + // use provided highlighter + 'source-highlighter=highlight.js', + 'highlightjsdir=js/highlight', + 'highlightjs-theme=atom-one-dark-reasonable', + 'idprefix': '', + 'idseparator': '-', + 'spring-version': project.version, + 'allow-uri-read': '', + revnumber: project.version +} + +