boujnah5207 / sharp-architecture

Automatically exported from code.google.com/p/sharp-architecture
Other
0 stars 0 forks source link

Scaffolding: commenting Run() deletes generated files #104

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. created solution using template
2. replaced ScaffoldingGenerator.tt with the one from
http://code.google.com/p/sharp-architecture/issues/detail?id=87
3. changed entity to "User", left only FirstName and LastName (db table
Users exists)
4. Uncommented generator.Run(); and saved - files created
5. Commented //generator.Run(); and saved - files deleted

From what I read I expected that files are not deleted after generation...
am I wrong?

I use SharpArchitecture_1.0.48.410_RC2.zip and T4Toolbox 9.5.20.1 on XP SP3.

The generated CRUD works fine... but when I comment //Run() everything
disappears.

Original issue reported on code.google.com by Sergey.P...@gmail.com on 5 Jun 2009 at 3:16

GoogleCodeExporter commented 9 years ago
Currently I see a solution to this: delete the .tt generation file after use 
(maybe
extension change will also work).
I see positive use for this behavior if I change entity name... so this is 
probably
not bad. But I would like to know if it's a correct behavior.

Original comment by Sergey.P...@gmail.com on 5 Jun 2009 at 3:36

GoogleCodeExporter commented 9 years ago
I've added the following code to ScaffoldingGenerator.tt and am invoking it at 
the
beginning of its constructor:

    public void DeleteT4OutputLog() {
        ProjectItem t4ToolboxOuputLog = 
            TransformationContext.FindProjectItem("ScaffoldingGeneratorCommand.tt.log");

        if (t4ToolboxOuputLog != null) {
            t4ToolboxOuputLog.Remove();
            t4ToolboxOuputLog.Delete();
        }
    }

This will be included in the next check in (which should be 1.0 RTM).

Original comment by wmccaffe...@gmail.com on 15 Jul 2009 at 4:42