forked from gigaSproule/swagger-gradle-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
178 lines (149 loc) · 5.24 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
plugins {
id 'maven'
id 'maven-publish'
id 'java'
id 'groovy'
id 'scala'
id 'idea'
id 'jacoco' // Currently this does not exclude methods generated via Annotations (toString in this plugin)
id 'java-gradle-plugin'
id 'com.gradle.plugin-publish' version '0.10.1'
id 'com.jfrog.bintray' version '1.8.4'
id 'net.researchgate.release' version '2.8.1'
id 'com.github.ben-manes.versions' version '0.25.0'
id 'org.jetbrains.kotlin.jvm' version '1.3.50'
id 'com.dorongold.task-tree' version '1.4'
}
repositories {
mavenLocal()
mavenCentral()
maven {
url 'https://dl.bintray.com/gigasproule/maven'
}
}
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
group = 'com.benjaminsproule'
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
task createClasspathManifest {
def outputDir = file("$buildDir/$name")
inputs.files sourceSets.main.runtimeClasspath
outputs.dir outputDir
doLast {
outputDir.mkdirs()
file("${outputDir}/plugin-classpath.txt").text = (sourceSets.main.runtimeClasspath + sourceSets.test.runtimeClasspath).join('\n')
}
}
dependencies {
def jacksonVersion = '2.10.0'
def springVersion = '5.2.0.RELEASE'
def kotlinVersion = '1.3.50'
compile gradleApi()
compile localGroovy()
compile 'commons-io:commons-io:2.6'
compile 'org.apache.commons:commons-lang3:3.9'
compile 'org.apache.commons:commons-text:1.8'
compile 'com.github.jknack:handlebars:4.1.2'
compile "com.fasterxml.jackson.core:jackson-core:${jacksonVersion}"
compile "com.fasterxml.jackson.module:jackson-module-jaxb-annotations:${jacksonVersion}"
compile "com.fasterxml.jackson.module:jackson-module-scala_2.12:${jacksonVersion}"
compile 'javax.xml.bind:jaxb-api:2.3.1'
//These should be pinned here until ronmamo/reflections#194 has been resolved
compile 'io.swagger:swagger-jersey2-jaxrs:1.5.23'
compile 'io.swagger:swagger-scala-module_2.12:1.0.5'
compile 'javax.ws.rs:javax.ws.rs-api:2.1.1'
compile 'com.sun.jersey:jersey-server:1.19.4'
compile 'org.glassfish.jersey.core:jersey-server:2.29.1'
compile "org.springframework:spring-context:${springVersion}"
compile "org.springframework:spring-web:${springVersion}"
testCompile gradleTestKit()
testCompile 'org.scala-lang:scala-library:2.13.1'
testCompile "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
testCompile "org.jetbrains.kotlin:kotlin-reflect:${kotlinVersion}"
testCompile 'cglib:cglib-nodep:3.3.0'
testCompile 'org.objenesis:objenesis:3.1'
testCompile('org.spockframework:spock-core:1.3-groovy-2.4') {
//We want to depend on the gradle version of groovy since this is a plugin
exclude module: 'groovy-all'
}
testRuntime files(createClasspathManifest)
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
artifacts {
archives sourcesJar
}
test {
testLogging {
events 'failed'
exceptionFormat 'full'
}
options {
systemProperties(System.getProperties())
}
}
compileTestJava.dependsOn compileTestGroovy
compileTestJava.classpath += files(compileTestGroovy.destinationDir)
compileTestGroovy.dependsOn = compileTestGroovy.taskDependencies.getDependencies(compileTestGroovy) - compileTestJava
compileTestKotlin.dependsOn compileTestGroovy
compileTestKotlin.classpath += files(compileTestGroovy.destinationDir)
compileTestScala.dependsOn compileTestGroovy
compileTestScala.classpath += files(compileTestGroovy.destinationDir)
testClasses.dependsOn tasks.compileTestKotlin
if (project.hasProperty('bintray_user') && project.hasProperty('bintray_apiKey')) {
bintray {
user = bintray_user
key = bintray_apiKey
configurations = ['archives']
pkg {
repo = 'maven'
name = 'swagger-gradle-plugin'
websiteUrl = 'https://github.com/gigaSproule/swagger-gradle-plugin'
vcsUrl = 'https://github.com/gigaSproule/swagger-gradle-plugin'
githubRepo = 'gigaSproule/swagger-gradle-plugin'
githubReleaseNotesFile = 'README.md'
licenses = ['Apache-2.0']
publish = true
version {
name = project.version
released = new Date()
}
}
}
afterReleaseBuild.dependsOn bintrayUpload
}
pluginBundle {
website = 'https://github.com/gigaSproule/swagger-gradle-plugin'
vcsUrl = 'https://github.com/gigaSproule/swagger-gradle-plugin'
description = 'Plugin to create Swagger documentation using Gradle'
tags = ['swagger', 'documentation']
plugins {
swagger {
id = 'com.benjaminsproule.swagger'
displayName = 'Swagger Gradle Plugin'
}
}
}
publishing {
publications {
pluginPublication(MavenPublication) {
from components.java
groupId project.group
artifactId project.name
version "${project.version}-SNAPSHOT"
}
}
}
tasks.jacocoTestReport.dependsOn('test')
tasks.check.dependsOn('jacocoTestReport')
jacoco {
toolVersion = '0.8.2'
}
afterReleaseBuild.dependsOn publishPlugins