-
Notifications
You must be signed in to change notification settings - Fork 6
/
Scaladoc.scala
163 lines (133 loc) · 4.88 KB
/
Scaladoc.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
package com.carrotgarden.maven.scalor.document
import java.io.File
import org.apache.maven.plugins.annotations.Parameter
import com.carrotgarden.maven.scalor.base
import com.carrotgarden.maven.tools.Description
trait ScaladocAny extends AnyRef {
@Description( """
Root name for the generated Scaladoc jar file.
Full name will include <code>classifier</code> suffix.
""" )
@Parameter(
property = "scalor.scaladocFinalName",
defaultValue = "${project.build.finalName}"
)
var scaladocFinalName : String = _
def scaladocHasAttach : Boolean
def scaladocClassifier : String
def scaladocOutputFolder : File
def scaladocArchiveName = s"${scaladocFinalName}-${scaladocClassifier}.jar"
}
trait ScaladocRegex extends base.BuildAnyRegex {
@Description( """
Regular expression for Java source file discovery via inclusion by match against <b>full-path</b> (not just file name).
File match is defined as: <code>include.hasMatch && ! exclude.hasMatch</code>.
Matches files with <code>java</code> extension by default.
<pre>
""" )
@Parameter(
property = "scalor.scaladocRegexJavaInclude",
defaultValue = """.+[.]java"""
)
var scaladocRegexJavaInclude : String = _
@Description( """
Regular expression for Java source file discovery via exclusion by match against <b>full-path</b> (not just file name).
File match is defined as: <code>include.hasMatch && ! exclude.hasMatch</code>.
Matches no files when empty by default.
""" )
@Parameter(
property = "scalor.scaladocRegexJavaExclude"
)
var scaladocRegexJavaExclude : String = _
@Description( """
Regular expression for Scala source file discovery via inclusion by match against <b>full-path</b> (not just file name).
File match is defined as: <code>include.hasMatch && ! exclude.hasMatch</code>.
Matches files with <code>scala</code> extension by default.
""" )
@Parameter(
property = "scalor.scaladocRegexScalaInclude",
defaultValue = """.+[.]scala"""
)
var scaladocRegexScalaInclude : String = _
@Description( """
Regular expression for Scala source file discovery via exclusion by match against <b>full-path</b> (not just file name).
File match is defined as: <code>include.hasMatch && ! exclude.hasMatch</code>.
Matches no files when empty by default.
""" )
@Parameter(
property = "scalor.scaladocRegexScalaExclude"
)
var scaladocRegexScalaExclude : String = _
override def buildRegexJavaInclude = scaladocRegexJavaInclude
override def buildRegexJavaExclude = scaladocRegexJavaExclude
override def buildRegexScalaInclude = scaladocRegexScalaInclude
override def buildRegexScalaExclude = scaladocRegexScalaExclude
}
trait ScaladocMacro extends ScaladocMain {
// included in scope=main
override def scaladocHasAttach = false
}
trait ScaladocMain extends ScaladocAny {
@Description( """
Artifact classifier for Scaladoc with scope=main.
Using Java convension by default.
Appended to <a href="#scaladocFinalName"><b>scaladocFinalName</b></a>.
""" )
@Parameter(
property = "scalor.scaladocMainClassifier",
defaultValue = "javadoc"
)
var scaladocMainClassifier : String = _
@Description( """
Enable to attach generated Scaladoc
to the project as deployment artifact with scope=main.
""" )
@Parameter(
property = "scalor.scaladocMainAttach",
defaultValue = "true"
)
var scaladocMainAttach : Boolean = _
@Description( """
Folder with generated Scaladoc content with scope=main.
""" )
@Parameter(
property = "scalor.scaladocMainOutputFolder",
defaultValue = "${project.reporting.outputDirectory}/scaladoc-main"
)
var scaladocMainOutputFolder : File = _
override def scaladocHasAttach = scaladocMainAttach
override def scaladocClassifier = scaladocMainClassifier
override def scaladocOutputFolder = scaladocMainOutputFolder
}
trait ScaladocTest extends ScaladocAny {
@Description( """
Artifact classifier for Scaladoc with scope=test.
Using Java convension by default.
Appended to <a href="#scaladocFinalName"><b>scaladocFinalName</b></a>.
""" )
@Parameter(
property = "scalor.scaladocTestClassifier",
defaultValue = "test-javadoc"
)
var scaladocTestClassifier : String = _
@Description( """
Enable to attach generated Scaladoc
to the project as deployment artifact with scope=test.
""" )
@Parameter(
property = "scalor.scaladocTestAttach",
defaultValue = "true"
)
var scaladocTestAttach : Boolean = _
@Description( """
Folder with generated Scaladoc content with scope=test.
""" )
@Parameter(
property = "scalor.scaladocTestOutputFolder",
defaultValue = "${project.reporting.outputDirectory}/scaladoc-test"
)
var scaladocTestOutputFolder : File = _
override def scaladocHasAttach = scaladocTestAttach
override def scaladocClassifier = scaladocTestClassifier
override def scaladocOutputFolder = scaladocTestOutputFolder
}