-
Notifications
You must be signed in to change notification settings - Fork 0
/
Generator.cs
51 lines (42 loc) · 1.78 KB
/
Generator.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
public class Generator : BaseGenerator
{
private readonly ProjectGenerator projectGenerator;
private readonly DtoGenerator dtoGenerator;
private readonly DatabaseGenerator databaseGenerator;
private readonly GraphQlGenerator graphQlGenerator;
private readonly DockerGenerator dockerGenerator;
private readonly ReadmeGenerator readmeGenerator;
private readonly IntegrationTestGenerator integrationTestGenerator;
private readonly UnitTestGenerator unitTestGenerator;
public Generator(GeneratorConfig config)
: base(config)
{
projectGenerator = new ProjectGenerator(config);
dtoGenerator = new DtoGenerator(config);
databaseGenerator = new DatabaseGenerator(config);
graphQlGenerator = new GraphQlGenerator(config);
dockerGenerator = new DockerGenerator(config);
readmeGenerator = new ReadmeGenerator(config);
integrationTestGenerator = new IntegrationTestGenerator(config);
unitTestGenerator = new UnitTestGenerator(config);
}
public void Generate()
{
MakeDir();
MakeDir(Config.Output.SourceFolder);
MakeDir(Config.Output.IntegrationTestFolder);
MakeDir(Config.Output.UnitTestFolder);
projectGenerator.CreateDotNetProject();
MakeSrcDir(Config.Output.GeneratedFolder);
dtoGenerator.GenerateDtos();
databaseGenerator.GenerateDbContext();
graphQlGenerator.GenerateGraphQl();
projectGenerator.ModifyDefaultFiles();
dockerGenerator.GenerateDockerFiles();
integrationTestGenerator.GenerateIntegrationTests();
unitTestGenerator.GenerateUnitTests();
readmeGenerator.GenerateReadme();
databaseGenerator.CreateInitialMigration();
projectGenerator.FormatCode();
}
}