build.gradle 3.6 KB
Newer Older
1
plugins {
B
Bogdan Kobylynskyi 已提交
2 3
    id "java"
    id "idea"
4
    id "maven"
B
Bogdan Kobylynskyi 已提交
5
    id "jacoco"
6 7
    id "java-library"
    id "signing"
B
Bogdan Kobylynskyi 已提交
8
    id "maven-publish"
9 10
}

11
version = "1.6.1-SNAPSHOT"
12
group = "io.github.kobylynskyi"
13

14 15 16 17 18 19
repositories {
    mavenCentral()
    jcenter()
}

dependencies {
20 21 22
    implementation "org.freemarker:freemarker:2.3.28"
    implementation "com.graphql-java:graphql-java:13.0"
    implementation "com.fasterxml.jackson.core:jackson-databind:2.9.9"
23

24
    implementation "org.projectlombok:lombok:1.18.8"
25 26 27 28
    annotationProcessor "org.projectlombok:lombok:1.18.8"

    testImplementation "org.junit.jupiter:junit-jupiter-api:5.5.1"
    testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:5.5.1"
B
Bogdan Kobylynskyi 已提交
29
    testCompile 'org.hamcrest:java-hamcrest:2.0.0.0'
30 31
}

B
Bogdan Kobylynskyi 已提交
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
test.useJUnitPlatform()

task codeCoverageReport(type: JacocoReport) {
    executionData fileTree(project.rootDir.absolutePath).include("build/jacoco/*.exec")

    sourceSets sourceSets.main

    reports {
        xml.enabled true
        xml.destination file("${buildDir}/reports/jacoco/report.xml")
        html.enabled false
        csv.enabled false
    }
}

codeCoverageReport.dependsOn test

49 50 51 52 53 54 55 56 57
task sourcesJar(type: Jar) {
    from sourceSets.main.allJava
    archiveClassifier = "sources"
}

task javadocJar(type: Jar) {
    from javadoc
    archiveClassifier = "javadoc"
}
58

59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78
artifacts {
    archives jar
    archives sourcesJar
    archives javadocJar
}

publishing {
    publications {
        mavenJava(MavenPublication) {
            artifactId = "my-library"
            from components.java
            artifact sourcesJar
            artifact javadocJar
            artifactId "graphql-java-codegen"

            pom {
                name = "GraphQL Java CodeGen"
                description = "Java Code Generator based on GraphQL schema"
                url = "https://github.com/kobylynskyi/graphql-java-codegen"
                organization {
79
                    name = "io.github.kobylynskyi"
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103
                    url = "https://github.com/kobylynskyi"
                }
                issueManagement {
                    system = "GitHub"
                    url = "https://github.com/kobylynskyi/graphql-java-codegen/issues"
                }
                licenses {
                    license {
                        name = "MIT License"
                        url = "https://github.com/kobylynskyi/graphql-java-codegen/blob/master/LICENSE"
                        distribution = "repo"
                    }
                }
                scm {
                    url = "https://github.com/kobylynskyi/graphql-java-codegen"
                    connection = "scm:git:git://github.com/kobylynskyi/graphql-java-codegen.git"
                    developerConnection = "scm:git:ssh://git@github.com:kobylynskyi/graphql-java-codegen.git"
                }
                developers {
                    developer {
                        id = "kobylynskyi"
                        name = "Bogdan Kobylynskyi"
                        email = "92bogdan@gmail.com"
                    }
A
Alberto Valiña 已提交
104 105 106 107 108
                    developer {
                        id = "valinha"
                        name = "Alberto Valiña"
                        email = "valinhadev@gmail.com"
                    }
109 110 111 112 113 114 115 116 117 118 119 120 121 122
                }
            }
        }
    }
    repositories {
        maven {
            url "https://oss.sonatype.org/service/local/staging/deploy/maven2"
            credentials {
                username sonatypeUsername
                password sonatypePassword
            }
        }
    }
}
123

B
Bogdan Kobylynskyi 已提交
124 125 126 127
if (project.hasProperty("signing.keyId")) {
    signing {
        sign publishing.publications.mavenJava
    }
128
}