mirror of
https://github.com/mcanlas/6502-opcodes.git
synced 2024-12-21 18:29:22 +00:00
37 lines
938 B
Scala
37 lines
938 B
Scala
import sbt._
|
|
import sbt.Keys._
|
|
|
|
/**
|
|
* Automatically enriches projects with the following settings (despite the word "override").
|
|
*/
|
|
object GitHubPackages extends AutoPlugin {
|
|
|
|
/**
|
|
* Thus plug-in will automatically be enabled; it has no requirements.
|
|
*/
|
|
override def trigger: PluginTrigger = AllRequirements
|
|
|
|
val autoImport = ThingsToAutoImport
|
|
|
|
object ThingsToAutoImport {
|
|
implicit class PackagesOps(p: Project) {
|
|
def withGitHubPackagesCredentials: Project =
|
|
p
|
|
.settings(
|
|
credentials += Credentials(
|
|
"GitHub Package Registry",
|
|
"maven.pkg.github.com",
|
|
"mcanlas",
|
|
sys.env("GH_PACKAGES_TOKEN")
|
|
)
|
|
)
|
|
|
|
def withResolver(project: String): Project =
|
|
p
|
|
.settings(
|
|
resolvers += s"mcanlas/$project" at s"https://maven.pkg.github.com/mcanlas/$project/"
|
|
)
|
|
}
|
|
}
|
|
}
|