buildscript {
    repositories {
        mavenLocal()
        jcenter()
    }
    dependencies {
        classpath 'com.benjaminsproule:swagger-gradle-plugin:+'
    }
}

plugins {
    id 'org.springframework.boot' version '3.1.3'
    id 'io.spring.dependency-management' version '1.1.3'
    id 'scala'
}

apply plugin: 'com.benjaminsproule.swagger'

group = 'com.benjaminsproule'
version = '0.0.1-SNAPSHOT'

repositories {
    mavenLocal()
    mavenCentral()
    jcenter()
}

dependencies {
    implementation 'org.scala-lang:scala-library:2.13.11'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'io.swagger:swagger-annotations:1.6.11'
}

swagger {
    apiSource {
        springmvc = true
        locations = ['com.benjaminsproule.sample']
        schemes = ['http', 'https']
        host = 'www.example.com:8080'
        basePath = '/sample'
        info {
            title = 'Swagger Gradle Plugin Sample'
            version = 'v1'
            description = 'This is a sample.'
            termsOfService = 'http://www.example.com/termsOfService'
            contact {
                email = 'email@email.com'
                name = 'Name'
                url = 'http://www.example.com'
            }
            license {
                url = 'http://www.apache.org/licenses/LICENSE-2.0.html'
                name = 'Apache 2.0'
            }
        }
        swaggerDirectory = "${project.buildDir}/swagger-ui"
        securityDefinition {
            json = 'securityDefinition.json'
        }
    }
}
