build.gradle 3.57 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
    from ('docs') {
        into 'docs'
    }
74
75
76
    from ('docs/images') {
        into '/static/docs/images'
    }
77
78
79
80
81
82
    from('node_modules/font-awesome/fonts') {
        into 'static/fonts'
    }
    from ('node_modules/jquery/dist/jquery.min.js') {
        into 'static/js'
    }
83
84
85
86
    from ('node_modules/@sentry/browser/build/bundle.min.js') {
        rename '(.*)', 'sentry.$1'
        into 'static/js'
    }
87
88
89
90
91
    from ('node_modules/openseadragon/build/openseadragon/openseadragon.min.js') {
        into 'static/js'
    }
    from ('node_modules/openseadragon/build/openseadragon/images') {
        into 'static/images/openseadragon'
92
    }
93
94
95
    from ("${buildDir}/sass/") {
        into 'static/css'
    }
Ubbo Veentjer's avatar
Ubbo Veentjer committed
96
97
98
99
100
101
    from ("${buildDir}/js/") {
        into 'static/js'
    }
}

jsOptions {  
Ubbo Veentjer's avatar
Ubbo Veentjer committed
102
103
104
105
106
  inputPath = file("./src/main/javascript/")
  outputPath = file("${buildDir}/js/main.min.js")
  // advanced optimizations would be possible if externs could be declared with this plugin (for jquery $)
  // see https://developers.google.com/closure/compiler/docs/api-tutorial3?csw=1#externs
  compilationLevel = "SIMPLE_OPTIMIZATIONS"
Ubbo Veentjer's avatar
Ubbo Veentjer committed
107
108
  jsVersionIn = 'ECMASCRIPT_2020'  
  jsVersionOut = 'ECMASCRIPT5'  
Ubbo Veentjer's avatar
Ubbo Veentjer committed
109
  combineAllFiles = true
Ubbo Veentjer's avatar
Ubbo Veentjer committed
110
  keepSameName = false  
111
112
}

Ubbo Veentjer's avatar
Ubbo Veentjer committed
113
114
115
116
compileSass {
  style = compressed
}

Ubbo Veentjer's avatar
Ubbo Veentjer committed
117
118
119
120
121
122
123
124
125
126
test {
    finalizedBy jacocoTestReport
}

jacocoTestReport {
  reports {
    csv.enabled true
  }
}