Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ plugins {
id 'com.github.andygoossens.modernizer' version '1.10.0' apply false
id 'com.github.spotbugs' version '6.0.26' apply false
id 'se.thinkcode.cucumber-runner' version '0.0.11' apply false
id "com.github.davidmc24.gradle.plugin.avro-base" version "1.9.1" apply false
id "eu.eventloopsoftware.avro-gradle-plugin" version "0.1.2" apply false
id 'org.openapi.generator' version '7.8.0' apply false
id 'com.gradleup.shadow' version '9.3.2' apply false
id 'me.champeau.jmh' version '0.7.1' apply false
Expand Down
21 changes: 13 additions & 8 deletions fineract-avro-schemas/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,10 @@
* under the License.
*/

import com.github.davidmc24.gradle.plugin.avro.GenerateAvroJavaTask

// TODO: @vidakovic we should publish this lib to Maven Central; do in separate PR
description = 'Fineract Avro Schemas'

apply plugin: 'com.github.davidmc24.gradle.plugin.avro-base'
apply plugin: 'eu.eventloopsoftware.avro-gradle-plugin'

apply from: 'dependencies.gradle'

Expand All @@ -41,7 +39,7 @@ abstract class PreprocessAvroSchemasTask extends DefaultTask {
def template = getBigDecimalTemplate().get().asFile.getText("UTF-8")
def input = getInputDir().get().asFile
def output = getOutputDir().get().asFile

input.eachFileRecurse { file ->
if (file.isFile()) {
def relativePath = input.toPath().relativize(file.toPath())
Expand All @@ -59,10 +57,11 @@ tasks.register('preprocessAvroSchemas', PreprocessAvroSchemasTask) {
outputDir = file("$buildDir/generated/avro/src/main/avro")
}

task buildJavaSdk(type: GenerateAvroJavaTask) {
source("$buildDir/generated/avro/src/main/avro")
outputDir = file("$buildDir/generated/java/src/main/java")
avro {
sourceDirectory = "$buildDir/generated/avro/src/main/avro"
outputDirectory = "$buildDir/generated/java/src/main/java"
templateDirectory = "$projectDir/src/main/resources/avro-generator-templates/"
enableDecimalLogicalType = true
}

spotless {
Expand All @@ -73,7 +72,13 @@ spotless {
}
}

buildJavaSdk.dependsOn(preprocessAvroSchemas, spotlessJsonApply)
tasks.named('avroGenerateJavaClasses') {
dependsOn tasks.named('preprocessAvroSchemas'), tasks.named('spotlessJsonApply')
}

def buildJavaSdk = tasks.register('buildJavaSdk') {
dependsOn tasks.named('avroGenerateJavaClasses')
}

sourceSets {
main {
Expand Down
Loading