libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit bc119db2bf75b9319dd01cdcb36a98d099a15ddc
parent fbcd7e2e04e083fac1bc770a69f6be87aef6c2f8
Author: Antoine A <>
Date:   Thu,  9 Nov 2023 14:07:13 +0000

Improve build config and update dependencies

Diffstat:
MMakefile | 3++-
Mbank/build.gradle | 81+++++++++++++++++++++++++++++++------------------------------------------------
Mbuild.gradle | 23+++++++++++++----------
Mnexus/build.gradle | 91++++++++++++++++++++++++-------------------------------------------------------
Mutil/build.gradle | 64+++++++++++++++++++++++-----------------------------------------
5 files changed, 97 insertions(+), 165 deletions(-)

diff --git a/Makefile b/Makefile @@ -55,7 +55,8 @@ install-nexus: install contrib/libeufin-nexus.conf $(nexus_config_dir)/ install -D database-versioning/libeufin-nexus*.sql -t $(nexus_sql_dir) install -D database-versioning/versioning.sql -t $(nexus_sql_dir) - ./gradlew -q -Pprefix=$(abs_destdir)$(prefix) nexus:installToPrefix + ./gradlew nexus:installShadowDist + cp -r nexus/build/install/nexus-shadow/* -d $(abs_destdir)$(prefix) .PHONY: assemble assemble: diff --git a/bank/build.gradle b/bank/build.gradle @@ -1,71 +1,53 @@ plugins { - id 'kotlin' - id 'java' - id 'application' - id 'org.jetbrains.kotlin.jvm' - id "com.github.johnrengelman.shadow" version "8.1.1" - id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version" -} - -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + id("kotlin") + id("application") + id("com.github.johnrengelman.shadow") version "8.1.1" + id("org.jetbrains.kotlin.plugin.serialization") version "$kotlin_version" } version = rootProject.version -compileKotlin { - kotlinOptions { - jvmTarget = "11" - } +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } -compileTestKotlin { - kotlinOptions { - jvmTarget = "11" - } -} +compileKotlin.kotlinOptions.jvmTarget = "17" +compileTestKotlin.kotlinOptions.jvmTarget = "17" -sourceSets { - main.java.srcDirs = ['src/main/kotlin'] -} +sourceSets.main.java.srcDirs = ["src/main/kotlin"] dependencies { - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3' - implementation project(":util") + // Core language libraries + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") + + // LibEuFin util library + implementation(project(":util")) - implementation 'org.postgresql:postgresql:42.6.0' - implementation 'com.zaxxer:HikariCP:5.0.1' - implementation "com.github.ajalt.clikt:clikt:4.2.1" + implementation("org.postgresql:postgresql:42.6.0") + implementation("com.zaxxer:HikariCP:5.0.1") + implementation("com.github.ajalt.clikt:clikt:4.2.1") - implementation "io.ktor:ktor-server-core:$ktor_version" - implementation "io.ktor:ktor-server-call-logging:$ktor_version" - implementation "io.ktor:ktor-server-cors:$ktor_version" - implementation "io.ktor:ktor-server-content-negotiation:$ktor_version" - implementation "io.ktor:ktor-server-status-pages:$ktor_version" - implementation "io.ktor:ktor-server-netty:$ktor_version" - implementation "io.ktor:ktor-server-test-host:$ktor_version" - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0" - implementation "io.ktor:ktor-serialization-kotlinx-json:$ktor_version" + implementation("io.ktor:ktor-server-core:$ktor_version") + implementation("io.ktor:ktor-server-call-logging:$ktor_version") + implementation("io.ktor:ktor-server-cors:$ktor_version") + implementation("io.ktor:ktor-server-content-negotiation:$ktor_version") + implementation("io.ktor:ktor-server-status-pages:$ktor_version") + implementation("io.ktor:ktor-server-netty:$ktor_version") + implementation("io.ktor:ktor-server-test-host:$ktor_version") + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") + implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version") - testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" - testImplementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version" - testImplementation group: "junit", name: "junit", version: '4.13.2' + testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version") - testImplementation project(":util") + testImplementation(project(":util")) // UNIX domain sockets support (used to connect to PostgreSQL) - implementation 'com.kohlschutter.junixsocket:junixsocket-core:2.8.1' + implementation("com.kohlschutter.junixsocket:junixsocket-core:2.8.1") } application { mainClass = "tech.libeufin.bank.MainKt" applicationName = "libeufin-bank" applicationDefaultJvmArgs = ['-Djava.net.preferIPv6Addresses=true'] -} - -jar { - manifest { - attributes "Main-Class": "tech.libeufin.bank.MainKt" - } -} +} +\ No newline at end of file diff --git a/build.gradle b/build.gradle @@ -3,24 +3,27 @@ import org.apache.tools.ant.filters.ReplaceTokens plugins { - id 'org.jetbrains.kotlin.jvm' version '1.9.20' - id 'idea' - id 'java-library' - id 'maven-publish' + id("org.jetbrains.kotlin.jvm") version "1.9.20" + id("idea") + id("java-library") + id("maven-publish") } -group = 'tech.libeufin' -version = '0.9.3' +group = "tech.libeufin" +version = "0.9.3" -if (!JavaVersion.current().isJava11Compatible()){ +if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)){ throw new GradleException( - "This build must be run with java 11 " + + "This build must be run with java 17 " + "or later (your version is java ${JavaVersion.current()})") } allprojects { - ext.set("kotlin_version", "1.9.20") - ext.set("ktor_version", "2.3.3") + ext { + set("kotlin_version", "1.9.20") + set("ktor_version", "2.3.6") + set("netty_version", "4.1.100.Final") + } repositories { mavenCentral() diff --git a/nexus/build.gradle b/nexus/build.gradle @@ -1,95 +1,64 @@ plugins { - id 'kotlin' - id 'java' - id 'application' - id 'org.jetbrains.kotlin.jvm' - id "com.github.johnrengelman.shadow" version "8.1.1" - id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version" + id("kotlin") + id("application") + id("com.github.johnrengelman.shadow") version "8.1.1" + id("org.jetbrains.kotlin.plugin.serialization") version "$kotlin_version" } -sourceSets { - main.java.srcDirs = ['src/main/kotlin'] -} - -task installToPrefix(type: Copy) { - dependsOn(installShadowDist) - from("build/install/nexus-shadow") { - include("**/libeufin-nexus") - include("**/*.jar") - } - into "${project.findProperty('prefix') ?: '/tmp'}" // reads from -Pprefix=foo, defaults to /tmp -} - -apply plugin: 'kotlin-kapt' +version = rootProject.version java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } -version = rootProject.version - -compileKotlin { - kotlinOptions { - jvmTarget = '11' - } -} +compileKotlin.kotlinOptions.jvmTarget = "17" +compileTestKotlin.kotlinOptions.jvmTarget = "17" -compileTestKotlin { - kotlinOptions { - jvmTarget = '11' - } -} +sourceSets.main.java.srcDirs = ["src/main/kotlin"] dependencies { // Core language libraries - implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1-native-mt' + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3") // LibEuFin util library - implementation project(":util") - - // Logging - implementation 'ch.qos.logback:logback-classic:1.4.5' + implementation(project(":util")) // XML parsing/binding and encryption - implementation "javax.xml.bind:jaxb-api:2.3.0" - implementation "org.glassfish.jaxb:jaxb-runtime:2.3.1" - implementation 'org.apache.santuario:xmlsec:2.2.2' + implementation("javax.xml.bind:jaxb-api:2.3.0") + implementation("org.glassfish.jaxb:jaxb-runtime:2.3.1") + implementation("org.apache.santuario:xmlsec:2.2.2") // Compression - implementation group: 'org.apache.commons', name: 'commons-compress', version: '1.21' + implementation("org.apache.commons:commons-compress:1.21") // Command line parsing - implementation "com.github.ajalt.clikt:clikt:4.2.1" - // Database - implementation 'org.postgresql:postgresql:42.6.0' - implementation 'com.zaxxer:HikariCP:5.0.1' + implementation("com.github.ajalt.clikt:clikt:4.2.1") + implementation("org.postgresql:postgresql:42.6.0") + implementation("com.zaxxer:HikariCP:5.0.1") // Ktor client library - implementation "io.ktor:ktor-client-apache:$ktor_version" + implementation("io.ktor:ktor-client-apache:$ktor_version") // Brings the call-logging library too. - implementation "io.ktor:ktor-server-test-host:$ktor_version" + implementation("io.ktor:ktor-server-test-host:$ktor_version") // PDF generation - implementation 'com.itextpdf:itext7-core:7.1.16' + implementation("com.itextpdf:itext7-core:7.1.16") // UNIX domain sockets support (used to connect to PostgreSQL) - implementation 'com.kohlschutter.junixsocket:junixsocket-core:2.6.2' + implementation("com.kohlschutter.junixsocket:junixsocket-core:2.8.1") // Serialization implementation("io.ktor:ktor-serialization-kotlinx-json:$ktor_version") - implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1" + implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.6.0") // Unit testing - testImplementation 'org.junit.jupiter:junit-jupiter:5.7.1' - testImplementation 'org.jetbrains.kotlin:kotlin-test:1.5.21' - testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.5.21' - testImplementation 'io.ktor:ktor-client-mock:2.2.4' - testImplementation 'com.kohlschutter.junixsocket:junixsocket-core:2.6.2' + testImplementation("org.junit.jupiter:junit-jupiter:5.7.1") + testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version") + testImplementation("io.ktor:ktor-client-mock:2.2.4") } test { - useJUnit() failFast = true testLogging.showStandardStreams = false } @@ -100,12 +69,6 @@ application { applicationDefaultJvmArgs = ['-Djava.net.preferIPv6Addresses=true'] } -jar { - manifest { - attributes "Main-Class": "tech.libeufin.nexus.MainKt" - } -} - run { standardInput = System.in } \ No newline at end of file diff --git a/util/build.gradle b/util/build.gradle @@ -1,56 +1,37 @@ -plugins { - id 'java' - id 'application' - id 'org.jetbrains.kotlin.jvm' -} +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile -java { - sourceCompatibility = JavaVersion.VERSION_11 - targetCompatibility = JavaVersion.VERSION_11 +plugins { + id("java") + id("kotlin") } version = rootProject.version -compileKotlin { - - kotlinOptions { - jvmTarget = "11" - } -} - -compileTestKotlin { - kotlinOptions { - jvmTarget = "11" - } +java { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 } -sourceSets { - main.java.srcDirs = ['src/main/java', 'src/main/kotlin'] -} +compileKotlin.kotlinOptions.jvmTarget = "17" +compileTestKotlin.kotlinOptions.jvmTarget = "17" -def netty_version = '4.1.68.Final' +sourceSets.main.java.srcDirs = ["src/main/kotlin"] dependencies { - implementation 'ch.qos.logback:logback-classic:1.4.5' - implementation 'io.ktor:ktor-server-netty:1.6.1' + implementation("ch.qos.logback:logback-classic:1.4.5") + implementation("io.ktor:ktor-server-netty:$ktor_version") // XML Stuff - implementation "javax.xml.bind:jaxb-api:2.3.1" - implementation "org.glassfish.jaxb:jaxb-runtime:2.3.1" - implementation 'org.apache.santuario:xmlsec:2.2.2' + implementation("javax.xml.bind:jaxb-api:2.3.1") + implementation("org.glassfish.jaxb:jaxb-runtime:2.3.1") + implementation("org.apache.santuario:xmlsec:2.2.2") // Crypto - implementation group: 'org.bouncycastle', name: 'bcprov-jdk15on', version: '1.69' + implementation("org.bouncycastle:bcprov-jdk15on:1.69") // Unix domain socket to serve HTTP - implementation "io.netty:netty-all:$netty_version" - implementation "io.netty:netty-transport-native-epoll:$netty_version" - implementation "io.ktor:ktor-server-test-host:$ktor_version" + implementation("io.netty:netty-all:$netty_version") + implementation("io.netty:netty-transport-native-epoll:$netty_version") + implementation("io.ktor:ktor-server-test-host:$ktor_version") // Database helper - implementation group: 'org.postgresql', name: 'postgresql', version: '42.5.4' + implementation("org.postgresql:postgresql:42.6.0") - testImplementation group: 'junit', name: 'junit', version: '4.13.2' - testImplementation 'org.jetbrains.kotlin:kotlin-test-junit:1.5.21' - testImplementation 'org.jetbrains.kotlin:kotlin-test:1.5.21' -} - -application { - mainClassName = "tech.libeufin.util.MainKt" -} + testImplementation("org.jetbrains.kotlin:kotlin-test:$kotlin_version") +} +\ No newline at end of file