Skip to content

Commit

Permalink
Fix Artifact Version For Javadoc Badge (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
khajavi authored Jan 5, 2023
1 parent 816cf69 commit 5401944
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@

_ZIO SBT_ is an sbt plugin for ZIO projects. It provides high-level SBT utilities that simplify the development of ZIO applications.

[![Production Ready](https://img.shields.io/badge/Project%20Stage-Production%20Ready-brightgreen.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sbt/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-sbt-website_2.12.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-sbt-website_2.12/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sbt-website_2.12.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sbt-website_2.12/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-sbt-docs/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-sbt-docs) [![ZIO SBT](https://img.shields.io/github/stars/zio/zio-sbt?style=social)](https://github.com/zio/zio-sbt)
[![Production Ready](https://img.shields.io/badge/Project%20Stage-Production%20Ready-brightgreen.svg)](https://github.com/zio/zio/wiki/Project-Stages) ![CI Badge](https://github.com/zio/zio-sbt/workflows/CI/badge.svg) [![Sonatype Releases](https://img.shields.io/nexus/r/https/oss.sonatype.org/dev.zio/zio-sbt-website_2.12.svg?label=Sonatype%20Release)](https://oss.sonatype.org/content/repositories/releases/dev/zio/zio-sbt-website_2.12/) [![Sonatype Snapshots](https://img.shields.io/nexus/s/https/oss.sonatype.org/dev.zio/zio-sbt-website_2.12.svg?label=Sonatype%20Snapshot)](https://oss.sonatype.org/content/repositories/snapshots/dev/zio/zio-sbt-website_2.12/) [![javadoc](https://javadoc.io/badge2/dev.zio/zio-sbt-docs_2.13/javadoc.svg)](https://javadoc.io/doc/dev.zio/zio-sbt-docs_2.13) [![ZIO SBT](https://img.shields.io/github/stars/zio/zio-sbt?style=social)](https://github.com/zio/zio-sbt)

## Installation

Add the following lines to your `plugin.sbt` file:

```scala
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.2.5")
addSbtPlugin("dev.zio" % "zio-sbt-website" % "0.2.4")
```

Then you can enable it by using the following code in your `build.sbt` file:
Expand Down
2 changes: 2 additions & 0 deletions docs/developer-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ title: "Developer Notes"
## Todo List

### ZIO SBT Website

- Add a command to make a version history page in documentation
- Check if the committed workflow is valid or not.
- To generate README.md file, it doesn't need to compile all docs.
- Add env variable for zio version (ZIO_VERSION).
- Support for various scala versions
- Support for auto update PRs
- Add workflow for header checker
- Add prepare task to perform preliminary tasks before PR

9 changes: 8 additions & 1 deletion zio-sbt-website/src/main/scala/zio/sbt/WebsitePlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ object WebsitePlugin extends sbt.AutoPlugin {

override def requires: Plugins = MdocPlugin && UnifiedScaladocPlugin

private def artifactVersion(version: String): String = {
val array = version.split('.')
if (array.head != "3") {
array.dropRight(1).mkString(".")
} else "3"
}

override lazy val projectSettings: Seq[Setting[_ <: Object]] =
Seq(
compileDocs := compileDocsTask.evaluated,
Expand Down Expand Up @@ -108,7 +115,7 @@ object WebsitePlugin extends sbt.AutoPlugin {
projectStage = badge.projectStage,
groupId = organization.value,
artifactId = badge.artifact,
docsArtifactId = moduleName.value,
docsArtifactId = moduleName.value + '_' + artifactVersion(scalaVersion.value),
githubUser = "zio",
githubRepo =
scmInfo.value.map(_.browseUrl.getPath.split('/').last).getOrElse("github repo not provided"),
Expand Down

0 comments on commit 5401944

Please sign in to comment.