build.gradle 3.07 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
plugins {
    id 'application'
    id 'distribution'
    id 'org.jetbrains.kotlin.jvm' version '1.3.71'
    id 'com.palantir.git-version' version '0.11.0'
    id 'org.jlleitschuh.gradle.ktlint' version '9.2.1'
}

group 'org.memobase'
version = gitVersion()
mainClassName = 'org.memobase.App'

jar {
    manifest {
        attributes 'Main-Class': 'org.memobase.App'
    }
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
21

Jonas Waeber's avatar
Jonas Waeber committed
22
repositories {
23
    mavenCentral()
Jonas Waeber's avatar
Jonas Waeber committed
24
    maven {
25
        url  "https://gitlab.switch.ch/api/v4/projects/1324/packages/maven"
Jonas Waeber's avatar
Jonas Waeber committed
26
27
28
29
30
31
32
33
34
    }
}

ext {
    kafkaV = '2.3.1'
    log4jV = '2.11.2'
}

dependencies {
Thomas Bernhart's avatar
Thomas Bernhart committed
35
    def excludeSlf4J = { exclude group: 'org.slf4j' }
Jonas Waeber's avatar
Jonas Waeber committed
36

37
    // JSON Parser
38
    implementation 'com.beust:klaxon:5.5'
39

Jonas Waeber's avatar
Jonas Waeber committed
40
41
42
43
    implementation "org.apache.logging.log4j:log4j-api:${log4jV}"
    implementation "org.apache.logging.log4j:log4j-core:${log4jV}"
    implementation "org.apache.logging.log4j:log4j-slf4j-impl:${log4jV}"

Thomas Bernhart's avatar
Thomas Bernhart committed
44
    implementation "org.apache.kafka:kafka-clients:${kafkaV}", excludeSlf4J
45

Thomas Bernhart's avatar
Thomas Bernhart committed
46
    implementation 'org.apache.jena:apache-jena:3.14.0', excludeSlf4J
Jonas Waeber's avatar
Jonas Waeber committed
47

48
49
    implementation 'org.memobase:memobase-service-utilities:3.0.1', excludeSlf4J
    implementation 'ch.memobase:fedora-client:0.8.0', excludeSlf4J
Jonas Waeber's avatar
Jonas Waeber committed
50
51
52
53
54
55

    // 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"

56
    // TESTS
57
    testImplementation("org.junit.jupiter:junit-jupiter:5.6.0")
Jonas Waeber's avatar
Jonas Waeber committed
58
    testImplementation 'org.assertj:assertj-core:3.15.0'
59
60
    testImplementation 'org.mockito:mockito-core:2.7.22'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.6.0'
Jonas Waeber's avatar
Jonas Waeber committed
61
62
}

Thomas Bernhart's avatar
Thomas Bernhart committed
63
64
65
66
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    kotlinOptions {
        kotlinOptions.jvmTarget = "1.8"
    }
Jonas Waeber's avatar
Jonas Waeber committed
67
68
}

Thomas Bernhart's avatar
Thomas Bernhart committed
69
70
71
configurations {
    integrationTestImplementation.extendsFrom implementation
    integrationTestRuntimeOnly.extendsFrom runtimeOnly
Jonas Waeber's avatar
Jonas Waeber committed
72
73
74
75
76
77
78
79
80
}

sourceSets {
    main.kotlin.srcDirs += 'src/main/kotlin'
    main.resources.srcDirs = [ "src/main/resources" ]
    main.resources.includes = [ "**/*.yml", "**/*.xml"]
    test.kotlin.srcDirs += 'src/test'
    test.resources.srcDirs = [ "src/test/resources" ]
    test.resources.includes = [ "**/*.yml", "**/*.xml", "**/*.csv"]
Thomas Bernhart's avatar
Thomas Bernhart committed
81
82
83
84
85
86
87

    integrationTest {
        kotlin.srcDir("src/integrationTest/kotlin")
        resources.srcDir("src/integrationTest/resources")
        compileClasspath += sourceSets.main.output + configurations["testRuntimeClasspath"]
        runtimeClasspath += output + compileClasspath + sourceSets["test"].runtimeClasspath
    }
Jonas Waeber's avatar
Jonas Waeber committed
88
89
}

Thomas Bernhart's avatar
Thomas Bernhart committed
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
test {
    useJUnitPlatform()
    testLogging {
        events "passed", "skipped", "failed"
    }
}

task integrationTest(type: Test) {
    useJUnitPlatform()
    testLogging {
        events "passed", "skipped", "failed"
    }
    testClassesDirs = sourceSets.integrationTest.output.classesDirs
    classpath = sourceSets.integrationTest.runtimeClasspath
    shouldRunAfter test
}

Jonas Waeber's avatar
Jonas Waeber committed
107
108
109
110
plugins.withType(DistributionPlugin) {
    distTar {
        archiveFileName = 'app.tar'
    }
Thomas Bernhart's avatar
Thomas Bernhart committed
111
}