summaryrefslogtreecommitdiff
path: root/build.gradle
blob: c86eb363326c60c8051f5f72204dbe5473383956 (plain)
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
import org.apache.tools.ant.filters.ReplaceTokens

plugins {
    id 'org.jetbrains.kotlin.jvm' version '1.4.30-RC'
    id 'idea'
}

if (!JavaVersion.current().isJava11Compatible()){
    throw new GradleException(
        "This build must be run with java 11 " +
        "or later (your version is java ${JavaVersion.current()})")
}

allprojects {
    repositories {
        mavenCentral()
        jcenter()
    }
}

idea {
    module {
        excludeDirs += file("frontend")
    }
}

setVersion("0.0.1-dev.3")

task versionFile() {
    new File("${projectDir}/util/src/main/resources", "version.txt").text = getRootProject().version
}

task replaceVersionCli(type: Copy) {
    from file("cli/bin/libeufin-cli")
    into file("${project.buildDir}/generated/python")
    filter(ReplaceTokens, tokens: [version: getRootProject().version])
}

classes {
    dependsOn versionFile
    dependsOn replaceVersionCli
}

task dist(type: Zip) {
    dependsOn versionFile
    dependsOn replaceVersionCli
    evaluationDependsOn("nexus")
    evaluationDependsOn("sandbox")
    def topDir = "${getRootProject().name}-${getRootProject().version}"
    archiveFileName = "${topDir}.zip"
    subprojects.each {
        if (it.name == "nexus" || it.name == "sandbox") {
            Task t = it.tasks.getByName("installShadowDist")
            dependsOn(t)
        }
    }
    from("nexus/build/install/nexus-shadow") {
        include("**/libeufin-nexus")
        include("**/*.jar")
    }
    from("sandbox/build/install/sandbox-shadow") {
        include("**/libeufin-sandbox")
        include("**/*.jar")
    }
    from("${project.buildDir}/generated/python") {
      include("libeufin-cli")
      rename { "bin/libeufin-cli" }
    }
    into(topDir)
}