-
Notifications
You must be signed in to change notification settings - Fork 0
Package descriptor
A package descriptor (or a wrap descriptor) is a simple text file using a custom DSL letting you describe what packages your solution relies on. It has an extension of wrapdesc (for wrap descriptor), and the media type text/vnd.caffeineit.wrapdesc.
An XML alternative to the text-based DSL is used on server repositories, with the application/vnd.caffeineit.wrapdesc.xml media type.
By convention, such a file needs to be somewhere up your file tree hierarchy, and will apply to any OpenWrap-consuming project in that file hierarchy.
For example, if you keep the recommended package structure, two projects may exist at packageName/src/Project1/ and packageName/src/Project2/. If both are OpenWrap-enabled, and you put your wrap descriptor at packageName/packageName.wrapdesc or packageName/src/packageName.wrapdesc, then both projects will share the same assembly references
The wrap descriptor supports a syntax that mimics HTTP headers.
Each of those follow a single pattern [name]: [text], for example name: Frodo Baggins.
It’s also possible to write those instructions on multiple lines, by starting any further line with whitespace. When the lines are processed, the new line and any white space on the additional line will be changed to a single white space.
depends: ring-of-power
= 2.1
will be folded back to
depends: ring-of-power = 2.1
To depend on a package, without any version constraint, the instruction is as simple as
depends: ring-of-power
If you require an exact version, you simply specify a comparison operator followed by a version.
depends: ring-of-power = 2.1
You can also specify a minimum version
depends: ring-of-power >= 2.1
or a maximum version
depends: ring-of-power < 3.0
Finally, you can add more than one version boundary by using the word ‘and’
depends: ring-of-power >= 2.1 and < 3.0
Dependencies can be annotated with tags that perform certain changes to the dependency resolution.
-
anchor
Anchors a dependency to a known location. -
content
The package will be processed while doing resolution of packages but assembly references will not be added to your projects.
It is also possible to override a package with another. This is useful when you want to use a package built in debug mode, or if you want to use a patched version of a specific package that you host in your own company.
override: ring-of-power one-to-rule-them-all
Whenever any package depends on ring-of-power, they will now be redirected to one-to-rule-them-all instead.
The ‘description’ instruction provides a description for a package.
description: The Rings for the Elven-kings under the sky...
Packages can be anchored to a known location so their content can be referenced by name.
anchored: true
Note that any dependency can also be anchored by specifying the anchor tag on the depends header.
Repositories normally use symlinks (or junctions on ntfs) to anchor packages. This header disables junctions and instead anchor packages by copying folders.
The build line configures how OpenWrap will create a package from your solution. For more details, see Building packages.