Skip to content
This repository was archived by the owner on Oct 7, 2024. It is now read-only.

phdata/sbt-os-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OS Detector Plugin for SBT

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.

Usage

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 name
  • osDetectorArch: architecture
  • osDetectorClassifier: classifier, which is osdetector.os + '-' + osdetector.arch, e.g., linux-x86_64
  • osDetectorRelease: only available if osDetectorOs is linux. null on non-linux systems. It provides additional information about the linux release:
  • id: the ID for the linux release
  • version: the version ID for this linux release
  • isLike(baseRelease): true if this release is a variant of the given base release. For example, ubuntu is a variant of debian, so on a debian or ubuntu system isLike('debian`) returns true.

Typical usage example

To add platform specific depencencies

libraryDependencies += "group.id" % "artifact" % "version" % "test" classifier osDetectorClassifier.value

To build and install locally

$ git clone [email protected]:phdata/sbt-os-detector.git
$ cd sbt-os-detector
$ sbt publishLocal

About

OS detector plugin for SBT

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages