apply plugin: 'idea'
apply plugin: 'com.auth0.gradle.oss-library.java'
apply plugin: 'jacoco'

oss {
    name 'auth0-spring-security-api'
    repository 'auth0-spring-security-api'
    organization 'auth0'
    description 'Auth0 Java Spring integration for API'
    skipAssertSigningConfiguration true

    developers {
        auth0 {
            displayName = 'Auth0'
            email = 'oss@auth0.com'
        }
        lbalmaceda {
            displayName = 'Luciano Balmaceda'
            email = 'luciano.balmaceda@auth0.com'
        }
        hzalaz {
            displayName = 'Hernan Zalazar'
            email = 'hernan@auth0.com'
        }
    }
}

logger.lifecycle("Using version ${version} for ${group}.${name}")

def signingKey = findProperty('signingKey')
def signingKeyPwd = findProperty('signingPassword')

compileJava {
    sourceCompatibility '1.7'
    targetCompatibility '1.7'
}

signing {
    useInMemoryPgpKeys(signingKey, signingKeyPwd)
}

ext.springSecurityVersion = '4.2.20.RELEASE'

dependencies {
    api "com.auth0:java-jwt:3.19.4"
    api "com.auth0:jwks-rsa:0.21.3"
    api "org.springframework.security:spring-security-core:${springSecurityVersion}"
    api "org.springframework.security:spring-security-web:${springSecurityVersion}"
    api "org.springframework.security:spring-security-config:${springSecurityVersion}"

    implementation "commons-codec:commons-codec:1.15"
    implementation "org.slf4j:slf4j-api:1.7.36"
    compileOnly "javax.servlet:servlet-api:2.5"

    testImplementation "junit:junit:4.12"
    testImplementation "org.hamcrest:java-hamcrest:2.0.0.0"
    testImplementation "org.mockito:mockito-core:2.28.2"
    testCompile "javax.servlet:servlet-api:2.5"
}

jacocoTestReport {
    reports {
        xml.enabled = true
        html.enabled = true
    }
}

test {
    testLogging {
        events 'passed', 'skipped', 'failed', 'standardError'
        exceptionFormat 'short'
    }
}

clean.doFirst {
    new File('CHANGELOG.md.release').delete()
}
