Browse files

Adds support for optionally including version header for 1.0 compat

  • Loading branch information...
1 parent c2cb9ad commit 9a0190abb55474a4ea09e6cc9b9cf8b42f615934 @serialseb serialseb committed May 16, 2012
View
1 openwrap.wrapdesc
@@ -23,3 +23,4 @@ assembly-info: assembly-info
assembly-info: build
assembly-info: description
assembly-info: trademark
+include-legacy-version: true
View
2 src/OpenWrap.Build.Tasks/PublishPackageContent.cs
@@ -61,7 +61,7 @@ public override bool Execute()
string.Format("[built({0}, '{1}', {2})]", kv.Key, kv.Value, AllowBinDuplicates.ToString().ToLowerInvariant()),
null,
"OpenWrap",
- MessageImportance.Normal));
+ MessageImportance.High));
return true;
}
View
8 src/OpenWrap.Commands/Wrap/BuildWrapCommand.cs
@@ -311,11 +311,17 @@ IEnumerable<ICommandOutput> Package()
{
var packageName = Name ?? _environment.Descriptor.Name;
- var packageDescriptorForEmbedding = new PackageDescriptor(GetCurrentPackageDescriptor());
+ var currentPackageDescriptor = GetCurrentPackageDescriptor();
+ var packageDescriptorForEmbedding = new PackageDescriptor(currentPackageDescriptor);
packageDescriptorForEmbedding.SemanticVersion = _generatedVersion;
packageDescriptorForEmbedding.Name = packageName;
+#pragma warning disable 612,618
+ if (currentPackageDescriptor.IncludeLegacyVersion)
+ packageDescriptorForEmbedding.Version = _generatedVersion.ToVersion();
+#pragma warning restore 612,618
+
var packageFilePath = _destinationPath.GetFile(
PackageNameUtility.PackageFileName(packageName, _generatedVersion.ToString()));
View
1 src/OpenWrap/PackageModel/IPackageDescriptor.cs
@@ -28,6 +28,7 @@ public interface IPackageDescriptor : IEnumerable<IPackageDescriptorEntry>
string BuildConfiguration { get; }
string Trademark { get; }
ICollection<string> Maintainer { get; }
+ bool IncludeLegacyVersion { get; }
IPackageDescriptor CreateScoped(IEnumerable<IPackageDescriptorEntry> read);
IEnumerable<IPackageDescriptorEntry> GetPersistableEntries();
}
View
8 src/OpenWrap/PackageModel/PackageDescriptor.cs
@@ -30,12 +30,18 @@ public partial class PackageDescriptor : IPackageDescriptor
SingleStringValue _trademark;
MultiLine<string> _maintainer;
SingleVersionValue _version;
+ SingleBoolValue _includeLegacyVersion;
public ICollection<string> Maintainer
{
get { return _maintainer; }
}
+ public bool IncludeLegacyVersion
+ {
+ get { return _includeLegacyVersion.Value; }
+ }
+
public string Trademark
{
get { return _trademark.Value; }
@@ -132,6 +138,7 @@ public bool UseSymLinks
public Version Version
{
get { return _version.Value; }
+ set { _version.Value = value; }
}
#pragma warning disable 612,618
@@ -220,6 +227,7 @@ void InitializeHeaders()
_copyright = new SingleStringValue(Entries, "copyright");
_buildConfiguration = new SingleStringValue(Entries, "build-configuration");
_trademark = new SingleStringValue(Entries, "trademark");
+ _includeLegacyVersion = new SingleBoolValue(Entries, "include-legacy-version", false);
}
public IPackageDescriptor CreateScoped(IEnumerable<IPackageDescriptorEntry> scopedEntries)
View
6 src/OpenWrap/PackageModel/ScopedPackageDescriptor.cs
@@ -36,6 +36,12 @@ public ScopedPackageDescriptor(PackageDescriptor parent, IEnumerable<IPackageDes
InitializeHeaders();
}
public ICollection<string> Maintainer { get { return _parent.Maintainer; } }
+
+ public bool IncludeLegacyVersion
+ {
+ get { return _parent.IncludeLegacyVersion; }
+ }
+
public string Trademark { get { return _parent.Trademark; } }
public ScopedPackageDescriptor(PackageDescriptor parent)
{
View
6 wraps/openwrap/openwrap.wrapdesc
@@ -23,4 +23,10 @@ assembly-info: assembly-info
assembly-info: build
assembly-info: description
assembly-info: trademark
+<<<<<<< HEAD
semantic-version: 2.0.3+5
+=======
+include-legacy-version: true
+semantic-version: 2.0.3+24
+version: 2.0.3.24
+>>>>>>> 2d7fc0c... Adds support for optionally including version header for 1.0 compat

0 comments on commit 9a0190a

Please sign in to comment.