This repository has been archived by the owner on Oct 12, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 124
/
build.gradle
145 lines (118 loc) · 4 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
plugins {
id 'base'
id 'maven-publish'
id 'com.gradle.plugin-publish' version '0.14.0'
id 'org.ajoberstar.git-publish' version '2.1.3'
}
allprojects {
group = 'com.bmuschko'
version = '2.7.0'
}
subprojects {
apply plugin: 'groovy'
apply plugin: 'jacoco'
apply from: "$rootProject.projectDir/gradle/integration-test.gradle"
apply from: "$rootProject.projectDir/gradle/functional-test.gradle"
def compatibilityVersion = JavaVersion.VERSION_1_8
sourceCompatibility = compatibilityVersion
targetCompatibility = compatibilityVersion
repositories {
mavenCentral()
}
dependencies {
testImplementation('org.spockframework:spock-core:1.2-groovy-2.5') {
exclude group: 'org.codehaus.groovy'
}
testImplementation 'org.apache.commons:commons-lang3:3.3'
}
}
jar.enabled = false
task uberJar(type: Jar, dependsOn: subprojects.assemble) {
description = 'Creates Uberjar.'
subprojects.each { project ->
from project.configurations.archives.allArtifacts.files.collect { zipTree(it) }
}
manifest {
attributes 'Implementation-Title': 'Gradle Tomcat plugin',
'Implementation-Version': project.version.toString(),
'Built-By': System.getProperty('user.name'),
'Built-Date': new Date(),
'Built-JDK': System.getProperty('java.version'),
'Built-Gradle': gradle.gradleVersion
}
}
task sourcesJar(type: Jar) {
description = 'Creates sources JAR.'
archiveClassifier = 'sources'
subprojects.each { project ->
from project.sourceSets.main.allSource
}
}
ext.groovyDocsDir = 'build/docs/groovydoc'
task aggregateGroovydocs(type: Groovydoc, dependsOn: subprojects.groovydoc) {
description = 'Creates Groovydocs.'
ext.title = "Gradle Tomcat plugin ($version)"
docTitle title
windowTitle title
source subprojects.groovydoc.source
destinationDir file(groovyDocsDir)
classpath = files(subprojects.groovydoc.classpath)
groovyClasspath = project(':plugin').groovydoc.groovyClasspath
}
task groovydocJar(type: Jar, dependsOn: aggregateGroovydocs) {
description = 'Creates GroovyDocs JAR.'
archiveClassifier = 'javadoc'
from groovyDocsDir
}
task createAllDeliverables(dependsOn: [uberJar, sourcesJar, groovydocJar]) {
description = 'Creates all deliverables including plugin JAR, sources JAR and Groovydoc JAR.'
}
task aggregateTestReports(type: TestReport) {
destinationDir = file("$buildDir/reports/all-tests")
reportOn subprojects*.test, subprojects*.integrationTest
}
check.dependsOn aggregateTestReports
artifacts {
archives uberJar
archives sourcesJar
archives groovydocJar
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact uberJar
}
}
}
pluginBundle {
website = "https://github.com/bmuschko/gradle-tomcat-plugin"
vcsUrl = "https://github.com/bmuschko/gradle-tomcat-plugin"
tags = ['gradle', 'tomcat', 'web', 'container', 'embedded']
mavenCoordinates {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
}
plugins {
tomcatBasePlugin {
id = 'com.bmuschko.tomcat-base'
displayName = 'Gradle Tomcat Base Plugin'
description = 'Plugin that provides custom task types for interacting with an embedded Tomcat web container.'
}
tomcatPlugin {
id = 'com.bmuschko.tomcat'
displayName = 'Gradle Tomcat Plugin'
description = 'Plugin that provides tasks for deploying your web application to an embedded Tomcat web container.'
}
}
}
gitPublish {
repoUri = 'git@github.com:bmuschko/gradle-tomcat-plugin.git'
branch = 'gh-pages'
contents {
from(aggregateGroovydocs.outputs.files) {
into 'docs/groovydoc'
}
}
}
gitPublishCopy.dependsOn subprojects*.javadoc, subprojects*.groovydoc