views:

12

answers:

1

I'm trying to wrap my head around MSBuild.

I have a very simple script that does the following so far:

Builds a solution and places it in my drop location.

I have created a <Target> and in it I would like to copy files and from my source control location and drop them in the drop location as well.

Eventually the script will have to create the folders etc. For now I am just trying to copy one file over to see how this works.

The solution builds and is placed in the drop location but no files are copied. The build log makes no mention of this Target ever being run.

What am I missing?

 <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
  <Target Name="Build">
    <Message Text="Building msbuildintro" />    
  </Target>

  <Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\TeamBuild\Microsoft.TeamFoundation.Build.targets" />

  <ProjectExtensions>    
    <ProjectFileVersion>2</ProjectFileVersion>  
    <Description></Description>   
    <BuildMachine>hw-tfs-build02</BuildMachine>
  </ProjectExtensions>

  <PropertyGroup>   
    /* Properties here*/
  </PropertyGroup>

  <ItemGroup>
    <SolutionToBuild Include="$(BuildProjectFolderPath)/HostASPX/mySolution.sln">
      <Targets></Targets>
      <Properties></Properties>
    </SolutionToBuild>

    <CommonFiles Include="$(SolutionRoot)\trunk\folder\Common\Shared\js\somefile.js"></CommonFiles>
  </ItemGroup>

  <ItemGroup>    
    <ConfigurationToBuild Include="Release|Any CPU">
      <FlavorToBuild>Release</FlavorToBuild>
      <PlatformToBuild>Any CPU</PlatformToBuild>
    </ConfigurationToBuild>    
  </ItemGroup>


    <Target Name="CopyCommonData">       
      <Message Text="Copy Common Data" />      
      <Copy SourceFiles="@(CommonFiles)"
            DestinationFiles="$(DropLocation)\Common\somefile.js" /> 
    </Target>  


</Project>

Thanks!

A: 

OH I get it.. Target Names are not 'made up'. They must be a specific Target Name found here:

http://msdn.microsoft.com/en-us/library/aa337604.aspx

Nick