2019-09-12 17:08:03 -04:00
|
|
|
plugins {
|
2019-09-13 10:22:08 -04:00
|
|
|
id 'maven-publish'
|
2019-09-12 17:08:03 -04:00
|
|
|
id "org.asciidoctor.convert" version "2.3.0"
|
|
|
|
}
|
|
|
|
|
|
|
|
apply plugin: 'java'
|
|
|
|
|
2019-09-13 10:22:08 -04:00
|
|
|
group = 'com.ossez.reoc'
|
|
|
|
version = '0.1.0'
|
2019-09-12 17:08:03 -04:00
|
|
|
|
|
|
|
allprojects {
|
|
|
|
repositories {
|
|
|
|
maven { url "https://maven.ossez.com/repository/internal" }
|
2019-09-13 10:22:08 -04:00
|
|
|
mavenLocal()
|
2019-09-12 17:08:03 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2019-09-13 10:22:08 -04:00
|
|
|
task('makePDFZH', type: org.asciidoctor.gradle.AsciidoctorTask) {
|
2019-09-12 17:08:03 -04:00
|
|
|
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': '',
|
2019-09-13 10:22:08 -04:00
|
|
|
'source-highlighter': 'coderay',
|
2019-09-12 17:08:03 -04:00
|
|
|
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
|
|
|
|
}
|
2019-09-13 10:22:08 -04:00
|
|
|
task sourcesJar(type: Jar) {
|
|
|
|
from sourceSets.main.allJava
|
|
|
|
archiveClassifier = 'sources'
|
|
|
|
}
|
2019-09-12 17:08:03 -04:00
|
|
|
|
2019-09-13 10:22:08 -04:00
|
|
|
task javadocJar(type: Jar) {
|
|
|
|
from javadoc
|
|
|
|
archiveClassifier = 'javadoc'
|
|
|
|
}
|
2019-09-12 17:08:03 -04:00
|
|
|
|
2019-09-13 10:22:08 -04:00
|
|
|
publishing {
|
|
|
|
publications {
|
|
|
|
maven(MavenPublication) {
|
|
|
|
from components.java
|
|
|
|
artifact sourcesJar
|
|
|
|
artifact javadocJar
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|