Rets-Io/build.gradle

148 lines
3.8 KiB
Groovy
Raw Normal View History

plugins {
id 'maven-publish'
id "org.asciidoctor.convert" version "2.3.0"
}
apply plugin: 'java'
group = 'com.ossez.rets-io'
2019-10-18 15:15:59 -04:00
version = '0.1.1-SNAPSHOT'
sourceCompatibility = 1.8
targetCompatibility = 1.8
allprojects {
repositories {
maven { url "https://maven.ossez.com/repository/internal" }
mavenLocal()
}
ext {
environmentProperty = project.hasProperty('environment') ? getProperty('environment') : 'hsql'
docResourcesVersion = '0.1.0'
}
apply plugin: 'idea'
}
configurations {
docs
}
dependencies {
// LOG
compile 'ch.qos.logback:logback-classic:1.2.3'
// APACHE
compile group: 'commons-io', name: 'commons-io', version: '2.6'
compile group: 'commons-codec', name: 'commons-codec', version: '1.3'
compile group: 'org.apache.commons', name: 'commons-lang3', version: '3.9'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
// GOOGLE
compile group: 'com.google.guava', name: 'guava', version: '28.1-jre'
// XML
compile group: 'org.dom4j', name: 'dom4j', version: '2.1.1'
compile group: 'org.springframework.boot', name: 'spring-boot', version: '2.1.8.RELEASE'
// TEST
testCompile group: 'junit', name: 'junit', version: '4.12'
// DOCS
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
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
}
}
2019-10-18 15:15:59 -04:00
repositories {
maven {
credentials {
username 'publish'
password 'apk2OJbXCMmwQz1K'
}
def releasesRepoUrl = "https://maven.ossez.com/repository/internal"
def snapshotsRepoUrl = "https://maven.ossez.com/repository/snapshots/"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
}
}
}