lib/omnibus/project.rb
def build_version(val = NULL, &block)
      if block && !null?(val)
        raise Error, "You cannot specify additional parameters to " \
          "#build_version when a block is given!"
      end

      if block
        @build_version_dsl = BuildVersionDSL.new(&block)
      else
        if null?(val)
          @build_version_dsl.build_version
        else
          @build_version_dsl = BuildVersionDSL.new(val)
        end
      end
    end
def build_version(val = NULL, &block)
      if block && !null?(val)
        raise Error, "You cannot specify additional parameters to " \
          "#build_version when a block is given!"
      end

      if block
        @build_version_dsl = BuildVersionDSL.new(&block)
      else
        if null?(val)
          @build_version_dsl.build_version
        else
          @build_version_dsl = BuildVersionDSL.new(val)
        end
      end
    end
Set or retrieve the version of the project.

 @example Using a string
   build_version '1.0.0'

 @example From git
   build_version do
     source :git
   end

 @example From the version of a dependency
   build_version do
     source :version, from_dependency: 'chef'
   end

 @example From git of a dependency
   build_version do
     source :git, from_dependency: 'chef'
   end

 When using the +:git+ source, by default the output format of the
 +build_version+ is semver. This can be modified using the +:output_format+
 parameter to any of the methods of +BuildVersion+. For example:

   build version do
     source :git, from_dependency: 'chef'
     output_format :git_describe
   end

 @see Omnibus::BuildVersion
 @see Omnibus::BuildVersionDSL

 @param [String] val
   the build version to set
 @param [Proc] block
   the block to run when constructing the +build_version+

 @return [String]