Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is the method I use to do this, please note that it does take modifications to your csproj file to make sure that the files are placed in the appropriate directories on a build. I have based this on SharedSource examples, for instance, the Partial Language Fallback module in the <a href="http://trac.sitecore.net/LanguageFallback" rel="nofollow">Language Fallback project room in Shared Source</a> uses this technique.</p> <p>In your project dir, create a file called <code>deploydirectory.txt</code> and put the path of your final web location.</p> <p>In your new project's csproj file, add this code block just before the <code>&lt;/project&gt;</code> (assuming no other custom changes have been made in here)</p> <pre><code>&lt;Target Name="AfterBuild"&gt; &lt;CallTarget Targets="DeployToWeb" Condition="Exists('deploydirectory.txt')" /&gt; &lt;/Target&gt; &lt;Target Name="DeployToWeb"&gt; &lt;ReadLinesFromFile File="deploydirectory.txt"&gt; &lt;Output PropertyName="DeployPath" TaskParameter="Lines" /&gt; &lt;/ReadLinesFromFile&gt; &lt;CreateItem Include="App_Config\**\*.*;bin\*.dll;layouts\**\*.ascx" Exclude="**\.svn\**\*.*"&gt; &lt;Output ItemName="DeployFiles" TaskParameter="Include" /&gt; &lt;/CreateItem&gt; &lt;Copy SourceFiles="@(DeployFiles)" DestinationFiles="@(DeployFiles-&gt;'$(DeployPath)\%(RelativeDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /&gt; &lt;/Target&gt; </code></pre> <p>This code block as it currently stands, copies all files in app_config, all dll files in bin, and all ascx files in the layout directory and sub directories into the path in your deploydirectory.txt file. The <code>**</code> defines that they will be placed into the appropriate sub directories at the target. </p> <p>This is currently set to exclude any .svn directories found.</p> <p>Finally, this only runs if you have the file deploydirectory.txt in the project directory, otherwise it ignores this directive completely.</p> <p><strong>EDIT:</strong> if you want, you can also include the list of directories/files to move in a separate file so that you don't need to modify the csproj file every time you add more files that you need to move across (say you start with usercontrols, and then add xslt renderings later etc)</p> <pre><code>&lt;Target Name="AfterBuild"&gt; &lt;CallTarget Targets="DeployToWeb" Condition="Exists('deploydirectory.txt')" /&gt; &lt;/Target&gt; &lt;Target Name="DeployToWeb"&gt; &lt;ReadLinesFromFile File="deploydirectory.txt"&gt; &lt;Output PropertyName="DeployPath" TaskParameter="Lines" /&gt; &lt;/ReadLinesFromFile&gt; &lt;ReadLinesFromFile File="SourceFilePaths.txt"&gt; &lt;Output ItemName="SourceFilePaths" TaskParameter="Lines" /&gt; &lt;/ReadLinesFromFile&gt; &lt;CreateItem Include="@(SourceFilePaths)" Exclude="**\.svn\**\*.*"&gt; &lt;Output ItemName="DeployFiles" TaskParameter="Include" /&gt; &lt;/CreateItem&gt; &lt;Copy SourceFiles="@(DeployFiles)" DestinationFiles="@(DeployFiles-&gt;'$(DeployPath)\%(RelativeDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" /&gt; &lt;/Target&gt; </code></pre> <p>Where <code>SourceFilePaths.txt</code> contains the following</p> <pre><code>App_Config\**\*.* bin\*.dll layouts\**\*.ascx </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload