summaryrefslogtreecommitdiff
path: root/build.gradle
blob: 4670c2ebd151eb61a007d4b435f36e9304ef64a1 (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
// This file is in the public domain.

plugins {
    id("org.jetbrains.kotlin.jvm") version "1.9.22"
    id("org.jetbrains.dokka") version "1.9.10"
    id("idea")
    id("java-library")
    id("maven-publish")
}

group = "tech.libeufin"
version = "0.9.4a"

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

allprojects {
    ext {
        set("kotlin_version", "1.9.22")
        set("ktor_version", "2.3.9")
        set("clikt_version", "4.2.2")
        set("coroutines_version", "1.8.0")
        set("postgres_version", "42.7.1")
        set("junixsocket_version", "2.9.0")
    }

    repositories {
        mavenCentral()
    }
}

subprojects {
    apply plugin: 'org.jetbrains.dokka'
}

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

task versionFile() {
    def stdout = new ByteArrayOutputStream()
    exec {
        commandLine 'git', 'rev-parse', '--short', 'HEAD'
        standardOutput = stdout
    }
    def gitHash = stdout.toString().trim()
    def version = getRootProject().version
    new File("${projectDir}/common/src/main/resources", "version.txt").text = "v$version-git-$gitHash"
}

// See: https://stackoverflow.com/questions/24936781/gradle-plugin-project-version-number
task libeufinVersion {
    doLast {
        println project.version
    }
}

classes {
    dependsOn versionFile
}