Code Monkey home page Code Monkey logo

msbuildtasks's Introduction

MSBuild Community Tasks

Join the chat at https://gitter.im/loresoft/msbuildtasks

The MSBuild Community Tasks Project is an open source project for MSBuild tasks.

Build status

NuGet Version

Maintainer Wanted

Looking for a new maintainer for this project. Please let @pwelter34 know if you are interesting in becoming a maintainer for this project.

Download

The latest build can be downloaded from the releases section. https://github.com/loresoft/msbuildtasks/releases

The MSBuild Community Tasks library is also available on nuget.org via package name MSBuildTasks.

To install MSBuildTasks, run the following command in the Package Manager Console

PM> Install-Package MSBuildTasks

More information about NuGet package avaliable at https://nuget.org/packages/MSBuildTasks

Development Builds

Development builds are available on the myget.org feed. A development build is promoted to the main NuGet feed when it's determined to be stable.

In your Package Manager settings add the following package source for development builds: http://www.myget.org/F/loresoft/

Join Project

Please join the MSBuild Community Tasks Project and help contribute in building the tasks.

Google Group for MSBuild Community Tasks https://groups.google.com/d/forum/msbuildtasks

Current Community Tasks

Task Description
Add Add numbers
AppPoolController Allows control for an application pool on a local or remote machine with IIS installed. The default is to control the application pool on the local machine. If connecting to a remote machine, you can specify the and for the task to run under.
AppPoolCreate Creates a new application pool on a local or remote machine with IIS installed. The default is to create the new application pool on the local machine. If connecting to a remote machine, you can specify the and for the task to run under.
AppPoolDelete Deletes an existing application pool on a local or remote machine with IIS installed. The default is to delete an existing application pool on the local machine. If connecting to a remote machine, you can specify the and for the task to run under.
AssemblyInfo Generates an AssemblyInfo files
Attrib Changes the attributes of files and/or directories
Divide Divide numbers
EmbedNativeResource Embed native (rather than .NET) resource into a DLL or EXE.
FileUpdate Replace text in file(s) using a Regular Expression.
FtpUpload Uploads a file using File Transfer Protocol (FTP).
FxCop Uses FxCop to analyse managed code assemblies and reports on their design best-practice compliance.
GetSolutionProjects Task to get paths to projects and project names from VS2005 solution file
ILMerge A wrapper for the ILMerge tool.
Mail Sends an email message
Multiple Multiply numbers
MV Moves files on the filesystem to a new location.
NDoc Runs the NDoc application.
NUnit Run NUnit on a group of assemblies.
NUnit3 Run NUnit3.x on a group of assemblies.
RegexMatch Task to filter an Input list with a Regex expression. Output list contains items from Input list that matched given expression
RegexReplace Task to replace portions of strings within the Input list Output list contains all the elements of the Input list after performing the Regex Replace.
RegistryRead Reads a value from the Registry
RegistryWrite Writes a value to the Registry
Script Executes code contained within the task.
ServiceController Task that can control a Windows service.
ServiceQuery Task that can determine the status of a specified service on a target server.
Sleep A task for sleeping for a specified period of time.
SqlExecute Executes a SQL command.
Subtract Subtract numbers
SvnCheckout Checkout a local working copy of a Subversion repository.
SvnClient Subversion client base class
SvnCommit Subversion Commit command
SvnExport Export a folder from a Subversion repository
SvnInfo Run the "svn info" command and parse the output
SvnUpdate Subversion Update command
SvnVersion Summarize the local revision(s) of a working copy.
TaskSchema A Task that generates a XSD schema of the tasks in an assembly.
TemplateFile A task that replaces tokens in a template file and writes out a new file.
Time Gets the current date and time.
Unzip Unzip a file to a target directory.
Version Get Version information from file.
VssAdd Task that adds files to a Visual SourceSafe database.
VssCheckin Task that executes a checkin against a VSS Database.
VssCheckout Task that executes a checkout of files or projects against a Visual SourceSafe database.
VssClean Task that can strip the source control information from a Visual Studio Solution and subprojects.
VssDiff Task that records differences between the latest version of all the items in a Visual SourceSafe project and another version or label to a file.
VssGet Task that retireves an item or project from a Visual SourceSafe database.
VssHistory Generates an XML file containing details of all changes made to a Visual SourceSafe project or file between specified labels or dates.
VssLabel Task that applies a label to a Visual SourceSafe item.
VssUndoCheckout Task that undoes a checkout of files or projects against a Visual SourceSafe database.
WebDirectoryCreate Creates a new web directory on a local or remote machine with IIS installed. The default is to create the new web directory on the local machine. The physical path is required to already exist on the target machine. If connecting to a remote machine, you can specify the and for the task to run under.
WebDirectoryDelete Deletes a web directory on a local or remote machine with IIS installed. The default is to delete the web directory on the local machine. If connecting to a remote machine, you can specify the and for the task to run under.
WebDownload Downloads a resource with the specified URI to a local file.
XmlRead Reads a value from a XML document using a XPath.
XmlUpdate Updates a XML document using a XPath.
Xslt A task to merge and transform a set of xml files.
Zip Create a zip file with the files specified.

