mirror of https://github.com/micromata/borgbackup-butler.git

Kai Reinhard
24.12.2019 bc1c54c980e19d203eec95b89bc64f6e520a1783
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
buildscript {
    repositories {
        mavenCentral()
    }
}
 
plugins {
    id 'io.franzbecker.gradle-lombok' version '1.14'
    id 'java'
}
 
description = 'borgbutler-server'
 
dependencies {
    compile project(':borgbutler-core')
    // https://mvnrepository.com/artifact/org.apache.commons/commons-text
    compile group: 'org.apache.commons', name: 'commons-text', version: '1.6'
    compile group: 'org.eclipse.jetty', name: 'jetty-server', version: '9.4.12.v20180830'
    compile group: 'org.eclipse.jetty', name: 'jetty-servlet', version: '9.4.12.v20180830'
    compile group: 'org.eclipse.jetty', name: 'jetty-servlets', version: '9.4.12.v20180830'
    compile group: 'org.glassfish.jaxb', name: 'jaxb-core', version: '2.3.0.1'
    compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.1'
    compile group: 'org.glassfish.jersey.containers', name: 'jersey-container-servlet', version: '2.27'
    compile group: 'org.glassfish.jersey.media', name: 'jersey-media-multipart', version: '2.27'
    compile group: 'org.glassfish.jersey.media', name: 'jersey-media-json-jackson', version: '2.27'
    compile group: 'org.glassfish.jersey.inject', name: 'jersey-hk2', version: '2.27'
    compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
    compile group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.1'
    compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.25'
    // https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient
    compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.5.6'
 
    // https://mvnrepository.com/artifact/commons-cli/commons-cli
    compile group: 'commons-cli', name: 'commons-cli', version: '1.4'
    testCompile group: 'org.mockito', name: 'mockito-core', version: '2.21.0'
 
    compileOnly "org.projectlombok:lombok:1.18.4"
    testCompileOnly "org.projectlombok:lombok:1.18.4"
}
 
repositories {
    mavenCentral()
    jcenter()
}
 
lombok {
    version = '1.18.4'
    sha256 = "" // skip verifyLombok task
}
 
apply plugin: 'application'
mainClassName = "de.micromata.borgbutler.server.Main"
 
run() {
    doFirst {
        jvmArgs = [
                "-DapplicationHome=${rootDir}"
        ]
    }
}
 
run.dependsOn ':borgbutler-webapp:npmBuild'
// run.dependsOn ':borgbutler-docs:buildWebDoc'
 
apply plugin: 'distribution'
 
task createVersionProperties(dependsOn: processResources) {
    doLast {
        new File("$buildDir/resources/main/version.properties").withWriter { w ->
            Properties p = new Properties()
            p['version'] = project.version.toString()
            p['name'] = project.name
            p['build.date.millis'] = '' + System.currentTimeMillis()
            p.store w, null
        }
    }
}
 
classes {
    dependsOn createVersionProperties
}
 
// Ugly work arround for getting the applications home dir:
applicationDefaultJvmArgs = ["-DapplicationHome=MY_APPLICATION_HOME"]
 
startScripts {
    doLast {
        unixScript.text = unixScript.text.replace('MY_APPLICATION_HOME', '\$APP_HOME')
        windowsScript.text = windowsScript.text.replace('MY_APPLICATION_HOME', '%~dp0..')
    }
}
 
// Builds the distribution
distributions {
    main {
        contents {
            // Prepared by nbmBuild:
            from ("${project(':borgbutler-webapp').projectDir}/build") {
                into 'web'
            }
            // Containing test templates and other stuff:
            from ("${rootProject.projectDir}/examples") {
                into 'examples'
            }
        }
    }
}
 
distZip.dependsOn ':borgbutler-webapp:npmBuild'
//distZip.dependsOn ':borgbutler-docs:buildWebDoc'
task(dist).dependsOn distZip