diff --git a/MSBuild.NugetContentRestore.Tasks/MSBuild.NugetContentRestore.Tasks.csproj b/MSBuild.NugetContentRestore.Tasks/MSBuild.NugetContentRestore.Tasks.csproj index 4cdb2a4..9293aed 100755 --- a/MSBuild.NugetContentRestore.Tasks/MSBuild.NugetContentRestore.Tasks.csproj +++ b/MSBuild.NugetContentRestore.Tasks/MSBuild.NugetContentRestore.Tasks.csproj @@ -1,5 +1,5 @@  - + Debug diff --git a/MSBuild.NugetContentRestore.Tasks/NugetContentRestoreTask.cs b/MSBuild.NugetContentRestore.Tasks/NugetContentRestoreTask.cs index 9a6cb1f..186767b 100755 --- a/MSBuild.NugetContentRestore.Tasks/NugetContentRestoreTask.cs +++ b/MSBuild.NugetContentRestore.Tasks/NugetContentRestoreTask.cs @@ -32,12 +32,13 @@ public class NugetContentRestoreTask : Task public string[] AdditionalFolders { get; set; } public string[] AdditionalIgnoreFilePatterns { get; set; } - [Required] public string SolutionDir { get; set; } [Required] public string ProjectDir { get; set; } + public string RepositoryPath { get; set; } + /// /// Enable SmartRestore (default: true) /// @@ -67,15 +68,17 @@ public override bool Execute() var startTime = System.DateTime.Now; Log.LogMessage(MessageImportance.Low, "NugetContentRestore :: SolutionDir='{0}'", SolutionDir); + Log.LogMessage(MessageImportance.Low, "NugetContentRestore :: RepositoryPath='{0}'", RepositoryPath); Log.LogMessage(MessageImportance.Low, "NugetContentRestore :: ProjectDir='{0}'", ProjectDir); Log.LogMessage(MessageImportance.Low, "NugetContentRestore :: ConfigFileFullPath='{0}'", ConfigFileFullPath); Log.LogMessage(MessageImportance.Low, "NugetContentRestore :: EnableSmartRestore='{0}'", EnableSmartRestore.ToString()); // Get NuGet Package Configuration var packages = GetPackages(); + var packagesPath = RepositoryPath ?? Path.Combine(SolutionDir, "packages"); foreach (var package in packages) { - var packageFullPath = Path.Combine(SolutionDir, "packages", package.FolderName); + var packageFullPath = Path.Combine(packagesPath, package.FolderName); Log.LogMessage(MessageImportance.Low, "NugetContentRestore :: {0} :: FullPath='{1}'", package.FolderName, packageFullPath); if (!Directory.Exists(packageFullPath)) continue; @@ -126,12 +129,23 @@ public override bool Execute() private bool IsValidInput() { - if (!Directory.Exists(SolutionDir)) + if (SolutionDir == null && RepositoryPath == null) + { + Log.LogError("NugetContentRestore :: At least one value must be not null SolutionDir='{0}', RepositoryPath='{1}'", SolutionDir); + return false; + } + if (SolutionDir != null && !Directory.Exists(SolutionDir)) { Log.LogError("NugetContentRestore :: Could not find directory SolutionDir='{0}'", SolutionDir); return false; } + if (RepositoryPath != null && !Directory.Exists(RepositoryPath)) + { + Log.LogError("NugetContentRestore :: Could not find directory RepositoryPath='{0}'", RepositoryPath); + return false; + } + if (!Directory.Exists(ProjectDir)) { Log.LogError("NugetContentRestore :: Could not find directory ProjectDir='{0}'", ProjectDir); diff --git a/MSBuild.NugetContentRestore.nuspec b/MSBuild.NugetContentRestore.nuspec index cec35ca..53662d0 100755 --- a/MSBuild.NugetContentRestore.nuspec +++ b/MSBuild.NugetContentRestore.nuspec @@ -2,7 +2,7 @@ MSBuild.NugetContentRestore - 0.1.7 + 0.1.8-alpha Francisco Lopez Francisco Lopez https://github.com/panchilo/MSBuild.NugetContentRestore diff --git a/MSBuild.NugetContentRestore.sln b/MSBuild.NugetContentRestore.sln index 8fd8e88..d838d06 100755 --- a/MSBuild.NugetContentRestore.sln +++ b/MSBuild.NugetContentRestore.sln @@ -1,10 +1,9 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MSBuild.NugetContentRestore.Tasks", "MSBuild.NugetContentRestore.Tasks\MSBuild.NugetContentRestore.Tasks.csproj", "{101AC75D-C470-4614-80F2-1F8D5A08418A}" - ProjectSection(ProjectDependencies) = postProject - {CE4F1D48-3030-4637-8349-794F2B4BD0D0} = {CE4F1D48-3030-4637-8349-794F2B4BD0D0} - EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,14 +19,6 @@ Global {101AC75D-C470-4614-80F2-1F8D5A08418A}.Release|Any CPU.ActiveCfg = Release|Any CPU {101AC75D-C470-4614-80F2-1F8D5A08418A}.Release|Any CPU.Build.0 = Release|Any CPU {101AC75D-C470-4614-80F2-1F8D5A08418A}.Release|x64.ActiveCfg = Release|Any CPU - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Debug|x64.ActiveCfg = Debug|x64 - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Debug|x64.Build.0 = Debug|x64 - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Release|Any CPU.Build.0 = Release|Any CPU - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Release|x64.ActiveCfg = Release|x64 - {CE4F1D48-3030-4637-8349-794F2B4BD0D0}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE