build.gradle 4.53 KB
Newer Older
Jonas Waeber's avatar
Jonas Waeber committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
 * 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
 *
 *    http://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.
 */

plugins {
    id 'maven-publish'
    id 'java-library'
    id 'org.jetbrains.kotlin.jvm' version '1.3.71'
    id 'org.jetbrains.dokka' version '0.10.1'
    id 'com.gitlab.morality.grit' version '2.0.2'
    id 'org.jlleitschuh.gradle.ktlint' version '9.2.1'
}

group = 'ch.memobase'

sourceCompatibility = 1.8
targetCompatibility = 1.8

repositories {
Jonas Waeber's avatar
Jonas Waeber committed
33
    mavenCentral()
Jonas Waeber's avatar
Jonas Waeber committed
34
    maven {
Jonas Waeber's avatar
Jonas Waeber committed
35
        url "https://gitlab.switch.ch/api/v4/projects/1324/packages/maven"
Jonas Waeber's avatar
Jonas Waeber committed
36
37
38
39
40
41
    }
}


ext {
    kafkaV = '2.3.1'
42
    log4jV = '2.15.0'
Jonas Waeber's avatar
Jonas Waeber committed
43
44
45
46
47
}

dependencies {
    implementation "org.apache.logging.log4j:log4j-api:${log4jV}"

Jonas Waeber's avatar
Jonas Waeber committed
48
    implementation 'org.memobase:memobase-service-utilities:3.0.1'
Jonas Waeber's avatar
Jonas Waeber committed
49
50
51
52
53
54
55
56
57
58
    // YAML Parser
    implementation 'com.fasterxml.jackson.core:jackson-databind:2.11.+'
    implementation 'com.fasterxml.jackson.core:jackson-core:2.11.+'
    implementation 'com.fasterxml.jackson.core:jackson-annotations:2.11.+'
    implementation "com.fasterxml.jackson.module:jackson-module-kotlin:2.11.+"
    implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.11.+'
    // RDF
    implementation 'org.apache.jena:apache-jena:3.14.0'
    // CSV Reader
    implementation("com.github.doyaaaaaken:kotlin-csv-jvm:0.7.3")
Jonas Waeber's avatar
Jonas Waeber committed
59
60
    // JSON Parser
    implementation 'com.beust:klaxon:5.5'
Jonas Waeber's avatar
Jonas Waeber committed
61
62
63
64
65
66
67
68
69
70
71
72
73

    // KOTLIN IMPORTS
    implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8'
    implementation "org.jetbrains.kotlin:kotlin-script-runtime:1.3.71"
    implementation "org.jetbrains.kotlin:kotlin-reflect:1.3.71"

    // TESTING
    testImplementation("org.junit.jupiter:junit-jupiter:5.4.2")
    testImplementation 'org.assertj:assertj-core:3.15.0'
    testImplementation "org.apache.logging.log4j:log4j-core:${log4jV}"

}

Jonas Waeber's avatar
Jonas Waeber committed
74
75
76
77
78
79
sourceSets {
    main.kotlin.srcDirs += 'src/main/kotlin'
    test.kotlin.srcDirs += 'src/test/kotlin'
    test.resources.srcDirs += 'src/test/resources'
}

Jonas Waeber's avatar
Jonas Waeber committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
task sourceJar(type: Jar) {
    from sourceSets.main.allSource
    classifier "sources"
}

compileKotlin {
    kotlinOptions.jvmTarget = "1.8"
}
compileTestKotlin {
    kotlinOptions.jvmTarget = "1.8"
}

publishing {
    publications {
Jonas Waeber's avatar
Jonas Waeber committed
94
        library(MavenPublication) {
Jonas Waeber's avatar
Jonas Waeber committed
95
96
            from components.java
            pom {
Jonas Waeber's avatar
Jonas Waeber committed
97
98
                name = 'Normalization Service Configuration'
                description = "This library contains the parsers and validators for the normalization service configurations."
Jonas Waeber's avatar
Jonas Waeber committed
99
                url = "https://gitlab.switch.ch/memoriav/memobase-2020/libraries/package-registry"
Jonas Waeber's avatar
Jonas Waeber committed
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
                licenses {
                    license {
                        name = 'The Apache License, Version 2.0'
                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id = 'jonas.waeber'
                        name = 'Jonas Waeber'
                        email = 'jonas.waeber@unibas.ch'
                    }
                }
                scm {
                    connection = 'scm:git:https://gitlab.switch.ch/memoriav/memobase-2020/libraries/normalizer-service-configuration.git'
                    developerConnection = 'scm:git:git@gitlab.switch.ch:memoriav/memobase-2020/libraries/normalizer-service-configuration.git'
                    url = 'https://gitlab.switch.ch/memoriav/memobase-2020/libraries/normalizer-service-configuration'
                }
            }

        }
    }
Jonas Waeber's avatar
Jonas Waeber committed
122
123
124

    repositories {
        maven {
Jonas Waeber's avatar
Jonas Waeber committed
125
            url "https://gitlab.switch.ch/api/v4/projects/1324/packages/maven"
Jonas Waeber's avatar
Jonas Waeber committed
126
127
            name "GitLab"
            credentials(HttpHeaderCredentials) {
Jonas Waeber's avatar
Jonas Waeber committed
128
129
                name "Job-Token"
                value System.getenv("CI_JOB_TOKEN")
Jonas Waeber's avatar
Jonas Waeber committed
130
131
132
133
134
135
            }
            authentication {
                header(HttpHeaderAuthentication)
            }
        }
    }
136
}