Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3f04a2c
Add Gradle plugin bootstrap
Nov 19, 2025
7a18d79
Add test for generating Java code
Nov 22, 2025
e6082e6
Rename task
Nov 22, 2025
8947e41
Add Maven publish
Nov 23, 2025
d0b8794
Rever change to Java file
Nov 23, 2025
ea3e5b6
Rever changes to Java files
Nov 23, 2025
2589fdd
Cleanup
Nov 23, 2025
28934e0
Add schemaType
Nov 23, 2025
737e585
Cleanup test
Nov 24, 2025
543c66b
Use Path instead of File for tests
Nov 29, 2025
5f1ac64
Remove null checks because it's Kotlin
Nov 29, 2025
3a9ae61
Improve test
Nov 29, 2025
93d7194
Add test source and output dir
Nov 30, 2025
afd90c8
Refactor
Nov 30, 2025
b765eb7
Add field visibility property
Nov 30, 2025
1b0d7f5
Add excludes property
Nov 30, 2025
fafd298
Add stringType and templateDirectory
Nov 30, 2025
634cd63
Add properties
Nov 30, 2025
f71ba50
Add properties
Nov 30, 2025
7c67834
Check if source directories exist
Nov 30, 2025
453c7a0
Cleanup
Nov 30, 2025
1b449b4
Cleanup
Nov 30, 2025
4fdab98
Cleanup
Nov 30, 2025
c4a06ae
Add readme
Nov 30, 2025
1b6efe7
Move to SourceTask
Dec 7, 2025
6c0b29e
Update readme
Dec 7, 2025
444d91c
Add dependency for generated sources
Dec 7, 2025
6daa02e
Update reamde
Dec 7, 2025
626e90c
Remove unneeded adding of dependency
Dec 7, 2025
21c8340
Update readme
Dec 7, 2025
4beb01d
Update readme
Dec 7, 2025
c42fee9
Update readme
Dec 7, 2025
0e2a47f
Rename class
frevib Dec 20, 2025
e22d2c3
Use different Gradle Task for generating test sources
frevib Dec 20, 2025
3dccc3c
Add support for Velocity class names
frevib Dec 20, 2025
5525f61
Add test for recordSpecificClass
frevib Dec 20, 2025
e746bbd
Merge remote-tracking branch 'upstream/main' into feat/gradle-plugin
frevib Dec 20, 2025
529144f
Add generate options
frevib Dec 20, 2025
ae791a0
Update README
frevib Dec 21, 2025
a989843
AVRO-4223
frevib Jan 5, 2026
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
927 changes: 0 additions & 927 deletions doc/package-lock.json

This file was deleted.

3 changes: 3 additions & 0 deletions lang/java/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@
dependency-reduced-pom.xml
mapred/userlogs/
tools/userlogs/
gradle-plugin/build
gradle-plugin/.kotlin
gradle-plugin/.gradle
59 changes: 59 additions & 0 deletions lang/java/gradle-plugin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# 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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The README references plugin id eu.eventloopsoftware.avro-gradle-plugin (and version 0.0.2), but this PR defines the plugin id as org.apache.avro.avro-gradle-plugin in gradlePlugin { ... }, which will confuse consumers.

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎

}
```
Comment on lines +12 to +16
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Critical: Plugin ID doesn't match the implementation.

The README references plugin ID eu.eventloopsoftware.avro-gradle-plugin, but the AI summary and build.gradle.kts implementation define the plugin as org.apache.avro.avro-gradle-plugin. This makes the usage instructions incorrect and non-functional.

🔎 Proposed fix
 ```kotlin
 plugins {
-    id("eu.eventloopsoftware.avro-gradle-plugin") version "0.0.2"
+    id("org.apache.avro.avro-gradle-plugin") version "1.13.0-SNAPSHOT"
 }

Also verify and update the version to match the project version.
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🤖 Prompt for AI Agents
In @lang/java/gradle-plugin/README.md around lines 12-16, The README's Gradle
snippet uses the wrong plugin id "eu.eventloopsoftware.avro-gradle-plugin" which
doesn't match the implementation; update the snippet to use the actual plugin id
"org.apache.avro.avro-gradle-plugin" and set the version to the project's actual
version (e.g., replace "0.0.2" with the project version such as
"1.13.0-SNAPSHOT" or whatever version defined in the build configuration) so the
example matches the implemented plugin and will work when applied.

