Open boggye opened 8 months ago
Yeah sorry, there was a very explicit warning about this which disappeared in the last documentation update.
I'll update with clear instructions on how to handle this tomorrow hopefully, not on a computer today.
As a workaround just generate the source somewhere else and move it manually
Just a suggestion, maybe the default should not be to delete the directory.
I'm thinking about a better approach here, but haven't found it quite yet. Typo needs to be able to delete outdated files in the folder(s) you tell it you write to, so effectively it needs to control the whole folder and delete unknown files.
What I do is I add another source directory to the build and generate into it. That pattern is solid and would just need to be documented better. But there is still the possibility of data loss if people do the obvious thing
I ended up placing the code in target/scala-3.3.1/typo/main/scala and I added this path to the source paths in build.sbt with Compile / unmanagedSourceDirectories += baseDirectory.value / "target/scala-3.3.1/typo/main/scala"
.
I think I am good - we can close this thread.
Hi,
I have the following generator:
I have a play framework project and I want to place the generated code in a package under app. As is, the generator wiped out the content of the app folder (it included the controllers code and others) which was somewhat unexpected. I thought the generator would remove the
typo
folder recursively. Luckily, I use IntelliJ and I was able to restore the deleted code. It is a brand new project and I didn't add the code yet to git until now after this accident.Are there any options that allow me to tell the generator not to wipe out the content of the app folder, i.e. the content of targetDir?
For now, I am going to add the generated code somewhere under: target/scala-3.3.1\typo.
Thanks