copy - MSBuild RecursiveDir is empty -
copy - MSBuild RecursiveDir is empty -
i'm trying create custom msbuild script build solutions in our repository:
<project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <propertygroup> <sourcehome condition=" '$(sourcehome)'=='' ">..\</sourcehome> <toolshome condition=" '$(toolshome)'=='' ">.\tools\</toolshome> <configuration condition=" '$(configuration)'=='' ">release</configuration> <destfolder condition=" '$(destfolder)'=='' ">.\$(configuration)\</destfolder> </propertygroup> <itemgroup> <allsolutions include="$(sourcehome)**\*.sln"/> </itemgroup> <target name="default" dependsontargets="clean;build;assemble"/> <target name="clean"> <message text="cleaning projects..."/> <msbuild projects="@(allsolutions)" targets="clean" properties="configuration=$(configuration);"/> </target> <target name="restorepackages"> <message text="restoring packages..."/> <exec command="echo y| "$(toolshome)nuget\nuget.exe" restore "%(allsolutions.identity)""/> </target> <target name="build" dependsontargets="restorepackages"> <message text="building projects..."/> <msbuild projects="@(allsolutions)" continueonerror="true" properties="configuration=$(configuration)"> <output itemname="outputfiles" taskparameter="targetoutputs"/> </msbuild> </target> <target name="assemble"> <message text="assembling output..."/> <removedir directories="$(destfolder)"/> <copy sourcefiles="@(outputfiles)" destinationfiles="@(outputfiles->'$(destfolder)%(recursivedir)%(filename)%(extension)')"/> </target> </project>
the script works except lastly re-create task %(recursivedir) evaluates empty string, putting files in root destination folder... can't see i'm doing wrong here.
i found msbuild itaskitem recursivedir metadata disappears doesn't seem apply here...
i found this , this thread there no double slashes or braces in paths. heres illustration of output during re-create task:
copying file "x:\my\repo\solutiondir\projectdir\bin\release\example.dll" ".\release\example.dll".
even though allsolutions
items have recursivedir metadata populated because of **
wildcard in code, msbuild task not populating recursivedir
in outputfiles
items. targetoutputs
placed single array, total paths no recursivedir
metadata.
msbuild copy msbuild-4.0
Comments
Post a Comment