-
Notifications
You must be signed in to change notification settings - Fork 0
3614: AVRO-4223 Gradle plugin for generating Java code #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
3f04a2c
7a18d79
e6082e6
8947e41
d0b8794
ea3e5b6
2589fdd
28934e0
737e585
543c66b
5f1ac64
3a9ae61
93d7194
afd90c8
b765eb7
1b0d7f5
fafd298
634cd63
f71ba50
7c67834
453c7a0
1b449b4
4fdab98
c4a06ae
1b6efe7
6c0b29e
444d91c
6daa02e
626e90c
21c8340
4beb01d
c42fee9
0e2a47f
e22d2c3
3dccc3c
5525f61
e746bbd
529144f
ae791a0
a989843
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| 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" | ||
| } | ||
| ``` | ||
|
Comment on lines
+12
to
+16
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Critical: Plugin ID doesn't match the implementation. The README references plugin ID 🔎 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"
}🤖 Prompt for AI Agents |
||
| Add Avro dependency | ||
|
|
||
| ```kotlin | ||
| implementation("org.apache.avro:avro:1.12.1") | ||
| ``` | ||
|
Comment on lines
+19
to
+21
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Update Avro version to match project version. The README references Avro version 🔎 Proposed fix Add Avro dependency
```kotlin
-implementation("org.apache.avro:avro:1.12.1")
+implementation("org.apache.avro:avro:1.13.0")🤖 Prompt for AI Agents |
||
| 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🌐 Web query:
💡 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:
What would you like me to do next? 🏁 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 -20Repository: 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 -20Repository: 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 -20Repository: martin-augment/avro Length of output: 913 Label external example or provide an official alternative. The README links to a non-Apache external resource ( 🤖 Prompt for AI Agents |
||
|
|
||
|
|
||
| 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" | ||
| } | ||
| } | ||
| } |
| 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 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
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 version0.0.2), but this PR defines the plugin id asorg.apache.avro.avro-gradle-pluginingradlePlugin { ... }, which will confuse consumers.🤖 Was this useful? React with 👍 or 👎