Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MSBuild Community Tasks Documentation [closed]

Is it just me or is the documentation on this project really scarce?

I'm trying to find how to use the FtpCreateRemoteDirectory and FTP functionality in general, but can't seem to find anything.

Googling FtpCreateRemoteDirectory, only shows the project's source code...

like image 950
Bertvan Avatar asked Sep 21 '10 17:09

Bertvan


4 Answers

The documentation is like you say really scarce. The best I found is to download the latest source code here : https://github.com/loresoft/msbuildtasks

The latest documentation can also be viewed via GitHub directly without downloading the source: https://github.com/loresoft/msbuildtasks/tree/master/Documentation

If installed using the MSI, you can also look at the XSD found in the installation folder (C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.xsd) to at least see which tasks are avaialable to you and the documentation connected with them.

like image 108
Benjamin Baumann Avatar answered Nov 20 '22 08:11

Benjamin Baumann


The latest releases on Github do not include documentation (issue #24).

Older releases on Tigris do include documentation in the form of a CHM file: After installing MSBuild.Community.Tasks.msi from the project download page, the documentation is in the installation folder. The typical path is "C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.chm".

like image 9
Edward Brey Avatar answered Nov 20 '22 08:11

Edward Brey


The documentation is sublime, but missing completely. However, the code is really easy to read - at least for finding out available tasks and their inputs/outputs.

The way I do it:

  1. Install a .NET decompiler like Jetbrains dotPeek (or some other .NET Reflector free clone).

  2. PM> Install-Package MSBuildTasks (from VS) OR
    > nuget install MSBuildTasks (from cmd line)

  3. Open slnDir\.build\MSBuild.Community.Tasks.dll in the above mentioned dotPeek, navigate to namespace MSBuild.Community.Tasks and double-click the task you're interested in.

  4. Profit!

enter image description here

like image 8
Cristian Diaconescu Avatar answered Nov 20 '22 08:11

Cristian Diaconescu


Came across this as I was looking for the same info, so may as well add an example of a complete MSBuild target which creates an FTP folder and then copies the contents to the new location. NB the example uploads to a secure site, so you may need to change the port number to suit your situation.

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets" />

  <Target Name="MSBuildFTP">    

    <PropertyGroup>
        <ftpHost>Your Host</ftpHost>
        <ftpUser>Your username</ftpUser>
        <ftpPass>you guessed it.. your password</ftpPass>
    </PropertyGroup>

    <Message Text="Create the directory if it does not exist - FtpUploadDirectoryContent fails if the dir does not exist" /> 
    <FtpCreateRemoteDirectory 
        ServerHost="$(ftpHost)"
        Port="21"
        Username="$(ftpUser)"
        Password="$(ftpPass)"
        RemoteDirectory="SSL/secure/"
        />

    <Message Text="Copy the contents of our directory to the ftp location" /> 
    <FtpUploadDirectoryContent
        ServerHost="$(ftpHost)"
        Port="21"
        Username="$(ftpUser)"
        Password="$(ftpPass)"
        LocalDirectory="deployment"
        RemoteDirectory="SSL/secure"
        Recursive="false"
        />
  </Target>
</Project>
like image 3
Fetchez la vache Avatar answered Nov 20 '22 08:11

Fetchez la vache