-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.gradle
166 lines (143 loc) · 4.85 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
buildscript {
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.5'
classpath 'com.netflix.nebula:gradle-extra-configurations-plugin:3.0.3'
}
}
plugins {
id 'org.ajoberstar.github-pages' version '1.1.0'
id 'org.asciidoctor.gradle.asciidoctor' version '1.5.1'
}
project.ext {
githubUrl = 'https://github.com/craigburke/document-builder'
}
allprojects {
apply plugin: 'maven'
apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'eclipse'
apply plugin: 'codenarc'
apply plugin: 'nebula.provided-base'
group = 'com.craigburke.document'
version = '0.5.0'
targetCompatibility = 1.6
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
provided 'org.codehaus.groovy:groovy-all:2.4.5'
testCompile 'org.spockframework:spock-core:1.0-groovy-2.4'
testCompile 'cglib:cglib-nodep:3.1'
testCompile 'org.objenesis:objenesis:2.1'
codenarc 'org.codenarc:CodeNarc:0.23'
}
codenarc {
toolVersion = '0.23'
configFile = file("${rootProject.projectDir}/config/codenarc/rules.groovy")
}
}
subprojects {
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.bintray'
task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from 'build/docs/javadoc'
}
afterEvaluate { Project project ->
bintray {
user = project.hasProperty('bintrayUsername') ? project.bintrayUsername : ''
key = project.hasProperty('bintrayApiKey') ? project.bintrayApiKey : ''
publications = ['maven']
publish = true
pkg {
repo = 'document-builder'
userOrg = 'craigburke'
name = project.artifactId
githubRepo = project.githubUrl
githubReleaseNotesFile = 'README.adoc'
version {
mavenCentralSync {
user = project.hasProperty('mavenCentralUsername') ? project.mavenCentralUsername : ''
password = project.hasProperty('mavenCentralPassword') ? project.mavenCentralPassword : ''
}
}
}
}
publishing {
publications {
maven(MavenPublication) {
artifactId project.artifactId
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name project.artifactId
description project.description
url project.githubUrl
scm {
url project.githubUrl
connection "scm:${project.githubUrl}.git"
developerConnection "scm:${project.githubUrl}.git"
}
licenses {
license {
name 'Mozilla Public License, Version 2.0'
url 'https://www.mozilla.org/MPL/2.0/'
distribution 'repo'
}
}
developers {
developer {
id 'craigburke'
name 'Craig Burke'
email '[email protected]'
}
}
}
}
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
}
task release {
dependsOn bintrayUpload, publishGhPages
}
}
asciidoctor {
sourceDir = file('docs')
resources {
from(sourceDir) {
include 'css/**', 'images/**'
}
}
attributes 'source-highlighter': 'prettify',
'docinfo1': ['version': project.version],
'imagesdir': 'images',
'stylesdir': 'css',
icons: 'font',
'toc': 'left',
version: project.version,
'projectUrl': 'https://github.com/craigburke/document-builder'
}
githubPages {
repoUri = "${project.githubUrl}.git"
credentials {
username = project.hasProperty('githubToken') ? project.githubToken : ''
password = ''
}
pages {
from file(asciidoctor.outputDir.path + '/html5')
}
}
publishGhPages.dependsOn asciidoctor
task wrapper(type: Wrapper) {
gradleVersion = '2.9'
}