90 lines
2.6 KiB
Groovy
90 lines
2.6 KiB
Groovy
plugins {
|
|
id 'com.benjaminsproule.swagger' version '1.0.6'
|
|
}
|
|
|
|
description = 'Maptology Common Api'
|
|
|
|
dependencies {
|
|
testCompile "junit:junit:${versionJunit}"
|
|
compileOnly "javax.xml.bind:jaxb-api:${versionJaxb}"
|
|
compileOnly "jakarta.platform:jakarta.jakartaee-api:${versionJavaee}"
|
|
compileOnly "io.swagger:swagger-annotations:${versionSwagger}"
|
|
compileOnly "com.fasterxml.jackson.core:jackson-annotations:${versionJackson}"
|
|
}
|
|
|
|
// add compile only dependencies to testCompile without duplicating them
|
|
sourceSets {
|
|
test.compileClasspath += configurations.compileOnly
|
|
}
|
|
|
|
// generate swagger documentation from api using a plugin
|
|
swagger {
|
|
apiSource {
|
|
attachSwaggerArtifact = true
|
|
locations = [
|
|
'com.maptology.api.user.IUserService',
|
|
'com.maptology.api.notice.INoticeService',
|
|
'com.maptology.api.log.ILogService',
|
|
'com.maptology.api.version.IVersionService',
|
|
'com.maptology.api.device.IDeviceService',
|
|
'com.maptology.api.share.IShareService',
|
|
'com.maptology.api.location.ILocationService',
|
|
'com.maptology.api.position.IPositionService',
|
|
'com.maptology.api.privilege.IPrivilegeService',
|
|
'com.maptology.api.history.IHistoryService'
|
|
]
|
|
schemes = [ 'http', 'https']
|
|
host = 'www.maptology.com'
|
|
basePath = '/api'
|
|
info {
|
|
title = 'Maptology Service'
|
|
version = project.version
|
|
description = 'The application programming interface of Maptology.'
|
|
termsOfService = 'https://maptology.com/terms-of-service'
|
|
contact {
|
|
email = 'nes-admin@uni-due.de'
|
|
name = 'Networked Embedded Systems'
|
|
url = 'https://www.nes.uni-due.de'
|
|
}
|
|
license {
|
|
url = 'https://www.maptology.com/license'
|
|
name = 'Maptology License'
|
|
}
|
|
}
|
|
swaggerFileName = 'maptology'
|
|
swaggerDirectory = "${project.buildDir}/swagger"
|
|
securityDefinition {
|
|
name = 'device'
|
|
description = 'Operations requiring device privileges.'
|
|
type = 'apiKey'
|
|
keyLocation = 'header'
|
|
keyName = 'Authorization'
|
|
}
|
|
securityDefinition {
|
|
name = 'user'
|
|
description = 'Operations requiring a valid user.'
|
|
type = 'basic'
|
|
}
|
|
securityDefinition {
|
|
name = 'admin'
|
|
description = 'Operations requiring admin privileges.'
|
|
type = 'basic'
|
|
}
|
|
securityDefinition {
|
|
name = 'scientist'
|
|
description = 'Operations requiring scientist privileges.'
|
|
type = 'basic'
|
|
}
|
|
}
|
|
}
|
|
|
|
// add the swagger defintion to the artifacts published by this module
|
|
publishing {
|
|
publications {
|
|
maven(MavenPublication) {
|
|
artifact source: "${project.buildDir}/swagger/maptology.json", extension: "swagger"
|
|
}
|
|
}
|
|
}
|
|
|