opwvhk commented on code in PR #3614:
URL: https://github.com/apache/avro/pull/3614#discussion_r2667828775
##########
lang/java/gradle-plugin/README.md:
##########
@@ -0,0 +1,72 @@
+# Avro Gradle plugin (in development)
+
+Gradle plugin that generates Java code from Avro schemas
+
+## Usage
+
+### Add avro extension
+In `build.gradle.kts`:
+
+### Add plugin
+
+```kotlin
+plugins {
+ id("eu.eventloopsoftware.avro-gradle-plugin") version "0.0.2"
+}
+```
+### Add Avro dependency
+
+```kotlin
+implementation("org.apache.avro:avro:1.12.1")
+```
+
+### Configure Avro Gradle plugin
+
+```kotlin
+avro {
+ sourceDirectory = "src/main/avro"
+ // All properties are available in `GradlePluginExtension.kt`
+}
+```
+
+### Configure Maven dependency repository
+In `settings.gradle.kts`:
+
+Plugin is published on Maven Central:
+```kotlin
+pluginManagement {
+ repositories {
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
+```
+
+### Add a task hook
+For Intellij to recognize the newly generated Java files add this to
`build.gradle.kts`:
+
+```kotlin
+tasks.named("compileKotlin") {
dependsOn(tasks.named("avroGenerateJavaClasses")) }
+```
+
+### Generate Java classes
+
+`./gradlew avroGenerateJavaClasses`
+
+
+## Example project that uses the Apache Avro gradle-plugin
+https://codeberg.org/frevib/use-gradle-plugin-test
+
+## FAQ
+
+#### How can I benefit from Kotlin's null safety?
+Use `createNullSafeAnnotations = true` and Java getters will be annotated with
+`@org.jetbrains.annotations.NotNull`/ `@org.jetbrains.annotations.Nullable`.
This way
Review Comment:
Although JSpecify seems to become the new standard, I'd be hesitant to make
this change yet for the Maven plugin.
Here though, as both Gradle and Kotlin are moving in this direction and this
plugin is new, I think the JSpecify annotations are a good default to use.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]