build.gradle 1.6 KB
Newer Older
1 2 3 4 5
plugins {
    id "java"
    id "idea"
    id "application"
    id "net.ltgt.apt" version "0.20"
6 7 8 9

    //
    // use the latest available version:
    // https://plugins.gradle.org/plugin/io.github.kobylynskyi.graphql.codegen
10
    id "io.github.kobylynskyi.graphql.codegen" version "1.6.1-SNAPSHOT"
11 12
}

13
mainClassName = "io.github.kobylynskyi.product.Application"
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

dependencies {
    compile "org.springframework.boot:spring-boot-starter-web:2.1.7.RELEASE"
    compile "org.springframework.boot:spring-boot-starter-data-mongodb:2.1.7.RELEASE"
    compile "org.springframework.data:spring-data-commons:2.1.10.RELEASE"

    compile "com.graphql-java-kickstart:graphql-java-tools:5.6.1"
    compile "com.graphql-java-kickstart:graphql-spring-boot-starter:5.10.0"
    compile "com.graphql-java-kickstart:graphiql-spring-boot-starter:5.10.0"

    implementation "org.mapstruct:mapstruct:1.3.0.Final"
    annotationProcessor "org.mapstruct:mapstruct-processor:1.3.0.Final"

    compileOnly "org.projectlombok:lombok:1.18.8"
    annotationProcessor "org.projectlombok:lombok:1.18.8"
}

compileJava.dependsOn "graphqlCodegen"

sourceSets.main.java.srcDir "$buildDir/generated"

graphqlCodegen {
    graphqlSchemaPaths = ["$projectDir/src/main/resources/schema.graphqls".toString()]
    outputDir = new File("$buildDir/generated")
38 39
    apiPackageName = "io.github.kobylynskyi.product.graphql.api"
    modelPackageName = "io.github.kobylynskyi.product.graphql.model"
40 41 42 43 44 45 46 47 48 49 50 51
    customTypesMapping = [
            DateTime: "java.util.Date"
    ]
    modelNameSuffix = "TO"
    generateApis = true
}

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