File tree Expand file tree Collapse file tree 10 files changed +247
-229
lines changed
main/scala/com/lightbend/paradox/apidoc
com.lightbend.paradox/apidoc
com/lightbend/paradox/apidoc Expand file tree Collapse file tree 10 files changed +247
-229
lines changed Original file line number Diff line number Diff line change
1
+ version = 2.0 .0 -RC8
2
+
1
3
maxColumn = 120
2
4
docstrings = JavaDoc
3
5
assumeStandardLibraryStripMargin = true
Original file line number Diff line number Diff line change @@ -4,15 +4,21 @@ scala: 2.12.8
4
4
5
5
jobs :
6
6
include :
7
+ - stage : check
8
+ script : sbt scalafmtCheckAll || { echo "[error] Unformatted code found. Please run 'scalafmtAll' and commit the reformatted code."; false; }
9
+ name : Code style check (fixed with `sbt scalafmtAll`)
10
+ - script : sbt scalafmtSbtCheck || { echo "[error] Unformatted sbt code found. Please run 'scalafmtSbt' and commit the reformatted code."; false; }
11
+ name : Build code style check (fixed with `sbt scalafmtSbt`)
7
12
- stage : test
8
- script : sbt scalafmtCheck scalafmtSbtCheck
9
- name : " Formatting check"
10
- - script : sbt test
11
- name : " Tests run"
13
+ script : sbt test
14
+ name : Tests run
12
15
- stage : publish
13
16
script : sbt ^publish
17
+ name : Publish artifacts
14
18
15
19
stages :
20
+ - name : check # runs on master commits and PRs
21
+ if : NOT tag =~ ^v
16
22
- name : test # runs on master commits and PRs
17
23
if : NOT tag =~ ^v
18
24
- name : publish # runs on main repo master commits or version-tagged commits
Original file line number Diff line number Diff line change 2
2
3
3
[ bintray ] : https://bintray.com/sbt/sbt-plugin-releases/sbt-paradox-apidoc
4
4
[ bintray-badge ] : https://api.bintray.com/packages/sbt/sbt-plugin-releases/sbt-paradox-apidoc/images/download.svg
5
- [ travis ] : https://travis-ci.org /lightbend/sbt-paradox-apidoc
6
- [ travis-badge ] : https://travis-ci.org /lightbend/sbt-paradox-apidoc.svg?branch=master
5
+ [ travis ] : https://travis-ci.com /lightbend/sbt-paradox-apidoc
6
+ [ travis-badge ] : https://travis-ci.com /lightbend/sbt-paradox-apidoc.svg?branch=master
7
7
8
8
A [ paradox] ( https://github.com/lightbend/paradox/ ) directive that automatically adds links for classes from documentation to scaladoc and javadoc.
9
9
Original file line number Diff line number Diff line change @@ -15,11 +15,14 @@ libraryDependencies ++= Seq(
15
15
licenses += (" Apache-2.0" , url(" http://www.apache.org/licenses/LICENSE-2.0" ))
16
16
homepage := Some (url(" https://github.com/lightbend/sbt-paradox-apidoc" ))
17
17
scmInfo := Some (
18
- ScmInfo (url(" https://github.com/lightbend/sbt-paradox-apidoc" ), " git@github.com:lightbend/sbt-paradox-apidoc.git" ))
19
- developers += Developer (" contributors" ,
20
- " Contributors" ,
21
- " https://gitter.im/lightbend/paradox" ,
22
- url(" https://github.com/lightbend/sbt-paradox-apidoc/graphs/contributors" ))
18
+ ScmInfo (url(" https://github.com/lightbend/sbt-paradox-apidoc" ), " git@github.com:lightbend/sbt-paradox-apidoc.git" )
19
+ )
20
+ developers += Developer (
21
+ " contributors" ,
22
+ " Contributors" ,
23
+ " https://gitter.im/lightbend/paradox" ,
24
+ url(" https://github.com/lightbend/sbt-paradox-apidoc/graphs/contributors" )
25
+ )
23
26
organizationName := " Lightbend Inc."
24
27
startYear := Some (2018 )
25
28
Original file line number Diff line number Diff line change 1
1
addSbtPlugin(" com.dwijnand" % " sbt-dynver" % " 3.3.0" )
2
2
addSbtPlugin(" org.foundweekends" % " sbt-bintray" % " 0.5.5" )
3
3
addSbtPlugin(" de.heikoseeberger" % " sbt-header" % " 5.2.0" )
4
- addSbtPlugin(" com.geirsson " % " sbt-scalafmt" % " 1.5 .1" )
4
+ addSbtPlugin(" org.scalameta " % " sbt-scalafmt" % " 2.0 .1" )
Original file line number Diff line number Diff line change @@ -84,21 +84,25 @@ class ApidocDirective(allClassesAndObjects: IndexedSeq[String]) extends InlineDi
84
84
null ,
85
85
attributes,
86
86
null ,
87
- new DirectiveNode (DirectiveNode .Format .Inline ,
88
- group + " doc" ,
89
- label,
90
- syntheticSource,
91
- node.attributes,
92
- fqcn,
93
- new TextNode (label))
87
+ new DirectiveNode (
88
+ DirectiveNode .Format .Inline ,
89
+ group + " doc" ,
90
+ label,
91
+ syntheticSource,
92
+ node.attributes,
93
+ fqcn,
94
+ new TextNode (label)
95
+ )
94
96
)
95
97
}
96
98
97
- def renderMatches (query : Query ,
98
- matches : Seq [String ],
99
- node : DirectiveNode ,
100
- visitor : Visitor ,
101
- printer : Printer ): Unit = {
99
+ def renderMatches (
100
+ query : Query ,
101
+ matches : Seq [String ],
102
+ node : DirectiveNode ,
103
+ visitor : Visitor ,
104
+ printer : Printer
105
+ ): Unit = {
102
106
val scalaClassSuffix = if (query.linkToObject) " $" else " "
103
107
104
108
matches.size match {
@@ -119,7 +123,7 @@ class ApidocDirective(allClassesAndObjects: IndexedSeq[String]) extends InlineDi
119
123
case n =>
120
124
throw new java.lang.IllegalStateException (
121
125
s " $n matches found for $query, but not javadsl/scaladsl: ${matches.mkString(" , " )}. " +
122
- s " You may want to use the fully qualified class name as @apidoc[fqcn] instead of @apidoc[ $query]. "
126
+ s " You may want to use the fully qualified class name as @apidoc[fqcn] instead of @apidoc[ $query]. "
123
127
)
124
128
}
125
129
}
Original file line number Diff line number Diff line change @@ -40,26 +40,27 @@ object ApidocPlugin extends AutoPlugin {
40
40
def apidocParadoxGlobalSettings : Seq [Setting [_]] = Seq (
41
41
apidocRootPackage := " scala" ,
42
42
paradoxDirectives ++= Def .taskDyn {
43
- val classpath = (fullClasspath in Compile ).value.files.map(_.toURI.toURL).toArray
44
- val classLoader = new java.net.URLClassLoader (classpath, this .getClass.getClassLoader)
45
- val scanner = new ClassGraph ()
46
- .whitelistPackages(apidocRootPackage.value)
47
- .addClassLoader(classLoader)
48
- .scan()
49
- val allClasses = scanner.getAllClasses.getNames.asScala.toVector
50
- Def .task {
51
- Seq (
52
- { _ : Writer .Context ⇒
53
- new ApidocDirective (allClasses)
43
+ val classpath = (fullClasspath in Compile ).value.files.map(_.toURI.toURL).toArray
44
+ val classLoader = new java.net.URLClassLoader (classpath, this .getClass.getClassLoader)
45
+ val scanner = new ClassGraph ()
46
+ .whitelistPackages(apidocRootPackage.value)
47
+ .addClassLoader(classLoader)
48
+ .scan()
49
+ val allClasses = scanner.getAllClasses.getNames.asScala.toVector
50
+ Def .task {
51
+ Seq (
52
+ { _ : Writer .Context ⇒
53
+ new ApidocDirective (allClasses)
54
+ }
55
+ )
54
56
}
55
- )
56
- }
57
- }.value
57
+ }.value
58
58
)
59
59
60
60
def apidocSettings (config : Configuration ): Seq [Setting [_]] =
61
61
apidocParadoxGlobalSettings ++ inConfig(config)(
62
- Seq (
63
- // scoped settings here
64
- ))
62
+ Seq (
63
+ // scoped settings here
64
+ )
65
+ )
65
66
}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments