Skip to content

Commit f1ef45b

Browse files
authored
Merge branch 'main' into update/scala-collection-compat-2.4.2
2 parents b2f390c + d9fe3b2 commit f1ef45b

File tree

36 files changed

+993
-616
lines changed

36 files changed

+993
-616
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,15 @@ jobs:
5252
- name: Check that workflows are up to date
5353
run: sbt ++${{ matrix.scala }} githubWorkflowCheck
5454

55-
- name: Check formatting and style
56-
run: sbt ++${{ matrix.scala }} scalafmtCheckAll scalastyle
57-
58-
- name: Check version adheres to the policy
59-
run: sbt ++${{ matrix.scala }} versionPolicyCheck
60-
61-
- name: Check documentation has been generated
62-
run: sbt ++${{ matrix.scala }} mdocCheck
63-
64-
- name: Check dependencies
65-
run: sbt ++${{ matrix.scala }} evicted undeclaredCompileDependenciesTest unusedCompileDependenciesTest dependencyCheckAggregate
66-
67-
- name: Build and test
68-
run: sbt ++${{ matrix.scala }} test
55+
- name: Build, test and check libraries
56+
run: sbt ++${{ matrix.scala }} check
6957

7058
- name: Build and test sbt plugin
7159
if: matrix.scala == '2.12.13'
7260
run: sbt ++${{ matrix.scala }} scripted
7361

7462
- name: Compress target directories
75-
run: tar cf targets.tar sbt/target target doc-templates/target cli/target core/target project/target
63+
run: tar cf targets.tar sbt/target target meta/docs/target cli/target core/target example/target project/target
7664

7765
- name: Upload target directories
7866
uses: actions/upload-artifact@v2

README.md

Lines changed: 158 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Scala2PlantUML
22