Getting Started

In order to use the tasks in this project, you need to import the MSBuild.Community.Tasks.Targets files.

If you installed the project with the msi installer, you can use the following.

<Import Project="$(MSBuildExtensionsPath)\MSBuildCommunityTasks\MSBuild.Community.Tasks.Targets"/>

Alternatively if you want to get started with the nuget packages please add the following.

<PropertyGroup>
    <MSBuildCommunityTasksPath>$(SolutionDir)\.build</MSBuildCommunityTasksPath>
</PropertyGroup>  

<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />

License

Copyright (c) 2016, LoreSoft All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of LoreSoft nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

msbuildtasks's People

Contributors

andrewbennet avatar backs avatar bdagnin avatar bigbadowl avatar bsara avatar burcadoruciprian avatar colgreen avatar dependabot[bot] avatar derkyjadex avatar dsidirop avatar eagle3386 avatar ewilde avatar joelverhagen avatar linquize avatar lmonney avatar malachib avatar neilmayhew avatar nirbar avatar p-m-j avatar philippbeckmann avatar pwelter34 avatar reidperyam avatar smithybc avatar stevewi1950 avatar stimpy77 avatar taschmidt avatar teropa avatar usagirei avatar vpfau avatar ynauls avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

msbuildtasks's Issues

Sandcastle Task IncludeInternals not able to enable

It is not possible to include the documentation of private fields/members and methods in the created documentation when using the msbuild community task Sandcastle. The MRefBuilder is capable to do it by setting IncludeInternal to true, but it is not exposed by the Sandcastle task. Its easy to enable, I patched it and tried it out.
You only need two lines of code:

Line 245: public bool IncludeInternals { get; set; }

Line 341: mref.IncludeInternal = IncludeInternals;

Thats it. Would help a lot if you could add this feature to the task.

Thank you.

SvnInfo Ignores RepositoryPath

SvnInfo resets the output properties, which includes SvnClient.RepositoryPath to string.Empty -- doing so also resets the the task parameter, so SvnClient will not include the repository in command generation.

<Target Name="GetRemoteInfo">
 <SvnInfo RepositoryPath="https:/.../svn/trunk">
    <Output TaskParameter="RepositoryPath"
        PropertyName="RepositoryPath" />
    <Output TaskParameter="RepositoryRoot"
        PropertyName="RepositoryRoot" />
 </SvnInfo>
    <Message Text="RepositoryRoot: $(RepositoryRoot)" />
    <Message Text="RepositoryPath: $(RepositoryPath)" />
</TargetName>

Generates this command:

svn.exe info --xml --non-interactive --no-auth-cache

If should be generating something like this:

svn.exe info "https:/.../svn/trunk" --xml --non-interactive --no-auth-cache

