forked from arc42/quality-requirements
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
115 lines (88 loc) · 2.73 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
/***
* arc42 - quality requirements examples - gradle build script
=============================================================
*
* This is free software without any guarantees. Use at your own risk.
*
* See licence.txt for details.
*
*
* Credits:
* Peter Niederwieser, for instructions on how to:
* - call shell commands from gradle:
* http://forums.gradle.org/gradle/topics/how_to_execute_shell_command_source_or_dot_doestnt_work_with_exec
***************************************************************/
buildscript {
repositories {
jcenter()
}
dependencies {
// upgrade to latest jruby version due to a bugfix needed for Windows 10.
// can be removed, when asciidoctorj uses this as a default version.
classpath('org.jruby:jruby-complete:9.1.13.0')
// classpath('org.asciidoctor:asciidoctorj-epub3:1.5.0-alpha.16')
classpath('org.asciidoctor:asciidoctorj-pdf:1.5.0-alpha.16')
classpath('org.asciidoctor:asciidoctorj-diagram:1.5.4.1')
}
}
plugins {
id 'org.asciidoctor.convert' version '1.5.3'
}
apply plugin: 'org.asciidoctor.convert'
project.description = "arc42 - Examples for Software Quality Requirements"
project.version = "0.8.0"
ext {
srcDir = "$projectDir/src/asciidoc"
targetDir = "$buildDir"
}
asciidoctorj {
version = '1.5.6'
}
asciidoctor {
outputDir = file( targetDir )
sourceDir = file("$srcDir")
println "outputDir = " + outputDir
println "sourceDir = " + sourceDir
// enable the Asciidoctor Diagram extension
requires 'asciidoctor-diagram'
separateOutputDirs = false
sources { include "index.adoc" }
backends 'html5' , 'pdf' , 'docbook' //, 'epub3'
attributes = [
'release-branch': 'master',
'outputFile': "$outputDir/quality-requirements.pdf",
'source-highlighter': 'coderay',
'tabsize': '4',
'toc': 'left',
'icons': 'font',
'sectlink': true,
'sectanchors': true,
'idprefix': '',
'idseparator': '-',
'doctype': 'book',
'toclevels': 3,
'imagesdir': './images',
'homepage': 'http://github.com/arc42/quality-requirements',
'icons': 'font',
'numbered': true,
'version': project.version
]
resources {
// include architecture diagrams
from("${projectDir}/src/asciidoc") {
include 'images/**'
}
}
} // asciidoctor
task generateDocx( dependsOn: 'asciidoctor', type: Exec) {
description =
"""
Executing shell commands does currently NOT work from within
the IntelliJ JetGradle environment.
"""
executable "sh"
// calling pandoc over sh directly from gradle does not produce any output,
// therefore I delegated docx creation to a shell script.
args "create_docx_with_pandoc.sh"
}
defaultTasks 'generateDocx'