Coder Social home page Coder Social logo

sbt-api-mappings's Introduction

sbt-api-mappings

Build Status

sbt-api-mappings is a sbt plugin that fills apiMappings for common Scala libraries.

Motivation

Sometimes when you wrote ScalaDoc for your own classes, you may want to reference to documentation in some other libraries.

For example:

/**
 * My own class, which works with [[scala.Option]] and [[scalaz.Monad]].
 */
class MyClass(optionMonad: scalaz.Monad[Option])

Unfortunately when running doc command in Sbt, you will receive a warning and the link would not be created.

/path/to/MyClass.scala:3: Could not find any member to link for "scala.Option".

This plugin resolves the problem.

Usage

Step 1: Add the following lines in your project/plugins.sbt:

addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "latest.release")

Note that sbt-api-mappings 1.x requires sbt 0.13.x, sbt-api-mappings 2.x requires sbt 1.x.

Step 2: Reload the Sbt configuration:

> reload

Step 3: Generate your API documentation:

> doc

Now, open the API documentation in your browser, and you will find the links to the scala.Option and scalaz.Monad's documentation in your MyClass page.

sbt-api-mappings's People

Contributors

2m avatar ashawley avatar atry avatar github-actions[bot] avatar ktoso avatar mineo avatar raboof avatar scala-steward avatar sjrd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sbt-api-mappings's Issues

Plugin fails with milestone and RC scala versions

When using this plugin, and cross-compiling against scala 2.12.0-RC2, I get this error:

scala.MatchError: scala-compiler-2.12.0-RC2.jar (of class java.lang.String)
    at com.thoughtworks.sbtApiMappings.ApiMappings$$anonfun$projectSettings$3$$anonfun$apply$2.apply(ApiMappings.scala:41)
    at com.thoughtworks.sbtApiMappings.ApiMappings$$anonfun$projectSettings$3$$anonfun$apply$2.apply(ApiMappings.scala:39)

The regex ScalaLibraryRegex doesn't match M* or RC* versions.

Update docs to point to v0.2.0

Change this:

addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "0.1.0")

to this:

addSbtPlugin("com.thoughtworks.sbt-api-mappings" % "sbt-api-mappings" % "0.2.0")

Be able to run on JDK9

In Akka we're trying to release for JDK9 already and are working on the entire plugin ecosystem to allow this. I found that there's a missing case in this plugin too which makes it not usable with JDK9:


[error] scala.MatchError: 9 (of class java.lang.String)
[error] 	at com.thoughtworks.sbtApiMappings.BootstrapApiMappings$.$anonfun$globalSettings$1(BootstrapApiMappings.scala:28)
[error] 	at sbt.internal.util.Init$Value.$anonfun$apply$3(Settings.scala:804)

Enable plugin automatically?

Would you make the plugin auto-enabled?

From, it looks like adding:

override def trigger = allRequirements

would be enough for that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.