I fixed my local copy by adding another output parameter to SvnInfo called RepositoryUrl and replaced calls to RepositoryPath in SvnInfo with RepositoryUrl. I'm not sure this is the best way to fix this, but it was simple and only affected SvnInfo.

My new target looks something like:

<Target Name="GetRemoteInfo">
 <SvnInfo RepositoryPath="https:/.../svn/trunk">
    <Output TaskParameter="RepositoryUrl"
        PropertyName="RepositoryUrl" />
    <Output TaskParameter="RepositoryRoot"
        PropertyName="RepositoryRoot" />
 </SvnInfo>
    <Message Text="RepositoryRoot: $(RepositoryRoot)" />
    <Message Text="RepositoryUrl: $(RepositoryUrl)" />
</TargetName>

Scott

Setting the default code page for extracted files

I have searched all over and cannot see if it's possible to set the default code page when extracting files. I have a zip file with files with French Canadian content and if I extract the file using the default Windows 7 folder behavior I get the characters looking fine (accented ones), but using the community unzip task the file has the extra characters we associate with encoding issues. Any help appreciated.

System.EntryPointNotFoundException : Entry point was not found.

I'm running GitVersionTest and got:

System.EntryPointNotFoundException : Entry point was not found.
at Microsoft.Build.Framework.IBuildEngine.LogMessageEvent(BuildMessageEventArgs e)
at Microsoft.Build.Utilities.TaskLoggingHelper.LogCommandLine(MessageImportance importance, String commandLine)
at MSBuild.Community.Tasks.Git.GitClient.LogToolCommand(String message) in GitClient.cs: line 136
at Microsoft.Build.Utilities.ToolTask.Execute()
at MSBuild.Community.Tasks.Tests.Git.GitVersionTest.Execute() in GitVersionTest.cs: line 23

Anybody guess why?

Quotation marks in environment PATH variable not supported

Surrounding a path in the Windows environment variable PATH with quotation marks ("") breaks tasks such as GitVersion, because the ToolPathUtil.FindInPath does not take into account that this is legal (although not necessary). This will subsequently throw an ArgumentException ("Illegal characters in path.") in ToolPathUtil.SafeFileExists.

SvnExport returning -1 revision number

Hi there,

On executing the SvnExport function, I'm getting a -1 result for the Revision number, Below is the snippet of my target definition:
<Target Name="GetCode">
<RemoveDir Directories="$(TempCheckoutDirectory)" ContinueOnError="false" />
<SvnExport RepositoryPath="https://joey-PC/svn/CSImageViewer/trunk" LocalPath="$(MSBuildProjectDirectory)\Temp" Revision="$(RevisionNumber)">
<Output TaskParameter="Revision" PropertyName="Revision" />
</SvnExport>
<Message Text="Revision: $(Revision)"/>
</Target>

I know that in SVN, I see that the project I'm exporting has a revision number of 4 and this is why I'm baffled as to why I'm getting a -1.

My workstation setup is as follows:

  1. VisualSvnServer 2.5.8
  2. Windows 7 Utilmate 64bit
  3. MSBuild 4.0 - My path environment variable is set as: C:\Windows\Microsoft.NET\Framework64\v4.0.30319
  4. MSBuild Community Task 1.4.0.56

I'll appreciate any help or pointers in the right direction....

Thanks,
Joey

Source Safe tasks\code removed?

Current support tasks on home page still lists the source safe tasks (i.e. VssGet) but these appear to have been excluded from the solution so are no longer compiled and included in the release. I hate source safe as much as the next guy but unfortunately am still forced to use it.

Hide SVN password from Logs

Hi,

I would like to hide password from the logs produced by SVN commands.
We are using a Continuous integration Server (jenkins) and everyone has access to the logs to understand what went wrong.

The problem is that the password is visible in the logs along with the rest of the command.

How could I/You do that?

Thanks

Git CommitHash broken in 1.4.0.56