Add Avro dependency

```kotlin
implementation("org.apache.avro:avro:1.12.1")
```
Comment on lines +19 to +21
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Update Avro version to match project version.

The README references Avro version 1.12.1, but this plugin is part of Avro 1.13.0-SNAPSHOT. Update the documentation to reference the current project version for consistency.

🔎 Proposed fix
 Add Avro dependency

 ```kotlin
-implementation("org.apache.avro:avro:1.12.1")
+implementation("org.apache.avro:avro:1.13.0")
</details>

<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion

🤖 Prompt for AI Agents
In @lang/java/gradle-plugin/README.md around lines 19-21, Update the Avro
dependency version referenced in the README: replace the implementation line
that currently specifies org.apache.avro:avro:1.12.1 with the current project
version org.apache.avro:avro:1.13.0 so the documentation matches the plugin's
Avro version.

Configure Avro Gradle plugin
```kotlin
avro {
sourceDirectory = "src/main/avro"
// All properties are available in `GradlePluginExtension.kt`
}
```

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 avro-gradle-plugin
https://codeberg.org/frevib/use-gradle-plugin-test
Comment on lines +56 to +57
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

Codeberg frevib use-gradle-plugin-test repository Apache Avro

💡 Result:

I attempted to look up the Codeberg repo but codeberg.org is blocked by robots.txt so I can't fetch it. [1]

I did find related work by the same author on GitHub — a gradle-plugin branch and PR for Apache Avro (frevib/avro). If you want info about the Avro Gradle plugin or that repo I can fetch and summarize it (GitHub results shown below). [2]

Sources:

  • codeberg.org blocked by robots.txt (access failure). [1]
  • frevib/avro (Gradle plugin branch / PR on GitHub). [2]

What would you like me to do next?
(Options: 1) Try GitHub frevib/avro and summarize the gradle-plugin, 2) Give instructions how to test a local Gradle plugin with Avro, 3) you can paste the Codeberg repo URL or files for me to inspect.)


🏁 Script executed:

# Check if there are other example projects referenced in the codebase
find . -name "*.md" -o -name "*.txt" | xargs grep -l "example\|Example" | head -20

Repository: martin-augment/avro

Length of output: 5832


🏁 Script executed:

# Look at the full context of the README to understand the purpose of this link
cd lang/java/gradle-plugin
head -70 README.md | tail -20

Repository: martin-augment/avro

Length of output: 445


🏁 Script executed:

# Check if there's an examples directory in the Apache Avro repository
git ls-files | grep -i example | head -20

Repository: martin-augment/avro

Length of output: 913


Label external example or provide an official alternative.

The README links to a non-Apache external resource (codeberg.org/frevib/use-gradle-plugin-test) that cannot be verified as actively maintained. Either include a disclaimer clearly marking it as community-maintained and subject to change, or provide an example within the Apache Avro repository.

🤖 Prompt for AI Agents
In @lang/java/gradle-plugin/README.md around lines 56-57, Update the README
section headed "Example project that uses avro-gradle-plugin" to either mark the
external Codeberg link as community-maintained and subject to change (add a
short disclaimer next to the link) or replace it with an official example inside
this repo (e.g., add a pointer to an example project or documented sample under
the avro-gradle-plugin examples folder). Mention the link text
"https://codeberg.org/frevib/use-gradle-plugin-test" explicitly so reviewers can
find and change that reference, and ensure the new text clarifies maintenance
status or points to the in-repo alternative.



58 changes: 58 additions & 0 deletions lang/java/gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

plugins {
kotlin("jvm") version "2.2.10"
`java-gradle-plugin`
`maven-publish`
}

group = "org.apache.avro"
version = "1.13.0-SNAPSHOT"

repositories {
mavenCentral()
mavenLocal()
}

dependencies {
//implementation("org.gradle:gradle-tooling-api:7.1.1")
implementation("org.apache.avro:avro-compiler:${version}")
testImplementation(kotlin("test"))
}

tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}

java {
withSourcesJar()
}


gradlePlugin {
plugins {
create("gradlePlugin") {
id = "org.apache.avro.avro-gradle-plugin"
implementationClass = "org.apache.avro.gradle.plugin.GradlePlugin"
}
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
251 changes: 251 additions & 0 deletions lang/java/gradle-plugin/gradlew

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading