I want to use the filterchain to replace the assemblyInfo’s version with my next version for each project in my solution before I build

 

I first thought I could use copy and just copy inplace with the following

 

            <copy todir="." overwrite="true" verbose="true">

                <fileset>

                    <include name="**/AssemblyInfo.cs" />

                </fileset>

               <filterchain>

                        <replacestring from="1.0.*" to="${NextVersion}" />

                </filterchain>

            </copy>

 

But that gave me the following output

 

     [copy] Copying 3 files to 'C:\Common\Test\Tools\TestSolution'.

     [copy] Skipping self-copy of 'C:\Common\Test\Tools\TestSolution\UI.Web\AssemblyInfo.cs'.

     [copy] Skipping self-copy of 'C:\Common\Test\Tools\TestSolution\Class2\AssemblyInfo.cs'.

     [copy] Skipping self-copy of 'C:\Common\Test\Tools\TestSolution\Class1\AssemblyInfo.cs'.

 

I ended up doing the following which worked.

 

            <!-- update AssemblyInfo files -->

            <copy todir="temp" overwrite="true" verbose="true">

                <fileset>

                    <include name="**/AssemblyInfo.cs" />

                </fileset>

               <filterchain>

                        <replacestring from="1.0.*" to="${NextVersion}" />

                </filterchain>

            </copy>

            <copy todir="..\TestSolution" overwrite="true" verbose="true">

                <fileset basedir="temp">

                    <include name="**/AssemblyInfo.cs" />

                </fileset>

            </copy>

 

I’m wondering though, if there is any mechanism to apply filterchains to files without copying or moving them elsewhere?

Reply via email to