I had the following configuration to use the git CommitHash in the AssemblyInformationalVersion attribute working under 1.4.0.45

  <Target Name="Version">
    <GitVersion LocalPath="$(MSBuildProjectDirectory)">
      <Output TaskParameter="CommitHash" PropertyName="Revision" />
    </GitVersion>
    <Version Major="1" MinorType="None" BuildType="Automatic" RevisionType="None">
      <Output TaskParameter="Major" PropertyName="Major" />
      <Output TaskParameter="Minor" PropertyName="Minor" />
      <Output TaskParameter="Build" PropertyName="Build" />
    </Version>
    <Time Format="yyyy">
      <Output TaskParameter="FormattedTime" PropertyName="Year" />
    </Time>
    <AssemblyInfo CodeLanguage="VB"
      OutputFile="My Project\AssemblyInfo.vb"
      CLSCompliant="true"
      AssemblyInformationalVersion="$(Major).$(Minor).$(Build).$(Revision)"
      AssemblyVersion="$(Major).$(Minor).$(Build)"
      AssemblyFileVersion="$(Major).$(Minor).$(Build)" />
  </Target>

After updating to 1.4.0.56, the assemblyinfo file is still generated, but the Revision property is not populated. The MSBuild output shows the git command being run, and the value returned, but the value does not make it into the Revision property.

Version:
  C:\Program Files\Git\cmd\git.exe rev-parse --verify --short HEAD
  64031c7
  Created AssemblyInfo file "My Project\AssemblyInfo.vb".

The assemblyinfo file contains: Assembly: System.Reflection.AssemblyInformationalVersion("1.0.4777.")

SvnCopy should support optional --parents switch

From the command line, svn copy has a switch called --parents. This switch builds any missing directories or sub-directories in the DestinationPath. The SvnCopy task does not make this option available.

ILMerge invalid command line switch path1

Hi,

I am getting this obscure error message when trying to use the ILMerge target:

"C:\svn\AwaitingFeedbackCanceller.csproj" (rebuild target) (1) ->
(Zip target) ->
  C:\svn\AwaitingFeedbackCanceller.csproj(150,5): error MSB6001: Invalid command line switch for "ILMerge.exe".
Value cannot be null.\r
C:\svn\AwaitingFeedbackCanceller.csproj(150,5): error MSB6001: Parameter name: path1

These are the relevant bits from my project file:

  <PropertyGroup>
    <ZipFileName>$(ProjectName)-$([System.String]::Copy('$(projectguid)').Trim('\{\}')).zip</ZipFileName>
    <MergedFile>$(ProjectDir)$(ProjectName).dll</MergedFile>
    <logFile>$(ProjectDir)$(ProjectName).log</logFile>
    <TargetPlatformVersion>v4</TargetPlatformVersion>
    <TargetPlatformDirectory>C:\Windows\Microsoft.NET\Framework64\v4.0.30319</TargetPlatformDirectory>
  </PropertyGroup>
  <ItemGroup>
    <inputAssemblies Include="$(ProjectDir)$(OutDir)$(AssemblyName).dll" />
    <inputAssemblies Include="$(ProjectDir)$(OutDir)PluginBase.dll" />
    <allowDuplicates Include="$(ProjectDir)$(OutDir)ClassAB" />
  </ItemGroup>

<ILMerge InputAssemblies="@(inputAssemblies)" AllowDuplicateTypes="@(allowDuplicates)" OutputFile="$(MergedFile)" LogFile="$(logFile)" DebugInfo="true" XmlDocumentation="true" TargetPlatformVersion="$(TargetPlatformVersion)" TargetPlatformDirectory="$(TargetPlatformDirectory)"/>

Can anyone point me to what I am doing wrong?

Cheers,

Ashley

Using the MSBuildTasks with TFS

Hi,

I'm finding it quite difficult to find information on what to do, when using the nuget version.

What do i need to do to get it run when using it via a build server (which in turn is my dev-machine)?

Zip task hangs with latest Ionic.Zip.Reduced

