summaryrefslogtreecommitdiffstats
path: root/src/DotNetOpenAuth.BuildTasks/NuGetPack.cs
diff options
context:
space:
mode:
authorAndrew Arnott <andrewarnott@gmail.com>2012-01-29 10:47:07 -0800
committerAndrew Arnott <andrewarnott@gmail.com>2012-01-29 10:47:07 -0800
commit8f4165ee515728aca3faaa26e8354a40612e85e4 (patch)
tree204c75486639c23cdda2ef38b34d7e5050a1a2e3 /src/DotNetOpenAuth.BuildTasks/NuGetPack.cs
parentaf21cdaf77ca72f54e04f22268b740ce262582fa (diff)
parent71dc7f7a7146b021c358a9f341980d1f5e976955 (diff)
downloadDotNetOpenAuth-8f4165ee515728aca3faaa26e8354a40612e85e4.zip
DotNetOpenAuth-8f4165ee515728aca3faaa26e8354a40612e85e4.tar.gz
DotNetOpenAuth-8f4165ee515728aca3faaa26e8354a40612e85e4.tar.bz2
Merge in a bunch of build system and NuGet work.
Diffstat (limited to 'src/DotNetOpenAuth.BuildTasks/NuGetPack.cs')
-rw-r--r--src/DotNetOpenAuth.BuildTasks/NuGetPack.cs39
1 files changed, 16 insertions, 23 deletions
diff --git a/src/DotNetOpenAuth.BuildTasks/NuGetPack.cs b/src/DotNetOpenAuth.BuildTasks/NuGetPack.cs
index 356c51f..91365e5 100644
--- a/src/DotNetOpenAuth.BuildTasks/NuGetPack.cs
+++ b/src/DotNetOpenAuth.BuildTasks/NuGetPack.cs
@@ -35,6 +35,16 @@ namespace DotNetOpenAuth.BuildTasks {
public ITaskItem OutputPackageDirectory { get; set; }
/// <summary>
+ /// Gets or sets the semicolon delimited list of properties to supply to the NuGet Pack command to perform token substitution.
+ /// </summary>
+ public string Properties { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether to generate a symbols nuget package.
+ /// </summary>
+ public bool Symbols { get; set; }
+
+ /// <summary>
/// Returns the fully qualified path to the executable file.
/// </summary>
/// <returns>
@@ -63,15 +73,7 @@ namespace DotNetOpenAuth.BuildTasks {
Directory.CreateDirectory(Path.GetDirectoryName(this.OutputPackageDirectory.ItemSpec));
}
- string fullPackagePath = this.DeriveFullPackagePath();
- this.Log.LogMessage("Creating NuGet package '{0}'.", fullPackagePath);
-
bool result = base.Execute();
-
- if (result) {
- this.Log.LogMessage(MessageImportance.High, "Successfully created package '{0}'.", fullPackagePath);
- }
-
return result;
}
@@ -86,23 +88,14 @@ namespace DotNetOpenAuth.BuildTasks {
args.AppendSwitch("pack");
args.AppendFileNameIfNotNull(this.NuSpec);
- args.AppendSwitchIfNotNull("-b ", this.BaseDirectory);
- args.AppendSwitchIfNotNull("-o ", this.OutputPackageDirectory);
+ args.AppendSwitchIfNotNull("-BasePath ", this.BaseDirectory);
+ args.AppendSwitchIfNotNull("-OutputDirectory ", this.OutputPackageDirectory);
+ args.AppendSwitchIfNotNull("-Properties ", this.Properties);
+ if (this.Symbols) {
+ args.AppendSwitch("-Symbols");
+ }
return args.ToString();
}
-
- /// <summary>
- /// Derives the path to the generated .nupkg file.
- /// </summary>
- /// <returns>A relative path.</returns>
- private string DeriveFullPackagePath() {
- var spec = XDocument.Load(this.NuSpec.ItemSpec);
- var metadata = spec.Element("package").Element("metadata");
- string id = metadata.Element("id").Value;
- string version = metadata.Element("version").Value;
- string baseDirectory = this.OutputPackageDirectory != null ? this.OutputPackageDirectory.ItemSpec : String.Empty;
- return Path.Combine(baseDirectory, String.Format("{0}.{1}.nupkg", id, version));
- }
}
}