Skip to content
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

AVRO-1884: Add set source file suffix function for generate non-java file #90

Closed
wants to merge 1 commit into from

Conversation

shijinkui
Copy link
Contributor

@shijinkui shijinkui commented May 5, 2016

example:

compiler.setSuffix(".scala")
compiler.setTemplateDir(templatePath)
compiler.compileToDestination(file, new File("src/main/scala/"))

@rdblue
Copy link
Contributor

rdblue commented May 11, 2016

Hi @shijinkui, thanks for opening this.

I'm not sure how this is intended to work. We currently use the "java" suffix because all of the files that are generated are Java code. Since we don't generate scala, I don't see how this is very useful. If you wanted to add Scala code generation, that would be useful, but I think in that case we'd want to hard-code "scala" as the file suffix.

@shijinkui
Copy link
Contributor Author

@rdblue thanks for review. When i want't generate scala code, I use my own velocity template instead of default velocity template. So the default suffix Java is not suitable. Make makepath function as public will be very useful and nice to me.

Thanks.

@busbey
Copy link
Contributor

busbey commented Jul 5, 2016

Hi!

Please file an issue on the project's JIRA tracker, link to this PR, and set the status to "Patch Available".

For more details on contributing to Avro, please see our contribution guide

@shijinkui shijinkui changed the title Add set source file suffix function for generate non-java file AVRO-1884: Add set source file suffix function for generate non-java file Jul 18, 2016
…for example:

```
compiler.setSuffix(".scala")
compiler.setTemplateDir(templatePath)
compiler.compileToDestination(file, new File("src/main/scala/"))
```
@shijinkui
Copy link
Contributor Author

shijinkui commented Jul 18, 2016

@busbey @rdblue @krschultz

@shijinkui shijinkui closed this Jul 18, 2016
@shijinkui shijinkui reopened this Jul 18, 2016
@rdblue
Copy link
Contributor

rdblue commented Sep 4, 2016

Thanks for the response, @shijinkui. That makes more sense.

+1

@asfgit asfgit closed this in e6d2c4d Sep 4, 2016
asfgit pushed a commit that referenced this pull request Nov 5, 2016
Use when generating non-Java files with custom templates. For example:

```
compiler.setSuffix(".scala")
compiler.setTemplateDir(scalaTemplatePath)
compiler.compileToDestination(file, new File("src/main/scala/"))
```

Closes #90.
SingingBush pushed a commit to SingingBush/avro that referenced this pull request Jun 29, 2023
…-support

Add support for generating getters that return Optional
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants