CodeSmith Community
Your Code. Your Way. Faster!

CodeSmith Batch Utility

Latest post 12-27-2006 1:09 PM by mphafner. 23 replies.
  • 11-23-2004 11:58 PM In reply to

    • pneutam
    • Top 150 Contributor
    • Joined on 07-30-2003
    • Posts 38
    • Points 735

    RE: CodeSmith Batch Utility

    Eric,

    When I was running my sample in console mode (RunMergeRegion.bat which uses MergeRegion.xml), it was replacing the whole file rather than the specified region. If you edit RunMergeRegion.bat and specify /cc (to show the command line), you should see /merge:<regionName> being included.

    Running in engine mode is fine (it calls RenderToFile with the output path and the merge strategy object).

    My CodeSmith.Engine.dll version is 2.6.0.117, which I think is the latest.

    Have I missed something?

    Cheers,
    Ben
    • Post Points: 5
  • 11-24-2004 11:23 PM In reply to

    • CSanchez
    • Not Ranked
    • Joined on 03-02-2004
    • Posts 4
    • Points 50

    RE: CodeSmith Batch Utility

    Hello,

    When i run the basic based samples samples, i only obtain 1 file in the output containing the concatenation of many .cs files.

    How can i obtain 1 file per property set ?

     

    Thanks

    • Post Points: 5
  • 11-25-2004 1:47 AM In reply to

    • pneutam
    • Top 150 Contributor
    • Joined on 07-30-2003
    • Posts 38
    • Points 735

    RE: CodeSmith Batch Utility

    CSanchez,

    To do that, you will need to create multiple task elements, each with the template element defining the file you want to output, and a single property set.

    Cheers,
    Ben
    • Post Points: 5
  • 11-25-2004 9:38 AM In reply to

    • CSanchez
    • Not Ranked
    • Joined on 03-02-2004
    • Posts 4
    • Points 50

    RE: CodeSmith Batch Utility

    Hi,

    Thank your for your response. However, could you just give me litttle sample ? burger

    Thanks

    Chris

    • Post Points: 5
  • 11-25-2004 11:06 PM In reply to

    • pneutam
    • Top 150 Contributor
    • Joined on 07-30-2003
    • Posts 38
    • Points 735

    RE: CodeSmith Batch Utility

    Check out the attached SeparateFiles.xml sample

    - Copy the zip contents to the Samples folder of CodeSmithBatch.

    - You can run it via RunSeparateFiles.bat

    Cheers,

    Ben


    <<Edit: This sample is now included from release 1.0.9>>

    Post Edited (pneutam) : 12/7/2004 12:16:36 AM GMT

    • Post Points: 5
  • 12-07-2004 12:18 AM In reply to

    • pneutam
    • Top 150 Contributor
    • Joined on 07-30-2003
    • Posts 38
    • Points 735

    RE: CodeSmith Batch Utility

    Updated to 1.0.9
     
    Major changes:
    • Corrected handling of read-only files when merging to regions.

    • Cleans up old compare files (.tmp) if file is writable.

    • Included SeparateFiles sample.

    Cheers,

    Ben

    • Post Points: 5
  • 01-27-2005 8:41 PM In reply to

    RE: CodeSmith Batch Utility

    How do you specify a sql database connection in the xml file? I am using a SourceTable pointing to a table name, but get the following error message:

    [0,0] CodeSmith property set 1: Template is not valid. SourceTable is required.
    Error in CodeSmithContrib.Batch.Console: Error executing batch file.
    ---> Error executing CodeSmithConsole. Code = 1


    Thanks
    CJ
    • Post Points: 5
  • 01-27-2005 11:39 PM In reply to

    • pneutam
    • Top 150 Contributor
    • Joined on 07-30-2003
    • Posts 38
    • Points 735

    RE: CodeSmith Batch Utility

    Hi CJ,

    Everything within a <propertySet> tag should just be passed through to the template. Is that where you've specified a <SourceTable> property?

    To confirm this, you can run CodeSmithBatch in debug mode and inspect the property set files generated for each task. See the readme for details.

    Ben
    • Post Points: 5
  • 01-31-2005 1:57 PM In reply to

    RE: CodeSmith Batch Utility

    Ben,


    In the generated file I have the following property for SourceTable.

    <property name="SourceTable">dbo.table1</property></propertySet>

    When I run this through the gui, I am prompted to select a database connection, how is this setup in batch mode?

    Thanks
    CJ
    • Post Points: 5
  • 01-31-2005 10:51 PM In reply to

    • pneutam
    • Top 150 Contributor
    • Joined on 07-30-2003
    • Posts 38
    • Points 735

    RE: CodeSmith Batch Utility

    CJ,

    I'm afraid I haven't done a lot with properties with related controls/builders. If you configure the gui and save the property set xml from within the gui and inspect it, that might give you some idea of what you need to specify in the batch file.

    Ben
    • Post Points: 5
  • 09-06-2005 7:03 AM In reply to

    • pneutam
    • Top 150 Contributor
    • Joined on 07-30-2003
    • Posts 38
    • Points 735

    RE: CodeSmith Batch Utility

    Updated to 1.0.10

    Major changes:
    - Improved exception/error handling.
    - Made output (a little) more compact.

    Cheers,

    Ben

    PS - haven't tested this with 3.x yet.
    • Post Points: 35
  • 12-27-2006 1:09 PM In reply to

    • mphafner
    • Not Ranked
    • Joined on 11-21-2006
    • Posts 2
    • Points 20

    Bug in CodeSmith Batch Utility

    I think I've found a bug.

    <task>
      <templates>
        <template path="CollectionTemplates\IList.cst" outputPath="OutputCode\Defaults\ILists.cs"/>

    If outputPath tag has spaces, output isn't generated...

    I set my outputPath = c:\documents and settings\mike\ILists.cs and no output is generated.
    Then I set my outputPath = c:\docum~1\mike\ILists.cs and everything works fine


    the template path can have spaces so it appears to be a bug with the outputPath parsing only.


     

    Filed under:
    • Post Points: 5
Page 3 of 3 (42 items) < Previous 1 2 3 | RSS
Copyright © 2008 CodeSmith Tools, LLC
Powered by Community Server (Commercial Edition), by Telligent Systems