Recently I have updated MSBuild.Community.Tasks library to the last version in my build process and found out that Zip task which compressed deployment package hangs (it displays that all files were added and stay in that state at least for 2 hrs). It worked if I run zip separately from build process, however.

I wasn't managed to figure out the problem, but using old version of Ionic.Zip (v1.9.1.5 instead of Ionic.Zip.Reduced v 1.9.1.8) solved the issue.

Inconsistent Line Endings?

Hey All,

I'm trying to get my GitHub setup so I can submit the patch that I had in the old Subversion Repository (http://msbuildtasks.tigris.org/issues/show_bug.cgi?id=129) that doesn't look like it transferred over. I'm completely new to GitHub, but reading online it seems something is probably wrong with my line endings, there are 61 files that the GitHub application seems to feel need to be committed, yet I've made no local changes.

Thanks

Impossible to add default namespace to XmlUpdate.

In XmlUpdate.cs there is:

if (!string.IsNullOrEmpty(_prefix) && !string.IsNullOrEmpty(_namespace))
{
manager.AddNamespace(_prefix, _namespace);
}

Should be:
if (!string.IsNullOrEmpty(_namespace))
{
manager.AddNamespace(_prefix ?? string.Empty, _namespace);
}

MSDN:
prefix
Type: System.String

The prefix to associate with the namespace being added. Use String.Empty to add a default namespace.

Version task with Team Foundation Server

I'm trying to use the Version task to increment the build number on every build. It works beautifully when building locally, but fails in TFS because it can't write back to the version file ("number.txt"). Is there a way to get around this, or do I need to find a different solution? I am new to MSBuild and TFS so I may be missing something obvious. Thanks.

Move task do not provide the same Properties as the default Move

Hi,

The Move task from MSBuild Communitty Pack do not provide the property OverwriteReadOnlyFiles
Could you provide the same property in order to provide more feature (not less) than the default function.

Note that I tried to see what OverwriteReadOnlyFiles was doing and saw not use for this property (using Reflector).

In order to use some of your tasks and not the "Move", I added this command:

< UsingTask AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskName="Microsoft.Build.Tasks.Move"/ >

Thomas P.

msbuild community tasks intellisense

I checked https://github.com/loresoft/msbuildtasks/blob/master/Source/MSBuild.Community.Tasks/MSBuild.Community.Tasks.xsd and it contains some errors regarding redefinition of Move task, and Vss* tasks wrong attribute Label extension, label is already defined and it have msbuild not Vss meaning.

when I include this schema intellisense stops working.

have you considered fixing this schema? renaming Label property to LabelName and renaming Move task?

I know that fix is not in schema but in code, and schema is mere reflection of code, I know that it has some compatibility issues, people are using it. nevertheless I'm interested in your opinion.

NUnit nodots option

add support to nodots option for NUnit target so that I can run "silently" without displaying the tests in the console.

Nuget integration

Having a problem with nuget integration, basically the same problem as documented in Issue #1

Here is my import statement.

Here is the error message I get:

C:\Visual Studio 2010\Projects\VMS\master.proj(23,2): error MSB4062: The "MSBui
ld.Community.Tasks.FileUpdate" task could not be loaded from the assembly C:\Pr
ogram Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll. Co
uld not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\MSBuildCo
mmunityTasks\MSBuild.Community.Tasks.dll' or one of its dependencies. The syste
m cannot find the file specified. Confirm that the declaration is c
orrect, that the assembly and all its dependencies are available, and that the
task contains a public class that implements Microsoft.Build.Framework.ITask.

Any pointers?

Using the Build.proj file?

I recently updated to 1.4.0.56 and I'm trying to make use of the included Build.proj file (after some minor tweaks) and I must be missing something.
I've tried building it with MSBuild and it complains about the project name beginning with $, which leads me to believe it's not expanding the following line properly: <ProjectFiles Include="$(MSBuildProjectDirectory)\**\*.sln">
Any documentation, or quick example you can provide on how to get this project building?

SvnInfo fails when there are braces in the path

