WIP: AVRO-4223 Gradle plugin for generating Java code#3614
WIP: AVRO-4223 Gradle plugin for generating Java code#3614frevib wants to merge 88 commits intoapache:mainfrom
Conversation
Fix Intellij not finding generated sources Add generating BigDecimal property
Add dynamic output directory
|
Avro gradle plugin Protocol support has been added in this release |
|
@raphaelauv did you test the latest release https://plugins.gradle.org/plugin/eu.eventloopsoftware.avro-gradle-plugin? No need to add |
lang/java/gradle-plugin/README.md
Outdated
|
|
||
| ```kotlin | ||
| avro { | ||
| sourceZipFiles = listOf("/home/user/.gradle/caches/modules-2/files-2.1/eu.eventloopsoftware.group-id/artifact-id/1.0.0/92ac3d0533de9dd79ac35373c892ebaa01763d4d/jar_with_schemas-1.0.0.jar") |
There was a problem hiding this comment.
Instead of this, we probably want to add some pre-configured configuration, called avroSources or something that way people can add their dependencies as normal, like
dependencies {
avroSources("eu.eventloopsoftware.group-id:artifact-id:1.0.0") // ...Certain plugins ship their own dependencies block (like in Gradle's test suites plugin) so perhaps something like
avro {
sourceZipFiles {
dependencies {
avroSources("eu.eventloopsoftware.group-id:artifact-id:1.0.0") // ...
could be used.
There was a problem hiding this comment.
Is is possible to add the compile- & runtime dependencies while generating code? Then we wouldn't need any configuration at all.
There was a problem hiding this comment.
@opwvhk I'm not quite following? I think the dependencies here was just to allow people to add avro sources that are zipped in jars deployed to a standard maven repo.
There was a problem hiding this comment.
Otherwise, if we at least made sourceZipFiles a ConfigurableFileCollection, then users could configure either via files, or a their own custom configuration.
| <executable>./gradlew</executable> | ||
| <arguments> | ||
| <argument>assemble</argument> | ||
| <argument>-i</argument> |
There was a problem hiding this comment.
Can we pass the Maven log level here? I doubt it, but it would be convenient.
There was a problem hiding this comment.
Which Maven log level? The Maven log level can be passed when this Maven command is run, which in turn runs this Gradle command: ./gradlew assemble -i. Passing a Maven argument here would be on the wrong level, one too deep.
...va/gradle-plugin/src/main/kotlin/eu/eventloopsoftware/avro/gradle/plugin/AvroGradlePlugin.kt
Outdated
Show resolved
Hide resolved
|
I have created https://issues.apache.org/jira/browse/INFRA-27616 for the requirement from Gradle to prove the ownership of avro.apache.org DNS domain. |
What is the purpose of the change
Gradle plugin to generate Java code from Avro files
Verifying this change
This change added tests and can be verified as follows:
cd to
avro/lang/java/gradle-plugin./gradlew testDocumentation
Release
0.0.2is released and fully works with AVSC files: https://central.sonatype.com/artifact/eu.eventloopsoftware.avro-gradle-plugin/eu.eventloopsoftware.avro-gradle-plugin.gradle.plugin/versions - read docs (above) how to use0.0.5https://plugins.gradle.org/plugin/eu.eventloopsoftware.avro-gradle-plugin0.0.8https://plugins.gradle.org/plugin/eu.eventloopsoftware.avro-gradle-plugin0.1.0https://plugins.gradle.org/plugin/eu.eventloopsoftware.avro-gradle-plugin - this release adds Protocol support.Protocol support has been added in this release
Installation instructions: https://github.com/frevib/avro/blob/AVRO-4223-gradle-plugin/lang/java/gradle-plugin/README.md#version
An official release will be done in the coming month