build.gradle 3.15 KB
Newer Older
Ubbo Veentjer's avatar
Ubbo Veentjer committed
1
plugins {
2
    id 'org.springframework.boot' version '2.3.0.RELEASE'
3
4
    id 'com.github.node-gradle.node' version '2.2.4'
    id 'io.miret.etienne.sass' version '1.1.1'
Ubbo Veentjer's avatar
Ubbo Veentjer committed
5
    id "com.leobia.gradle.jsgradlecompiler" version "0.3.0"
Ubbo Veentjer's avatar
Ubbo Veentjer committed
6
7
8
9
}

apply plugin: 'java'
apply plugin: 'io.spring.dependency-management'
Ubbo Veentjer's avatar
Ubbo Veentjer committed
10
apply plugin: 'jacoco'
Ubbo Veentjer's avatar
Ubbo Veentjer committed
11
apply plugin: 'war'
Ubbo Veentjer's avatar
Ubbo Veentjer committed
12

Ubbo Veentjer's avatar
semver    
Ubbo Veentjer committed
13
group = 'info.textgrid.rep'
Ubbo Veentjer's avatar
Ubbo Veentjer committed
14
version = '3.1.3-SNAPSHOT'
Ubbo Veentjer's avatar
semver    
Ubbo Veentjer committed
15
16
sourceCompatibility = '1.8'

Ubbo Veentjer's avatar
Ubbo Veentjer committed
17
18
19
20
21
22
23
24
25
26
repositories {
    mavenCentral()
    maven {
        url 'https://nexus.gwdg.de/repository/maven-dariah-public'
    }
}

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.apache.tomcat.embed:tomcat-embed-jasper'
Ubbo Veentjer's avatar
Ubbo Veentjer committed
27
    implementation 'javax.servlet:jstl'
28
    implementation 'org.apache.cxf:cxf-rt-rs-client:3.3.6'
Ubbo Veentjer's avatar
Ubbo Veentjer committed
29
30
    implementation 'io.jsonwebtoken:jjwt:0.9.1'
    implementation 'com.fasterxml.jackson.jaxrs:jackson-jaxrs-json-provider'
31
    implementation 'com.atlassian.commonmark:commonmark:0.14.0'
32
    implementation 'com.atlassian.commonmark:commonmark-ext-heading-anchor:0.14.0'
33
    implementation 'com.atlassian.commonmark:commonmark-ext-gfm-tables:0.14.0'
34
    implementation 'com.atlassian.commonmark:commonmark-ext-yaml-front-matter:0.14.0'
35
    implementation 'info.textgrid.middleware.clients:textgrid-clients:3.4.3'
36
    developmentOnly("org.springframework.boot:spring-boot-devtools")
Ubbo Veentjer's avatar
Ubbo Veentjer committed
37
38
39
40
41
42
43
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

test {
    useJUnitPlatform()
Ubbo Veentjer's avatar
Ubbo Veentjer committed
44
45
}

46
47
48
49
50
// show deprecation and unchecked warnings when compiling java src
tasks.withType(JavaCompile) {
    options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
}

Ubbo Veentjer's avatar
Ubbo Veentjer committed
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
*  node / npm dependencies
*/
node {
    // Version of node to use.
    version = '12.14.1'
    // Version of npm to use.
    npmVersion = '6.13.4'
    // If true, it will download node using above parameters.
    // If false, it will try to use globally installed node.
    download = true
}

64
65
// npm install should be run before processResources
processResources.dependsOn npmInstall
66
processResources.dependsOn compileSass
Ubbo Veentjer's avatar
Ubbo Veentjer committed
67
processResources.dependsOn compileJs
68
69

// copy static files to web application
70
processResources {
71
72
73
74
75
76
77
78
79
80
81
82
83
84
    from ('docs') {
        into 'docs'
    }
    from('node_modules/font-awesome/fonts') {
        into 'static/fonts'
    }
    from ('node_modules/jquery/dist/jquery.min.js') {
        into 'static/js'
    }
    from ('node_modules/openseadragon/build/openseadragon/openseadragon.min.js') {
        into 'static/js'
    }
    from ('node_modules/openseadragon/build/openseadragon/images') {
        into 'static/images/openseadragon'
85
    }
86
87
88
    from ("${buildDir}/sass/") {
        into 'static/css'
    }
Ubbo Veentjer's avatar
Ubbo Veentjer committed
89
90
91
92
93
94
95
96
97
98
99
100
101
    from ("${buildDir}/js/") {
        into 'static/js'
    }
}

jsOptions {  
  inputPath = file("./src/main/resources/static/js/")  
  outputPath = file("${buildDir}/js/")  
  compilationLevel = "SIMPLE_OPTIMIZATIONS"  
  jsVersionIn = 'ECMASCRIPT_2020'  
  jsVersionOut = 'ECMASCRIPT5'  
  combineAllFiles = false
  keepSameName = false  
102
103
}

Ubbo Veentjer's avatar
Ubbo Veentjer committed
104
105
106
107
108
109
110
111
112
113
test {
    finalizedBy jacocoTestReport
}

jacocoTestReport {
  reports {
    csv.enabled true
  }
}