 ;; Attribute name for minimal SDK version.
 (def ^:private min-sdk-attribute (keyword :android:minSdkVersion))
 
-;; Attribute name for project version name.
-(def ^:private version-name-attribute (keyword :android:versionName))
-
 ;; ### Local functions
 
 (defn- load-manifest

  (xml-> manifest :application :activity :intent-filter :category
         (attr= :android:name launcher-category)))

;; ### Public functions

(defn get-package-name
  "Returns the name of the application's package."

  "Extracts the target SDK version from the provided manifest file. If
  target SDK is not specified returns minimal SDK."
  [manifest-path]
  (let [[uses-sdk] (xml-> (load-manifest manifest-path) :uses-sdk)]
    (or (first (xml-> uses-sdk (attr target-sdk-attribute)))
        (first (xml-> uses-sdk (attr min-sdk-attribute))))))

;; ### Manifest templating

(def ^:private version-maximums
  "Maximum values per each version bucket."
  (mapv (partial bit-shift-left 1) [9 9 9 5]))

(def ^:private version-coefficients
  "Each part of the version number will be multiplied by the respective
  coefficient, all of which are calculated here."
  (->> version-maximums
       (reductions +)
       (mapv (fn [offset] (bit-shift-left 1 (- 32 offset))))))

(defn- assert>
  "Asserts that a>b in version segments"
  [a b]
  (when-not (> a b)
    (abort (format "Version number segment too large to fit in the
 version-code scheme: %s > %s, maximum version in each segment is %s"
                   b a (str/join "." version-maximums))))
  b)

(defn version-code