As the title says, msbuild fails with the following error. As you can see instead of ( and ) it inserts %28 and %29.

Error 9 The "MSBuild.Community.Tasks.Subversion.SvnVersion" task could not be loaded from the assembly C:\Users\wouter\Documents\Visual Studio 2010\Projects\TheraTrainer\trunk %28brace%29\Build\MSBuild.Community.Tasks.dll. Could not load file or assembly 'file:///C:\Users\wouter\Documents\Visual Studio 2010\Projects\TheraTrainer\trunk %28brace%29\Build\MSBuild.Community.Tasks.dll' or one of its dependencies. Het systeem kan het opgegeven bestand niet vinden. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask. C:\Users\wouter\Documents\Visual Studio 2010\Projects\TheraTrainer\trunk (brace)\Deploy\Deploy.csproj 69 5 Deploy

GitVersion task output does not work

Hi,

I am trying to get the output of the GitVersion task.

<GitVersion LocalPath="$(MSBuildProjectDirectory)">
      <Output TaskParameter="CommitHash" PropertyName="Revision" />
</GitVersion>

The output property is always empty.

Am I doing something wrong or is this a bug?

Thanks!

Need docs on how to use with nuget

It looks like I'm supposed to check in the Build directory, but how does that work with updates?

Also installing from the command line didn't seem to install into the Build dir.

It seems this is currently being worked on as well (changed in the last few days), so it would be nice to get some more info on what's going on too.

NuGet pacakge should be solution-level package

From version 1.8 NuGet supports solution level packages. Solution level package should not contain lib or content folders. As MsBuildTasks is a tools and not a library so its package should be solution level.

Nuget problems

I had a really hard time trying to configure MSBuildTasks package installed with nuget.
In particular it can't find the library because it looks in the wrong directory. In particular it looks in the program files directory when it should look on the nuget solution packages directory.

Here is my import tag:
<Import Project="$(SolutionDir)\packages\MSBuildTasks.1.3.0.528\lib\net20\MSBuild.Community.Tasks.Targets" />

This is the error in detail:
Error 1 The "MSBuild.Community.Tasks.Subversion.SvnVersion" task could not be loaded from the assembly C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\MSBuild\MSBuildCommunityTasks\MSBuild.Community.Tasks.dll' or one of its dependencies. Impossibile trovare il file specificato. Confirm that the declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.

I changed this into the .target file and now it works:
<MSBuildCommunityTasksPath>$(SolutionDir)\packages\MSBuildTasks.1.3.0.528\lib\net20</MSBuildCommunityTasksPath>

Create several projects for sets of tasks that are correlated

There are lots of tasks that belong together like the tasks for: git, nuget, oracle, subversion etc.

I think it would be nice if all those where split in several projects and then combined in the build into one assembly. This is applied in the NServiceBus project and this results in less dependancies in each project but still have one assembly with all code as distributable.

FtpUpload MAX_RETRIES Error Logging Logic Incorrect

The FtpUpload task appears to contain logic that was intended to allow for a maximum of 4 retries before logging an error message to the log. However the logic that controls this appears to be incorrect:

Current (FtpUpload.cs lines 192-194)

