ligershark / template-builder

This project will output a NuGet package which can be used to help create Visual Studio Item Templates and Project templates
Other
42 stars 28 forks source link

Updated replace in files #14

Closed mlorbetske closed 10 years ago

sayedihashimi commented 10 years ago

Hey Mike, thanks for the PR. I'm really excited about this update.

I'm seeing an issue here. I'm transforming a web.config file and the result is invalid XML.

More details to come in a future reply here.

mlorbetske commented 10 years ago

@sayedihashimi _preprocess.xml isn't valid xml from what I downloaded from dropbox, is this the output from a previous run?

sayedihashimi commented 10 years ago

That's because the repro I gave you is destructive to the file :) I will reply to the original issue in a min with a better repro.

sayedihashimi commented 10 years ago

I accidentally merged this, a bit ago. Instead of undoing that I just moved the new code to RobustReplacer.cs and restored Replacer.cs. I added an interface IReplacer so we can just switch it out later on.

Regarding the issue here is a repro.

  1. Build templatebuilder tasks project
  2. In the output folder create a folder named pr14 and add the following files
  3. Under pr14 create a subfolder named files
  4. Copy to files https://dl.dropboxusercontent.com/u/40134810/templatebuilder/pr14/source-Web.config
  5. Call msbuild.exe on build.proj
mlorbetske commented 10 years ago

Fixed in the new PR, sorry about that. Issue was that the text after the final token would be duplicated due to the buffer position/size not being zeroed immediately after the write of the final file part.

sayedihashimi commented 10 years ago

Ok cool, no problem. I've merged it and made it the default. Thanks man!