Skip to content
This repository has been archived by the owner on Sep 12, 2021. It is now read-only.

Migrate to .g8 templates #113

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

alexander-myltsev
Copy link

@alexander-myltsev alexander-myltsev commented Dec 28, 2019

Pull Request Checklist

Fixes

Fixes #100

Purpose

The PR contains migration from the deprecated Activator template engine to giter8.

Background Context

giter8 is widely used in the Scala community.
The Play team has announced that they drop support for activator in favor of .g8 templates and SBT.

References

https://www.lightbend.com/blog/migrate-activator-giter8
https://groups.google.com/forum/#!topic/play-framework/NeMD04W6bN4

@alexander-myltsev
Copy link
Author

alexander-myltsev commented Dec 28, 2019

@akkie I have several notes and questions:

  1. You should rename the original repo to play-silhouette-seed.g8 to make it work with giter8
  2. In the comment, I asked the clarification between service files required by Activator and actual template files. For example, should scripts be available in the project or the template files?
  3. Same question for the README contents
  4. What are the input arguments for the template beside the application name?
  5. Seems like scalariformat doesn't work with g8 templates
  6. What do you think of the seed that might be configured for all possible backends (Mongo, Postgres, etc) instead of having separate GitHub repos for each one?

@akkie
Copy link
Contributor

akkie commented Dec 29, 2019

@alexander-myltsev Thanks for your work on this 👍

  1. This shouldn't be a problem
  2. Good question. The scripts are helpful in both cases. During the development of the Seed and also in the seed itself. Can this files be copied to the seed during installation?
  3. I think the Readme can be placed in the root of the template, because it describes the seed and it's functionality. If the seed is installed, then a new empty readme could be created
  4. I would say, that the application name is a starting point. If other arguments are needed they can be added later.
  5. Because of the source directory is non conform to a standard SBT project? Maybe scalafmt is another option?
  6. I'm not sure this is easily possible. I would concentrate on this seed first. If it's later easily possible, why not.

@alexander-myltsev
Copy link
Author

alexander-myltsev commented Jan 4, 2020

@akkie

Thanks for your work on this 👍

🎉

I haven't found how to configure both scalafmt and scalariformat to use another directory (which is g8). Beating around sourceDirectory and project.includeFilters didn't help. Do you know the exact way to do it?

@akkie
Copy link
Contributor

akkie commented Jan 7, 2020

@alexander-myltsev Sorry, I've no idea. Have you asked in the related project channels?

@alexander-myltsev
Copy link
Author

@akkie

scalariformat doesn't seem to have any public gitter channel.
scalafmt's channel doesn't respond.

Could you explain how scalafmt is going to be used? sh call to scalafmt -i -f src/main/g8/ works as expected. Or should it be used from sbt upon compile?

@akkie
Copy link
Contributor

akkie commented Jan 11, 2020

@alexander-myltsev I think having tools like scalafmt and scalariformat in a project is always a plus, for having a consistent code style.

So we could create a scalafmt script in the root directory of the project, which helps to keep the code style of this seed consistent. And then we can also integrate scalafmt in the seed itself, which helps the users of the seed to format the code during compilation. But the later part isn't a must have for me. I What do you think?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Migrate to .g8 templates
2 participants