An SBT plugin that detects the OS name and architecture, providing a uniform classifier to be used in the names of native artifacts.
It uses os-maven-plugin under the hood thus produces the same result.
Requires Java 8 or up.
To use this plugin, include in your plugins.sbt:
resolvers += "phData Releases" at "https://repository.phdata.io/artifactory/libs-release"
classpathTypes += "maven-plugin"
addSbtPlugin("io.phdata" % "sbt-os-detector" % "0.2.0")The plugin creates osDetector* settings in your project, through which you
can access the following attributes:
osDetectorOs: normalized OS nameosDetectorArch: architectureosDetectorClassifier: classifier, which isosdetector.os + '-' + osdetector.arch, e.g.,linux-x86_64osDetectorRelease: only available ifosDetectorOsislinux.nullon non-linux systems. It provides additional information about the linux release:id: the ID for the linux releaseversion: the version ID for this linux releaseisLike(baseRelease):trueif this release is a variant of the given base release. For example, ubuntu is a variant of debian, so on a debian or ubuntu systemisLike('debian`)returnstrue.
libraryDependencies += "group.id" % "artifact" % "version" % "test" classifier osDetectorClassifier.value$ git clone [email protected]:phdata/sbt-os-detector.git
$ cd sbt-os-detector
$ sbt publishLocal