3-
[![Continuous Integration](https://github.com/BotTech/scala2plantuml/actions/workflows/ci.yml/badge.svg)](https://github.com/BotTech/scala2plantuml/actions/workflows/ci.yml)
4-
![Scala2PlantUML Version](https://img.shields.io/maven-central/v/nz.co.bottech/scala2plantuml_2.13?label=Scala2PlantUML)
3+
[![Build badge](https://img.shields.io/github/workflow/status/BotTech/scala2plantuml/Continuous%20Integration/main)](https://github.com/BotTech/scala2plantuml/actions/workflows/ci.yml)
4+
[![Maven-Central badge](https://img.shields.io/maven-central/v/nz.co.bottech/scala2plantuml_2.13)](https://search.maven.org/search?q=g:nz.co.bottech%20a:*scala2plantuml*)
5+
[![Scala Steward badge](https://img.shields.io/badge/Scala_Steward-helping-blue.svg?style=flat&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAQCAMAAAARSr4IAAAAVFBMVEUAAACHjojlOy5NWlrKzcYRKjGFjIbp293YycuLa3pYY2LSqql4f3pCUFTgSjNodYRmcXUsPD/NTTbjRS+2jomhgnzNc223cGvZS0HaSD0XLjbaSjElhIr+AAAAAXRSTlMAQObYZgAAAHlJREFUCNdNyosOwyAIhWHAQS1Vt7a77/3fcxxdmv0xwmckutAR1nkm4ggbyEcg/wWmlGLDAA3oL50xi6fk5ffZ3E2E3QfZDCcCN2YtbEWZt+Drc6u6rlqv7Uk0LdKqqr5rk2UCRXOk0vmQKGfc94nOJyQjouF9H/wCc9gECEYfONoAAAAASUVORK5CYII=)](https://scala-steward.org)
56

67
Scala2PlantUML generates [PlantUML] diagrams from Scala code.
78

@@ -36,7 +37,7 @@ For most use cases you should add Scala2PlantUML as a global plugin since your b
3637
Create `~/.sbt/1.0/plugins/scala2PlantUML.sbt` containing:
3738

3839
```text
39-
addSbtPlugin("nz.co.bottech" % "sbt-scala2plantuml" % "0.1.12")
40+
addSbtPlugin("nz.co.bottech" % "sbt-scala2plantuml" % "0.2.0")
4041
```
4142

4243
## CLI
@@ -51,19 +52,23 @@ cs install --channel https://git.io/Jqv1i scala2plantuml
5152

5253
### Usage
5354

55+
```shell
56+
scala2plantuml --help
57+
```
58+
5459
```text
55-
Scala2PlantUML version 0.1.12
60+
Scala2PlantUML version 0.2.0
5661
Usage: scala2plantuml [options] symbol
5762
5863
Scala2PlantUML generates PlantUML Class Diagrams from Scala SemanticDB files.
5964
6065
symbol The symbol to use as the starting point for generating the diagram.
61-
66+
6267
To get a symbol from a class name, convert the package name separate '.' to '/' and add a '#'
6368
suffix. For an object use a suffix of '.'.
64-
69+
6570
See https://scalameta.org/docs/semanticdb/specification.html#symbol-1 for the full syntax.
66-
71+
6772
Examples:
6873
'com/example/Foo#' (class com.example.Foo)
6974
'com/example/Foo.' (object com.example.Foo)
@@ -77,16 +82,16 @@ The pattern supports two wildcards:
7782
2) * (matches all characters except for '/')
7883
7984
-i, --include <pattern> Only include symbols that match the pattern.
80-
85+
8186
Default: '**'
82-
87+
8388
Example:
8489
--include 'com/example/**/model/*'
8590
8691
-e, --exclude <pattern> Excludes all symbols that match the pattern.
87-
92+
8893
Default: 'scala/**', 'java/**'
89-
94+
9095
Example:
9196
--exclude 'com/example/**/data/*'
9297
@@ -96,62 +101,190 @@ Each of these can be provided multiple times.
96101
By default, the classpath that was used when executing Scala2PlantUML is also used.
97102
98103
-d, --dir <dir> Directories of the SemanticDB target roots containing META-INF/semanticdb/**/*.semanticdb files.
99-
104+
100105
Example:
101106
--dir 'my-project/target/scala-2.13/meta'
102107
103108
-j, --jar <jar> JAR containing META-INF/semanticdb/**/*.semanticdb files.
104-
109+
105110
Example:
106111
--jar 'foo.jar'
107112
108113
-u, --url <url> A URL to a JAR containing META-INF/semanticdb/**/*.semanticdb files.
109-
114+
110115
Example:
111116
--url 'https://repo1.maven.org/maven2/com/example/foo/foo_2.13/1.0.0/foo_2.13-1.0.0-semanticdb.jar'
112117
113118
The --project and --source options specify where within the search locations the SemanticDB files can be found.
114119
Each of these can be provided multiple times. The result will be all combinations of projects and source roots.
115120
116121
-p, --project <project> The name of the projects that have SemanticDB files.
117-
122+
118123
The project name will be used when looking for SemanticDB files such as:
119124
META-INF/semanticdb/<project>/<source>/*.semanticdb
120-
125+
121126
An empty project name will search in:
122127
META-INF/semanticdb/<source>/*.semanticdb
123-
128+
124129
Default: ''
125-
130+
126131
Example:
127132
--project my-project
128133
129134
-s, --source <source> The directory relative to the project where the source files were located.
130-
135+
131136
The source will be used when looking for SemanticDB files such as
132137
META-INF/semanticdb/<project>/<source>/*.semanticdb.
133-
138+
134139
Default: src/main/scala
135-
140+
136141
Example:
137142
--source 'source/scala'
138143
139-
-o, --output <file> Write the output to the given file.
144+
-l, --max-level <level> The maximum number of levels that will be traversed when following symbol references.
145+
146+
This means that parent symbols that would be beyond the max level will not be shown.
147+
148+
A diagram with a max-level of 1 will only contain the initial symbol.
149+
150+
Default: Unlimited
151+
152+
Example:
153+
--max-level 3
140154
155+
-o, --output <file> Write the output to the given file.
156+
141157
Example:
142158
--output docs/diagrams/my-project.puml
143159
144160
-c, --colour <value> Enables coloured output.
145-
161+
146162
Default: true
147-
163+
148164
Example:
149165
--colour false
150166
151167
-v, --verbose Increases the log level.
152-
168+
153169
This can be provided twice for the most verbose logging.
170+
171+
Example:
172+
-vv
173+
174+
-h, --help
175+
--version
176+
Error: Missing argument symbol
177+
Scala2PlantUML version 0.2.0
178+
Usage: scala2plantuml [options] symbol
179+
180+
Scala2PlantUML generates PlantUML Class Diagrams from Scala SemanticDB files.
181+
182+
symbol The symbol to use as the starting point for generating the diagram.
183+
184+
To get a symbol from a class name, convert the package name separate '.' to '/' and add a '#'
185+
suffix. For an object use a suffix of '.'.
186+
187+
See https://scalameta.org/docs/semanticdb/specification.html#symbol-1 for the full syntax.
188+
189+
Examples:
190+
'com/example/Foo#' (class com.example.Foo)
191+
'com/example/Foo.' (object com.example.Foo)
192+
'com/example/Foo.bar.' (value/variable bar on object com.example.Foo)
193+
'com/example/Foo#baz().' (function baz on class com.example.Foo)
194+
195+
The --include and --exclude options control which symbols will be processed. Each of these can be provided multiple times.
196+
197+
The pattern supports two wildcards:
198+
1) ** (matches any character)
199+
2) * (matches all characters except for '/')
200+
201+
-i, --include <pattern> Only include symbols that match the pattern.
202+
203+
Default: '**'
204+
205+
Example:
206+
--include 'com/example/**/model/*'
154207
208+
-e, --exclude <pattern> Excludes all symbols that match the pattern.
209+
210+
Default: 'scala/**', 'java/**'
211+
212+
Example:
213+
--exclude 'com/example/**/data/*'
214+
215+
The --dir, --jar, and --url options specify the directories and JAR files that are used when locating SemanticDB files.
216+
Each of these can be provided multiple times.
217+
218+
By default, the classpath that was used when executing Scala2PlantUML is also used.
219+
220+
-d, --dir <dir> Directories of the SemanticDB target roots containing META-INF/semanticdb/**/*.semanticdb files.
221+
222+
Example:
223+
--dir 'my-project/target/scala-2.13/meta'
224+
225+
-j, --jar <jar> JAR containing META-INF/semanticdb/**/*.semanticdb files.
226+
227+
Example:
228+
--jar 'foo.jar'
229+
230+
-u, --url <url> A URL to a JAR containing META-INF/semanticdb/**/*.semanticdb files.
231+
232+
Example:
233+
--url 'https://repo1.maven.org/maven2/com/example/foo/foo_2.13/1.0.0/foo_2.13-1.0.0-semanticdb.jar'
234+
235+
The --project and --source options specify where within the search locations the SemanticDB files can be found.
236+
Each of these can be provided multiple times. The result will be all combinations of projects and source roots.
237+
238+
-p, --project <project> The name of the projects that have SemanticDB files.
239+
240+
The project name will be used when looking for SemanticDB files such as:
241+
META-INF/semanticdb/<project>/<source>/*.semanticdb
242+
243+
An empty project name will search in:
244+
META-INF/semanticdb/<source>/*.semanticdb
245+
246+
Default: ''
247+
248+
Example:
249+
--project my-project
250+
251+
-s, --source <source> The directory relative to the project where the source files were located.
252+
253+
The source will be used when looking for SemanticDB files such as
254+
META-INF/semanticdb/<project>/<source>/*.semanticdb.
255+
256+
Default: src/main/scala
257+
258+
Example:
259+
--source 'source/scala'
260+
261+
-l, --max-level <level> The maximum number of levels that will be traversed when following symbol references.
262+
263+
This means that parent symbols that would be beyond the max level will not be shown.
264+
265+
A diagram with a max-level of 1 will only contain the initial symbol.
266+
267+
Default: Unlimited
268+
269+
Example:
270+
--max-level 3
271+
272+
-o, --output <file> Write the output to the given file.
273+
274+
Example:
275+
--output docs/diagrams/my-project.puml
276+
277+
-c, --colour <value> Enables coloured output.
278+
279+
Default: true
280+
281+
Example:
282+
--colour false
283+
284+
-v, --verbose Increases the log level.
285+
286+
This can be provided twice for the most verbose logging.
287+
155288
Example:
156289
-vv
157290

0 commit comments

Comments
 (0)