Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I generate to a different project?

Tags:

typewriter

So we are starting a new angular / webapi project, and we are splitting it up such that the client and the rest API are in 2 separate projects. The client project has no server-executed code. Just html and typescript (which we transpile to javascript, of course)

I want for my typewriter-generated DTOs to land in the client, but I don't even want to reference the WebAPI project from my client project. How can I set up the template so that when I save a change to my DTO, the typescript file is written to my client app? (or is there a different way to accomplish this?)

like image 227
JMarsch Avatar asked Apr 11 '16 21:04

JMarsch


1 Answers

As long as the two projects are in the same solution you can render the template from the client project without adding a reference to the API project.

To do this you'll need to add a constructor to the tst-template to include the API project.

${
    Template(Settings settings)
    {
        settings.IncludeProject("Project.Name");
    }
}
$Classes(...)[...]

Have a look at http://frhagn.github.io/Typewriter/pages/getting-started.html#settings

like image 138
frhagn Avatar answered Oct 21 '22 02:10

frhagn