/*
 *  Licensed to the Apache Software Foundation (ASF) under one
 *  or more contributor license agreements.  See the NOTICE file
 *  distributed with this work for additional information
 *  regarding copyright ownership.  The ASF licenses this file
 *  to you under the Apache License, Version 2.0 (the
 *  "License"); you may not use this file except in compliance
 *  with the License.  You may obtain a copy of the License at
 *
 *    https://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing,
 *  software distributed under the License is distributed on an
 *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 *  KIND, either express or implied.  See the License for the
 *  specific language governing permissions and limitations
 *  under the License.
 */

repositories {
    mavenCentral()
    maven { url "https://repo.grails.org/grails/restricted" }
}
apply plugin: 'codenarc'

dependencies {
    documentation "org.codehaus.groovy:groovy-cli-picocli"

    api "org.apache.grails.data:grails-datamapping-core:${gormVersion}"
    api "com.graphql-java:graphql-java:$graphqlJavaVersion"
    api "com.graphql-java:graphql-java-extended-scalars:$graphqlJavaScalarExtVersion"
    api 'com.github.javaparser:javaparser-core:3.25.7'
    api 'org.apache.grails:grails-views-gson:2.3.2'
    api "org.javassist:javassist:$javassistVersion"

    codenarc "org.codenarc:CodeNarc:$codenarcVersion"

    testImplementation "org.apache.grails.data:grails-data-hibernate5-core:${gormHibernateVersion}"
    testImplementation "org.apache.grails.data:grails-data-mongodb-core:${gormMongoDbVersion}"
    testImplementation 'com.github.fakemongo:fongo:2.1.1'
    testImplementation 'com.h2database:h2:2.2.224'
    testImplementation 'org.apache.tomcat:tomcat-jdbc:8.5.97'
    testImplementation "org.apache.tomcat.embed:tomcat-embed-logging-log4j:8.5.2"
    testImplementation "org.slf4j:slf4j-api:$slf4jVersion"
}

targetCompatibility = 1.8
sourceCompatibility = 1.8

codenarc {
    toolVersion = codenarcVersion
    configFile = file("${projectDir}/config/codenarc/rules.groovy")
    maxPriority1Violations = 0
    maxPriority2Violations = 0
    maxPriority3Violations = 0
}

codenarcMain {
    exclude '**/CustomScalars.groovy'
}

codenarcTest {
    ignoreFailures = true
}
