Add cs files to csproj with task perf

Posts   
 
    
fraste
User
Posts: 2
Joined: 04-Jul-2005
# Posted on: 04-Jul-2005 15:03:22   

Afternoon gents/ladies,

Sorry, I'm not sure if this is the right forum for this question, but here it goes anyway: We have a custom task performer that generates a directory and .cs file under our LLBLGen generated code project. How can I add that directory/file to the csproj?

I've attached the essentials of the code below:


    <task name="DoCode" assemblyFilename="DoCode.dll" taskPerformerClass="DoCode.Performer">    
    </task>

    public class Performer : TaskPerformerBase
    {
        public override void Perform(IGenerator executingGenerator, 
            ITask taskDefinition, Hashtable parameters)
        {
            // create folder + cs file
            // TODO: ??? add file to csproj ???
        }
    }

Any help will be much appreciated!

FS confused

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39786
Joined: 17-Aug-2003
# Posted on: 05-Jul-2005 08:02:17   

You should add the filename to the destinationFilenames arraylist in the taskcache:


((ArrayList)executingGenerator.TaskCache["destinationFilenames"]).Add(destinationFilename);

The project file creator uses that list of filenames to produce the project file contents. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
fraste
User
Posts: 2
Joined: 04-Jul-2005
# Posted on: 05-Jul-2005 09:35:25   

Thanks Frans!

simple_smile