Created
September 24, 2021 01:43
-
-
Save kmtr/3af7535fd046a9f8d2f76b629c93fc70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* This file was generated by the Gradle 'init' task. | |
* | |
* This generated file contains a sample Kotlin application project to get you started. | |
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle | |
* User Manual available at https://docs.gradle.org/7.2/userguide/building_java_projects.html | |
*/ | |
plugins { | |
// Apply the org.jetbrains.kotlin.jvm Plugin to add support for Kotlin. | |
id("org.jetbrains.kotlin.jvm") version "1.5.0" | |
id("com.github.davidmc24.gradle.plugin.avro") version "1.2.1" | |
// Apply the application plugin to add support for building a CLI application in Java. | |
application | |
} | |
repositories { | |
gradlePluginPortal() | |
// Use Maven Central for resolving dependencies. | |
mavenCentral() | |
} | |
dependencies { | |
// Align versions of all Kotlin components | |
implementation(platform("org.jetbrains.kotlin:kotlin-bom")) | |
// Use the Kotlin JDK 8 standard library. | |
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8") | |
// This dependency is used by the application. | |
implementation("com.google.guava:guava:30.1.1-jre") | |
// Use the Kotlin test library. | |
testImplementation("org.jetbrains.kotlin:kotlin-test") | |
// Use the Kotlin JUnit integration. | |
testImplementation("org.jetbrains.kotlin:kotlin-test-junit") | |
// Avro | |
implementation("org.apache.avro:avro:1.10.1") | |
} | |
application { | |
// Define the main class for the application. | |
mainClass.set("kmtr.kotlin.avro.kafka.AppKt") | |
} | |
/** | |
* AVRO | |
* | |
* gradle generateAvroProtocol | |
* input dir: main/avro/*.avdl | |
* output dir: build/generated-main-avro-avpr/*.avpr | |
* | |
* gradle generateAvroJava | |
* input: build/generated-main-avro-avpr/*.avpr | |
* output: build/generated-main-avro-java/*.java | |
*/ | |
avro { | |
isCreateSetters.set(true) | |
isCreateOptionalGetters.set(false) | |
isGettersReturnOptional.set(false) | |
isOptionalGettersForNullableFieldsOnly.set(false) | |
fieldVisibility.set("PUBLIC_DEPRECATED") | |
outputCharacterEncoding.set("UTF-8") | |
stringType.set("String") | |
templateDirectory.set(null as String?) | |
isEnableDecimalLogicalType.set(true) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment