Files
mowesta/common-api/build.gradle
T
handte 8217343298
LocationBasedServices/mowesta/master This commit looks good
Implemented imports.
2019-11-24 12:40:54 +01:00

82 lines
2.2 KiB
Groovy

plugins {
id 'com.benjaminsproule.swagger' version '1.0.6'
}
description = 'Mowesta Common Api'
dependencies {
compile "de.grundid.opendatalab:geojson-jackson:${versionGeojson}"
testCompile "junit:junit:${versionJunit}"
compileOnly "javax.xml.bind:jaxb-api:${versionJaxb}"
compileOnly "javax:javaee-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 documenation from api using a plugin
swagger {
apiSource {
attachSwaggerArtifact = true
locations = [
'com.mowesta.api.user.IUserService',
'com.mowesta.api.log.ILogService',
'com.mowesta.api.version.IVersionService',
'com.mowesta.api.device.IDeviceService',
'com.mowesta.api.location.ILocationService'
]
schemes = [ 'http', 'https']
host = 'localhost'
basePath = '/api'
info {
title = 'Mowesta Service'
version = "${version}"
description = 'Mowesta Service'
termsOfService = 'https://mowesta.com/terms-of-service'
contact {
email = 'nes-admin@uni-due.de'
name = 'NES Universität Duisburg-Essen'
url = 'https://www.nes.uni-due.de'
}
license {
url = 'https://www.mowesta.com/license'
name = 'Proprietary'
}
}
swaggerFileName = 'mowesta'
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'
}
}
}
// add the swagger defintion to the artifacts published by this module
publishing {
publications {
maven(MavenPublication) {
artifact source: "${project.buildDir}/swagger/mowesta.json", extension: "swagger"
}
}
}