int MAX_RETRIES = 3;
for (int i = 0; i < _localFiles.Length; i++) {
  for (int retry = 0; retry <= MAX_RETRIES; retry++) {
    bool success = UploadFile(_localFiles[i].ItemSpec, _remoteFiles[i].ItemSpec, i < MAX_RETRIES);

The least intrusive change would be to fix Line 194 (the last line above) as follows:

bool success = UploadFile(_localFiles[i].ItemSpec, _remoteFiles[i].ItemSpec, retry == MAX_RETRIES);

The UploadFile(string,string,bool) appears to be designed in such a way that the bool argument dictates if the task should log an error or a message when an Exception is encountered. I believe the intent was that until the final retry occurs exceptions should be treated as messages not Errors.

The more intrusive fix is to modify the UploadFile(string,string,bool) to not attempt to capture the exception and allow it to bubble up to Execute and handle the error logging within that function. Furthermore I would recommend fixing the Retry loop such that it actually only performs MAX_RETRIES as opposed to MAX_RETRIES+1, but those are beyond the scope of the bugfix as it would require some major code refactoring.

The NUnit task fails on Linux.

The NUnit task fails with Mono's xbuild on Linux due to using / to indicate command line options. A simple patch would be something like the following:

--- MSBuild.Community.Tasks/Source/MSBuild.Community.Tasks/NUnit.cs 2012-05-04 14:20:28.000000000 -0500
+++ ~/gp/Calgary/FW70/Build/Src/FwBuildTasks/NUnit.cs 2012-08-27 10:26:13.844237217 -0500
@@ -250,6 +250,24 @@
protected override string GenerateCommandLineCommands()
{
CommandLineBuilder builder = new CommandLineBuilder();

  •        if (Environment.OSVersion.Platform == PlatformID.Unix)
    
  •        {
    
  •            builder.AppendSwitch("-nologo");
    
  •            if (DisableShadowCopy)
    
  •                builder.AppendSwitch("-noshadow");
    
  •            if (_testInNewThread.HasValue && !_testInNewThread.Value)
    
  •                builder.AppendSwitch("-nothread");
    
  •            builder.AppendFileNamesIfNotNull(_assemblies, " ");
    
  •            builder.AppendSwitchIfNotNull("-config=", _projectConfiguration);
    
  •            builder.AppendSwitchIfNotNull("-fixture=", _fixture);
    
  •            builder.AppendSwitchIfNotNull("-include=", _includeCategory);
    
  •            builder.AppendSwitchIfNotNull("-exclude=", _excludeCategory);
    
  •            builder.AppendSwitchIfNotNull("-transform=", _xsltTransformFile);
    
  •            builder.AppendSwitchIfNotNull("-xml=", _outputXmlFile);
    
  •            builder.AppendSwitchIfNotNull("-err=", _errorOutputFile);
    
  •            builder.AppendSwitchIfNotNull("-framework=",_framework);
    
  •            return builder.ToString();
    
  •        }
         builder.AppendSwitch("/nologo");
         if (DisableShadowCopy)
         {
    

WorkingDirectory property on NUnit task doesn't do anything

Using the current (as of today) MSBuild Community Tasks Nuget package, I call NUnit target like this:

<NUnit
  Assemblies="@(TestAssemblies)"
  ToolPath="$(NUnitToolPath)"
  WorkingDirectory="$(CompileFolder)"
  OutputXmlFile="$(BuildFolder)\MyProj.Tests.xml"
/>

But the value I pass in for WorkingDirectory isn't used in the cmd line command that launches nunit-console.exe.

FtpUpload task hardcoded timeout issue

FtpUpload tasks sometimes fails because of short hardcoded timeout 7000 ms (FtpUpload.cs source file). Please add task parameter to specify the timeout.

ZIP Fails on Duplicate Files and Adding Folder and Contents

In our MSBuild task, the items we want to zip up and push are generated by:

<CreateItem Include="@(FilesToChange);
                        $(WebConfig);
                        $(CheckoutPath)\$(WebApplicationFolder)\bin\**\*.*;
                        $(CheckoutPath)\$(WebApplicationFolder)\UserControls\**\*.ascx;
                        $(CheckoutPath)\$(WebApplicationFolder)\Styles\less\**\*.*"
            Exclude="$(CheckoutPath)\$(WebApplicationFolder)\**\*.cs;">
    <Output TaskParameter="Include" ItemName="FilesToPush" />
</CreateItem>

If there is a real change in the web.config, this results in 2 web.config entries and causes the zip task to fail with "An item with the same key has already been added." We also get this error when we add a new directory with files as the directory is added as well as the child files.

SvnInfo broken

For me SvnInfo just doesn't work on Remote repositories.
First of all it ignores RepositoryPath if i remove [Output] it falls with the output of the command beeing sent to standartError.

What is the right way to fix this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.