-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
213 lines (168 loc) · 4.59 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
/**
*
* Thoughtfully generated by synapticloop gradle-project-init with the templar
* templating language.
*
*/
buildscript {
repositories {
mavenLocal()
maven {
url "https://plugins.gradle.org/"
}
}
dependencies {
classpath 'synapticloop:documentr:3.0.0'
}
}
// list all of the plugins for this project
plugins {
id 'java'
id 'eclipse'
id 'maven'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '0.11'
id 'co.riiid.gradle' version '0.4.2'
id 'com.jfrog.bintray' version '1.8.4'
id 'synapticloop.copyrightr' version '1.2.1'
id 'com.github.ben-manes.versions' version '0.21.0'
}
apply plugin: 'synapticloop.documentr'
// the following is un-commented for faster builds as the JavaDoc process can
// take quite a bit of time
tasks.withType(Javadoc).all { enabled = false }
// textual information for this project
group = 'synapticloop'
archivesBaseName = 'documentr'
description = """documentation (README) generator for projects in both markdown and asciidoc - this utilises the templar templating language - including generation of table of contents"""
version = '3.1.0'
sourceCompatibility = 1.8
targetCompatibility = 1.8
// all of the repositories that this project will use
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
configurations {
minimal
}
// now for all of the dependencies
dependencies {
compileOnly gradleApi()
compile 'commons-cli:commons-cli:1.4'
compile 'commons-io:commons-io:2.6'
compile 'nl.jworks.markdown_to_asciidoc:markdown_to_asciidoc:1.1'
compile 'org.json:json:20160810'
compile 'org.jsoup:jsoup:1.12.1'
compile 'org.pegdown:pegdown:1.6.0'
compile 'synapticloop:simpleusage:1.1.2'
compile 'synapticloop:simplelogger:2.0.0'
compile 'synapticloop:templar:1.4.4'
}
// we always want to fail on version conflict
configurations.all {
resolutionStrategy {
failOnVersionConflict()
force 'org.pegdown:pegdown:1.6.0',
'org.json:json:20160810',
'org.jsoup:jsoup:1.12.1'
}
}
copyrightr {
dryRun = false
copyrightHolder = "Synapticloop"
includes = [
"src/main/**/*.java",
"LICENSE.txt"
]
onlyReplaceFirst = true
yearSeparator = " - "
}
documentr {
directory = '.'
verbose = 'true'
extension = 'md' // this is the default
extension = 'adoc' // perhaps you want asciidoc?
}
def locateJar(lib) {
configurations.runtime.findAll {it.getName().contains(lib)}.collect { it.isDirectory() ? it : zipTree(it) }
}
task fatJar(type: Jar) {
classifier = 'all'
manifest {
attributes("Main-Class": "synapticloop.documentr.Main")
}
from { locateJar('simpleusage') } { include "**" }
from { locateJar('simplelogger') } { include "**" }
from { locateJar('commons-io') } { include "**" }
from { locateJar('commons-cli') } { include "**" }
from { locateJar('json') } { include "**" }
from { locateJar('templar') } { include "**" }
from { locateJar('markdown_to_asciidoc') } { include "**" }
from(sourceSets.main.output) { include "**" }
}
build.finalizedBy(project.tasks.fatJar)
publishPlugins.finalizedBy(project.tasks.fatJar)
github {
owner = group
repo = archivesBaseName
if(System.getenv('GITHUB_TOKEN')) {
token = System.getenv('GITHUB_TOKEN')
}
tagName = version
name = version
assets = [
'build/libs/' + archivesBaseName + '-' + version + '-all.jar',
'build/libs/' + archivesBaseName + '-' + version + '.jar'
]
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
publishing {
publications {
Synapticloop(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId group
artifactId archivesBaseName
pom.withXml {
configurations.compile.resolvedConfiguration.firstLevelModuleDependencies.each { dep ->
asNode().dependencies[0].dependency.find {
it.artifactId[0].text() == dep.moduleName &&
it.groupId[0].text() == dep.moduleGroup
}.scope[0].value = 'compile'
}
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_PASSWORD')
publications = [ 'Synapticloop' ]
publish = true
pkg {
repo = 'maven'
name = archivesBaseName
}
}
pluginBundle {
website = 'https://github.com/synapticloop/documentr'
vcsUrl = 'https://github.com/synapticloop/documentr'
description = 'documentation (README) generator for projects in both markdown and asciidoc - this utilises the templar templating language'
tags = [ 'README', 'documentation', 'generator' ]
plugins {
documentrPlugin {
id = 'synapticloop.documentr'
displayName = 'Synapticloop Gradle documentr plugin'
}
}
}