-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
137 lines (115 loc) · 3.8 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import groovy.xml.DOMBuilder
import java.nio.file.FileSystems
import com.petebevin.markdown.MarkdownProcessor
import org.xhtmlrenderer.pdf.ITextRenderer
defaultTasks 'clean', 'createDist'
apply plugin: 'idea'
allprojects {
apply plugin: "groovy"
apply plugin: "java"
apply plugin: "maven"
sourceCompatibility = '1.7'
targetCompatibility = '1.7'
repositories {
mavenCentral()
mavenLocal()
flatDir {
dirs 'lib'
}
}
sourceSets.main.java.srcDirs = []
sourceSets.main.groovy.srcDirs = ['src/main/java', 'src/main/groovy']
sourceSets.test.java.srcDirs = []
sourceSets.test.groovy.srcDirs = ['src/test/java', 'src/test/groovy']
}
project.ext {
artifactId = "loader"
}
task wrapper(type: Wrapper) {
gradleVersion = project."gradle.version"
}
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.markdownj:markdownj:0.3.0-1.0.2b4"
classpath "org.xhtmlrenderer:flying-saucer-pdf:9.0.2"
}
}
dependencies {
//openregistry
['openregistry-api', 'openregistry-service-impl', 'openregistry-sor-repository-xml', 'openregistry-repository-jpa-impl'].each {
compile("org.jasig.openregistry:${it}:${project."open.registry.version"}") {
exclude module: "spring-tx"
}
}
// spring batch
compile("org.springframework.batch:spring-batch-core:${project."spring.batch.version"}") {
exclude module: "spring-tx"
}
// spring
['beans', 'context', 'tx'].each {
compile "org.springframework:spring-${it}:${project."spring.version"}"
}
// BoneCP jdbc connection pool
compile "com.jolbox:bonecp:${project."bonecp.version"}"
compile "log4j:log4j:${project."log4j.version"}"
// slf4j stuff
compile "org.slf4j:slf4j-api:${project."slf4j.version"}"
compile "org.slf4j:jcl-over-slf4j:${project."slf4j.version"}"
compile "org.slf4j:slf4j-log4j12:${project."slf4j.version"}"
//JDBC
/*
runtime "postgresql:postgresql:${project.postgresJdbcVersion}"
runtime "oracle:ojdbc7:${project.oracleJdbcVersion}"
*/
compile "org.codehaus.groovy:groovy-all:${project."groovy.version"}"
compile("org.grails:grails-spring:${project."grails.version"}") {
exclude module: "grails-bootstrap"
exclude module: "gant_groovy1.8"
exclude module: "javax.servlet-api"
exclude module: "hibernate-jpa-2.0-api"
exclude module: "slf4j-api"
exclude module: "jcl-over-slf4j"
exclude module: "spring-web"
exclude module: "spring-tx"
}
}
task generatePDFDocument() {
outputs.upToDateWhen { false }
outputs.file new File(temporaryDir, "readme.pdf")
doLast {
def e = new File(temporaryDir, "readme.pdf")
def processor = new MarkdownProcessor()
def docString = ["doc/setup.md", "doc/configuration.md"].collect { processor.markdown(project.file(it).text) }.join('')
def doc = DOMBuilder.parse(new StringReader("<html><title>Open Registry Loader</title><body>${docString}</body></html>"))
def renderer = new ITextRenderer()
renderer.setDocument(doc, null)
renderer.layout()
renderer.createPDF(e.newOutputStream())
}
}
task createDist(type: Zip, dependsOn: ':build') {
def baseDir = { archiveName - ".zip" }
into(baseDir) {
into("etc") {
from(project.file("etc"))
from(project.file("src/main/resources")) {
include "log4j.xml"
}
}
into("lib") {
from(jar)
from(project.configurations.runtime)
}
into("bin") {
from(project.file("bin")) {
fileMode 0755
}
}
into("doc") {
from generatePDFDocument
}
}
}