Skip to content

Migrate Scala3doc repo to Dotty #10092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 257 commits into from
Oct 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
257 commits
Select commit Hold shift + click to select a range
c3bbbe2
Do not require to run gradle
romanowski Jul 21, 2020
c3596ae
Fix a typo in compiler option name
abgruszecki Jul 21, 2020
cfcfb95
Merge pull request #2 from AleksanderBG/master
abgruszecki Jul 21, 2020
8960935
Setup CI and publicaiton
romanowski Jul 21, 2020
ddf6067
Add caching
romanowski Jul 21, 2020
f70e439
Merge pull request #3 from romanowski/setup-ci
romanowski Jul 21, 2020
ffaaca1
Basic support for methods, generics does not work.
romanowski Jul 21, 2020
fe7ae5c
Merge pull request #4 from romanowski/basic-methods
romanowski Jul 22, 2020
7b24b9e
Create Scala signature provider that redeners methods
romanowski Jul 22, 2020
3215fd8
Update README.md
romanowski Jul 22, 2020
d28da30
Use test code from dottydoc and exclude tool code from documentation …
romanowski Jul 22, 2020
31956e2
Add proper rendering got classes and methods
romanowski Jul 22, 2020
be16cc0
Merge pull request #6 from romanowski/basic-methods
abgruszecki Jul 23, 2020
2a26e75
Added simple testing framework for dotty and signature tests
pikinier20 Jul 23, 2020
27a1038
Fix type rendering
romanowski Jul 23, 2020
71dfa0a
Added preprocessor which replaces logo in docs. Provided basic Scala …
pikinier20 Jul 24, 2020
207429a
Merge pull request #8 from romanowski/fix-tests
abgruszecki Jul 24, 2020
2ad01dc
Merge pull request #9 from pikinier20/new-logo
abgruszecki Jul 24, 2020
8a3da50
Changed logo installer to resource installer, added preprocessor whic…
pikinier20 Jul 24, 2020
d00f187
Merge pull request #10 from romanowski/resource-installing
romanowski Jul 27, 2020
1dd067b
Added parsing PackageClauses from TASTy, added documentation for pack…
pikinier20 Jul 29, 2020
ab89f60
Merge pull request #16 from romanowski/package-documentation
romanowski Jul 30, 2020
78c7b95
Further signature tests
pikinier20 Jul 24, 2020
a251a9e
Added support for visibility modifiers and OOP modifiers(final, seale…
pikinier20 Jul 27, 2020
62aa5fa
Added extra modifiers to classlikes and functions
pikinier20 Jul 27, 2020
b580713
Add missing bits in signatures
romanowski Jul 29, 2020
abc5318
Add basic support got types, vals and vars
romanowski Jul 29, 2020
aa53cdd
Merge pull request #17 from romanowski/types
romanowski Jul 30, 2020
d63fac3
Render nested classes/types/traits correctly
romanowski Jul 30, 2020
0a5f5de
Add support for match types
romanowski Jul 30, 2020
0cda682
Merge pull request #28 from romanowski/nested-classes
romanowski Jul 31, 2020
c1146d6
Clean up TODOs
romanowski Jul 30, 2020
8e20de0
Merge pull request #27 from romanowski/todos-cleanup
romanowski Jul 31, 2020
c1ba2a4
Merge pull request #30 from romanowski/match-types
romanowski Jul 31, 2020
e12c359
Update dottyc to 0.26.0-RC1
abgruszecki Jul 31, 2020
44ff308
Support for companion objects
pikinier20 Jul 30, 2020
be4f36b
Merge pull request #29 from romanowski/companion-objects
romanowski Jul 31, 2020
083d1cb
Update Scala versions in code
abgruszecki Jul 31, 2020
f359a7a
Merge pull request #36 from romanowski/update-scalac
romanowski Jul 31, 2020
eda1a43
Initial working version of Markdown parsing
abgruszecki Jul 23, 2020
2e0e4ba
Clean up most of the comment parsing
abgruszecki Jul 21, 2020
9b932da
Convert most of Markdown into Dokka doc model
abgruszecki Jul 22, 2020
bed26f8
Add Wiki syntax support
abgruszecki Jul 24, 2020
1aafa3d
Merge pull request #5 from romanowski/comment-parsing
romanowski Jul 31, 2020
b32c70b
Support for package functions and properties
pikinier20 Jul 31, 2020
1db554c
Fix @throws section handling.
abgruszecki Jul 31, 2020
a642f84
Added multiple file tests. Added test for package merging
pikinier20 Jul 31, 2020
afde24e
Merge pull request #38 from romanowski/fix-throws-section
romanowski Jul 31, 2020
434e44b
Merge pull request #37 from romanowski/package-symbols
romanowski Jul 31, 2020
6f95531
Basic version of link resolution
abgruszecki Aug 4, 2020
57806f2
Added basic support for extension methods
pikinier20 Aug 4, 2020
f9973de
Improve link resolution
abgruszecki Aug 5, 2020
b6a8437
Fix debug println-s
abgruszecki Aug 5, 2020
2a30cef
Cleanup MemberLookup
abgruszecki Aug 5, 2020
3a25cd6
Cleanup Wiki parser
abgruszecki Aug 5, 2020
7c38c25
Support for right-associative extension methods. Extension methods ch…
pikinier20 Aug 6, 2020
97d0e1d
Add support for documentation briefs/summaries
abgruszecki Aug 6, 2020
850852d
Implement static page generator plugin for dokka
romanowski Aug 6, 2020
7eae771
Include sample static page for CI and testing
romanowski Aug 6, 2020
47b370c
Add command line api
romanowski Aug 6, 2020
02d4134
Merge pull request #48 from romanowski/extension-methods
romanowski Aug 6, 2020
94fdc59
Merge pull request #47 from romanowski/link-resolution
romanowski Aug 6, 2020
4da54da
Merge pull request #50 from romanowski/comment-summary
romanowski Aug 6, 2020
fd077ae
Merge pull request #45 from romanowski/static-site
romanowski Aug 6, 2020
757e893
Fix for bug with non-excluding modifiers
pikinier20 Aug 10, 2020
aa45416
Merge pull request #96 from VirtusLab/modifiers-bug
abgruszecki Aug 10, 2020
0411d35
Added grouping block. Extension grouping by extended symbol. Content …
pikinier20 Aug 7, 2020
d64138f
Companion rendering refactor
pikinier20 Aug 10, 2020
5593428
Merge pull request #95 from VirtusLab/extension-methods
romanowski Aug 10, 2020
a9a5750
Move match type case to sythetic support
romanowski Aug 7, 2020
5c89624
Prepare dotty-dokka to document itelf
romanowski Aug 8, 2020
a222530
Merge pull request #97 from VirtusLab/dogfood
romanowski Aug 10, 2020
404ee7b
Merge pull request #99 from VirtusLab/match-case
romanowski Aug 10, 2020
28077d4
Change _root_ to 'all packages'
romanowski Aug 10, 2020
6eb75ee
Basic enum support
pikinier20 Aug 11, 2020
bfd7667
Support for parameters in enum entries, 'extends' clause
pikinier20 Aug 11, 2020
3676f0f
Remove Tastydoc from dependencies
abgruszecki Aug 11, 2020
d3eb068
Merge pull request #104 from VirtusLab/remove-tastydoc
romanowski Aug 11, 2020
6d2e7e4
Merge pull request #100 from VirtusLab/dogfood
abgruszecki Aug 11, 2020
b56a0d7
Fix for & operator in enum types
pikinier20 Aug 12, 2020
86aecfe
Hotfix for generating pages for extension methods
pikinier20 Aug 12, 2020
4d71b52
Merge pull request #107 from VirtusLab/extension-hotfix
romanowski Aug 13, 2020
c5ddef4
CRs + refactor of documentable generation
pikinier20 Aug 13, 2020
39373e6
Merge pull request #103 from VirtusLab/enums-support
romanowski Aug 13, 2020
0926be3
Support for structural types
pikinier20 Aug 18, 2020
e154e13
Bugfixes in rendering refined types
pikinier20 Aug 18, 2020
7a0a4ae
Add transformer which creates package hierarchy
pikinier20 Aug 13, 2020
f0e1f15
Merge pull request #118 from VirtusLab/structural-types
pikinier20 Aug 19, 2020
de8fd27
Support for opaque types
pikinier20 Aug 18, 2020
9a76722
Merge pull request #108 from VirtusLab/navigation-fix
romanowski Aug 19, 2020
6e05c68
Merge pull request #114 from VirtusLab/opaque-types
abgruszecki Aug 19, 2020
5128929
Added inherited methods to method tab
pikinier20 Aug 19, 2020
c343dac
Update README and our site
abgruszecki Aug 19, 2020
3bf9551
Update s3 location
romanowski Aug 19, 2020
e380394
Merge pull request #123 from lampepfl/new-s3-bucket
romanowski Aug 19, 2020
1d48b49
Update AWS links
abgruszecki Aug 19, 2020
f1657dc
Merge pull request #122 from lampepfl/update-readme
abgruszecki Aug 19, 2020
8d3b92e
Add very basic API docs
abgruszecki Aug 19, 2020
089e974
Add a CLI option for selecting default doc syntax
abgruszecki Aug 19, 2020
0bd5240
Merge pull request #132 from lampepfl/basic-self-docs
abgruszecki Aug 20, 2020
15cf282
Add new arg to tests
abgruszecki Aug 20, 2020
0043d6e
Merge pull request #133 from lampepfl/comment-syntax-option
romanowski Aug 20, 2020
b9db874
Merge pull request #126 from lampepfl/inherited-methods
romanowski Aug 20, 2020
d682623
Added support for given symbols. There are classes documented that sh…
pikinier20 Aug 17, 2020
35d3990
Added --name parameter to allow setting the name of documented module
pikinier20 Aug 12, 2020
1ec9cb0
Merge pull request #110 from lampepfl/givens-support
pikinier20 Aug 21, 2020
bf7002c
Merge pull request #106 from lampepfl/name-parameter
pikinier20 Aug 21, 2020
802cfb7
Add Wiki link support to Markdown
abgruszecki Aug 24, 2020
bd1c319
Recreated ContentBuilder in Scala to make PageCreator more readable
pikinier20 Aug 20, 2020
dd38fbc
Merge pull request #140 from lampepfl/content-builder
pikinier20 Aug 25, 2020
9d97241
Merge pull request #146 from lampepfl/md-wiki-links
abgruszecki Aug 25, 2020
da883ff
Fix the Gradle wrapper
TheElectronWill Aug 25, 2020
363acdd
Upgrade Dokka to 1.4.0-rc
TheElectronWill Aug 25, 2020
6687e0c
Add buildDokkaApi as a dependency of compile
TheElectronWill Aug 25, 2020
e75c91f
Remove dokkaJavaApi jar from the repo
TheElectronWill Aug 25, 2020
5f65ab2
Gitignore libs/
TheElectronWill Aug 25, 2020
b0ae733
Merge pull request #153 from TheElectronWill/master
pikinier20 Aug 26, 2020
e10020c
Added tabs for know subtypes and linear supertypes
pikinier20 Aug 26, 2020
1e8e031
Merge pull request #154 from lampepfl/type-hierarchy
abgruszecki Sep 1, 2020
a3aef18
Added transformer that appends links to source files
pikinier20 Aug 25, 2020
e904857
Merge pull request #152 from lampepfl/source-links
pikinier20 Sep 1, 2020
d736bc6
Support for type lambdas
pikinier20 Aug 24, 2020
afeeff1
Support for term refs. Improved support for givens
pikinier20 Aug 24, 2020
54a77e3
Improved refinement parsing
pikinier20 Aug 24, 2020
94a3510
Merge pull request #148 from lampepfl/more-types-support
pikinier20 Sep 1, 2020
25425b3
Replace Dokka default CSS by a new theme
TheElectronWill Aug 25, 2020
0d0f950
Update links in index.md
TheElectronWill Aug 27, 2020
800bc66
Tweak the UI and make the left bar usable on small screens
TheElectronWill Aug 27, 2020
fbcce6f
Implement syntax highlighting
TheElectronWill Aug 31, 2020
7ad4500
Use relative url in the navbar
TheElectronWill Aug 31, 2020
e7bbdb5
Handle soft keywords preceding regular keywords
TheElectronWill Sep 2, 2020
a4b9c58
Merge pull request #156 from lampepfl/new-ui
pikinier20 Sep 3, 2020
884a1ba
Refactor model classes
pikinier20 Sep 2, 2020
dea4fe6
Refactor signature provider to use ScalaPageContentBuilder
pikinier20 Sep 2, 2020
3a63e62
Implement annotation parsing and building, add annotations to symbols
pikinier20 Sep 2, 2020
04d8ce2
Merge pull request #161 from lampepfl/annotations
abgruszecki Sep 8, 2020
428c17f
Support missing signature modifiers (open + private/protected with sc…
prolativ Sep 9, 2020
59c5f8d
Merge pull request #163 from lampepfl/missing-signature-modifiers
romanowski Sep 10, 2020
e31d0af
Migrate to dokka-site and dokka 1.4.0
romanowski Sep 9, 2020
a9650e5
Hide Object and Any supertypes and inherited methods
TheElectronWill Sep 20, 2020
81f39f6
Some formatting
TheElectronWill Sep 20, 2020
82b6dc8
Use relative links for the icons font (small PR)
TheElectronWill Sep 20, 2020
5c15b25
Merge pull request #169 from lampepfl/ui-relative-links
TheElectronWill Sep 21, 2020
f06988e
Merge pull request #164 from lampepfl/dokka1.4
romanowski Sep 21, 2020
d58478a
Merge pull request #168 from lampepfl/ignore-object-any
abgruszecki Sep 21, 2020
ba9f4a7
Update Dotty version to 0.27.0-RC1
abgruszecki Sep 23, 2020
76f496a
Update references to classfile output location
abgruszecki Sep 23, 2020
2047533
Merge pull request #170 from lampepfl/dotty-0.27-RC1
romanowski Sep 24, 2020
91bc522
Rewrite page creator
pikinier20 Sep 16, 2020
d41bec5
Extend html renderer and handle comments in page creator
pikinier20 Sep 17, 2020
f9fd37c
Add frontent support for inline html
pikinier20 Sep 3, 2020
b1b9941
Merge pull request #167 from lampepfl/page-creator-rewrite
pikinier20 Sep 24, 2020
200b5a1
Add example SBT sub-project
abgruszecki Sep 3, 2020
3415d1e
Add SBT plugin, configure the sub-project
abgruszecki Sep 3, 2020
c416882
Add test SBT project to CI
abgruszecki Sep 3, 2020
63c30b6
Add a small comment on how SBT calls us
abgruszecki Sep 3, 2020
55daf7a
Update back to the newest version of SBT
abgruszecki Sep 23, 2020
b76f414
Merge pull request #162 from lampepfl/sbt-protoplugin
abgruszecki Sep 28, 2020
3839f6e
Support for function, tuple and polyfunction literals
pikinier20 Sep 28, 2020
7ecdb68
Support for type operators
pikinier20 Sep 28, 2020
38a33c0
Do not get start/end of not-existing pos
abgruszecki Sep 28, 2020
707eef9
Merge pull request #177 from lampepfl/fix-valid-pos
abgruszecki Sep 28, 2020
c46d7d7
Cleanup comment code
abgruszecki Sep 11, 2020
a6c5094
Add comment parsing tests
abgruszecki Sep 11, 2020
87f34f3
Fix whitespace issue in code blocks
abgruszecki Sep 11, 2020
75f94da
Fix Wiki list test
abgruszecki Sep 11, 2020
41fba61
Merge pull request #165 from lampepfl/comment-parser-tests
abgruszecki Sep 28, 2020
85fd4a9
Filter super bridge methods and helpers for methods with default params
pikinier20 Sep 29, 2020
76b3ea0
Fix for showing empty sections and tabs
pikinier20 Sep 29, 2020
dcf0ded
Improve appearance of unresolved links
pikinier20 Sep 29, 2020
b0a80a8
Make all Scala snippets highlighted
abgruszecki Sep 29, 2020
1f63365
Add support for inferred links
abgruszecki Sep 28, 2020
ddbab8b
Fix spacing between Wiki-based paragraphs
abgruszecki Sep 29, 2020
1ce3198
Merge pull request #178 from lampepfl/filter-methods
abgruszecki Sep 29, 2020
58d193f
Merge pull request #173 from lampepfl/type-literals
abgruszecki Sep 29, 2020
69bced4
Merge pull request #179 from lampepfl/fix-scala-highlight
abgruszecki Sep 30, 2020
ac9dfca
Refactor doc link support
abgruszecki Sep 14, 2020
ec466c1
Remove commented-out code
abgruszecki Sep 17, 2020
8d66d31
Make only Wiki-style links supported in Md syntax
abgruszecki Sep 21, 2020
3851fb4
Add tests for Wiki link splitting
abgruszecki Sep 23, 2020
c81ede9
Remove leftover variable
abgruszecki Sep 30, 2020
9f167ac
Fix HTML layout
TheElectronWill Oct 1, 2020
b17439a
Fix warning in Main.scala
TheElectronWill Oct 1, 2020
901965a
Delete project/metals.sbt
TheElectronWill Oct 1, 2020
62f9120
Minor formatting/cleanup
TheElectronWill Oct 1, 2020
6dc0f21
Uncomment type literal testing
pikinier20 Oct 1, 2020
7b8288c
Merge pull request #183 from lampepfl/constant-type-test
pikinier20 Oct 1, 2020
9646d0b
Prettify a lambda
abgruszecki Oct 1, 2020
bb031e5
Merge pull request #180 from lampepfl/fix-wiki-par-spacing
abgruszecki Oct 1, 2020
7ef69dd
Merge pull request #182 from lampepfl/fix-html-ui
abgruszecki Oct 1, 2020
f0f0d52
"Fix" nested list rendering
abgruszecki Oct 1, 2020
84b0022
Merge pull request #166 from lampepfl/scaladoc-link-compat
abgruszecki Oct 1, 2020
8b12402
Merge pull request #185 from lampepfl/fix-nested-lists
TheElectronWill Oct 2, 2020
56c698b
Add support for common "at-sections" of Scaladoc
abgruszecki Oct 3, 2020
0eeedc6
Add CSS for params doc
abgruszecki Oct 3, 2020
b727366
Nest appropriate at-sections
abgruszecki Oct 4, 2020
5724289
Add an explanatory comment to potentially unsafe code
abgruszecki Oct 5, 2020
c832f1d
Merge pull request #172 from lampepfl/autolinks
abgruszecki Oct 5, 2020
16364a4
Define custom TagWrappers by inheriting from sealed Kotlin class
abgruszecki Oct 6, 2020
263b82c
Remove givens from inherited methods section
pikinier20 Oct 6, 2020
25639a3
Merge pull request #196 from lampepfl/minor-bugfixes
abgruszecki Oct 7, 2020
47b367f
Merge pull request #184 from lampepfl/at-tags
romanowski Oct 7, 2020
8fc6dc6
Adjust companion link
abgruszecki Oct 2, 2020
d5c9543
Extend pages with inherited members (only methods before)
pikinier20 Oct 8, 2020
3cc19f8
Add members from implicit conversions and extensions. Extend packages…
pikinier20 Sep 28, 2020
48f81c8
Fix constructor checks
abgruszecki Oct 9, 2020
d371373
Merge pull request #199 from lampepfl/inherited-members
abgruszecki Oct 9, 2020
03ae7a1
Merge pull request #194 from lampepfl/implicit-members
abgruszecki Oct 9, 2020
cdb3856
Remove hack for checking if method is an extension
pikinier20 Oct 12, 2020
a2c6775
Merge pull request #192 from lampepfl/adjust-companion-link
abgruszecki Oct 12, 2020
1a15594
Fully interactive hierarchy diagram
BarkingBad Oct 6, 2020
453ad30
Add colouring
BarkingBad Oct 13, 2020
dee0efd
Merge pull request #201 from lampepfl/extension-method-hack
abgruszecki Oct 15, 2020
950de42
Fix wrong rendering of diagram
pikinier20 Oct 15, 2020
b047e11
Merge pull request #207 from lampepfl/type-hierarchy
BarkingBad Oct 15, 2020
45e4fbc
Refactor documentable model in dokka
romanowski Oct 15, 2020
aa977b1
Implement frontend part of FilterView
zgrybus Oct 15, 2020
af893e9
Fix introduced problems
romanowski Oct 15, 2020
e9b5f95
Address review feedback and fix bugs
romanowski Oct 16, 2020
7a05a7c
Merge pull request #198 from lampepfl/filter-view
romanowski Oct 19, 2020
49067e6
Hide redundant type hierarchy diagram when there are no super and sub…
BarkingBad Oct 16, 2020
37b47b6
Merge pull request #209 from lampepfl/hide-redundant-diagrams
romanowski Oct 20, 2020
f0efc46
Permutate definitions to make Tasty happy
abgruszecki Oct 22, 2020
3a458e1
Merge pull request #214 from lampepfl/fix-tasty-exception
romanowski Oct 22, 2020
762f644
Update dokka to 1.4.10.2 and dokka site to 0.1.9
romanowski Oct 21, 2020
c883fe3
Migrate prject info single dir
romanowski Oct 22, 2020
47b91b1
Merge branch 'scala3doc/original-code' into scala3doc/migration
romanowski Oct 29, 2020
24e89e2
Scala3doc: fix all warnings
abgruszecki Oct 25, 2020
50fd2bc
Scala3doc: update Dotty dependency to latest snapshot
abgruszecki Oct 25, 2020
c23ef2d
Scala3doc: comment out code causing an infinite loop
abgruszecki Oct 25, 2020
2bc7355
Split scala3 doc and migrate file layout
romanowski Oct 26, 2020
84bef51
Document more then stdlib for Scala 3 doc
romanowski Oct 26, 2020
c7b70e1
Add integration tests for scala3doc
romanowski Oct 26, 2020
d605a4f
Rename Type to TypeRepr in scal3doc
romanowski Oct 26, 2020
b5361fa
Remove unnecessary changes from SBT config
abgruszecki Oct 27, 2020
f510be1
Use compiler context to generate project name
romanowski Oct 27, 2020
fa0d794
Migrate away from sbt IO in scala3doc
romanowski Oct 27, 2020
608b6e3
Migrate away from scala tags
romanowski Oct 27, 2020
f0a8719
Scala3doc merge cleanups
abgruszecki Oct 27, 2020
4aa49bd
Try not to use Reflection directly
romanowski Oct 27, 2020
11d190b
Run Scala3doc CI on self-hosted node
romanowski Oct 27, 2020
b195184
Remove scala3doc-test
romanowski Oct 27, 2020
e84ad19
Scala3doc is configured in Build.scala
romanowski Oct 27, 2020
08016f6
Fix resolvers in dotty-sbt
romanowski Oct 28, 2020
db014b2
Remove timeout in scala3doc CI
romanowski Oct 28, 2020
4571518
Try to run on public CI nodes
romanowski Oct 28, 2020
f94494e
Move example project to sbt-dotty tests
romanowski Oct 28, 2020
0b4cbeb
Change scala3doc parameter names
romanowski Oct 28, 2020
2974e92
Use new API of Tasy inspector
romanowski Oct 29, 2020
a1d4814
Fix Scala3doc CI workflow
abgruszecki Oct 29, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
8 changes: 8 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,15 @@ name: Dotty CI

on:
push:
paths-ignore:
# Do not run everything on changes only in docs
- 'scala3doc/**'
- 'scala3doc-testcases/**'
pull_request:
paths-ignore:
# Do not run everything on changes only in docs
- 'scala3doc/**'
- 'scala3doc-testcases/**'
schedule:
- cron: '0 3 * * *' # Every day at 3 AM

Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/scala3doc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI for Scala3doc

on:
push:
branches:
- master
pull_request:
jobs:
build:
runs-on: ubuntu-latest
container: lampepfl/dotty:2020-04-24

steps:
- name: Git Checkout
uses: actions/checkout@v2

- name: Cache Coursier
uses: actions/cache@v1
with:
path: ~/.cache/coursier
key: sbt-coursier-cache
- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: sbt-${{ hashFiles('**/build.sbt') }}

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Compile and test
run: ./project/scripts/sbt scala3doc/test

- name: Locally publish self
run: ./project/scripts/sbt scala3doc/publishLocal

- name: Generate test documentation
run: ./project/scripts/sbt scala3doc/generateSelfDocumentation

- name: Generate Scala 3 documentation
run: ./project/scripts/sbt scala3doc/generateScala3Documentation

- name: Generate documentation for example project using dotty-sbt
run: ./project/scripts/sbt "sbt-dotty/scripted sbt-dotty/scala3doc"
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ val `stdlib-bootstrapped-tasty-tests` = Build.`stdlib-bootstrapped-tasty-tests`
val `tasty-core` = Build.`tasty-core`
val `tasty-core-bootstrapped` = Build.`tasty-core-bootstrapped`
val `tasty-core-scala2` = Build.`tasty-core-scala2`
val scala3doc = Build.scala3doc
val `scala3doc-testcases` = Build.`scala3doc-testcases`
val `scala3-bench-run` = Build.`scala3-bench-run`
val dist = Build.dist
val `community-build` = Build.`community-build`
Expand Down
95 changes: 88 additions & 7 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,12 @@ object Build {
}
)

lazy val disableDocSetting =
// Disable scaladoc generation, it's way too slow and we'll replace it
// by dottydoc anyway. We still publish an empty -javadoc.jar to make
// sonatype happy.
sources in (Compile, doc) := Seq()

lazy val commonSettings = publishSettings ++ Seq(
scalaSource in Compile := baseDirectory.value / "src",
scalaSource in Test := baseDirectory.value / "test",
Expand All @@ -221,11 +227,6 @@ object Build {
resourceDirectory in Compile := baseDirectory.value / "resources",
resourceDirectory in Test := baseDirectory.value / "test-resources",

// Disable scaladoc generation, it's way too slow and we'll replace it
// by dottydoc anyway. We still publish an empty -javadoc.jar to make
// sonatype happy.
sources in (Compile, doc) := Seq(),

// Prevent sbt from rewriting our dependencies
scalaModuleInfo ~= (_.map(_.withOverrideScalaVersion(false))),

Expand All @@ -244,7 +245,8 @@ object Build {
crossPaths := false,
// Do not depend on the Scala library
autoScalaLibrary := false,
excludeFromIDE := true
excludeFromIDE := true,
disableDocSetting
)

// Settings used when compiling dotty (both non-bootstrapped and bootstrapped)
Expand All @@ -258,6 +260,8 @@ object Build {
moduleName ~= { _.stripSuffix("-scala2") },
version := dottyVersion,
target := baseDirectory.value / ".." / "out" / "scala-2" / name.value,

disableDocSetting
)

// Settings used when compiling dotty with the reference compiler
Expand All @@ -267,6 +271,8 @@ object Build {
version := dottyNonBootstrappedVersion,
scalaVersion := referenceVersion,
excludeFromIDE := true,

disableDocSetting
)

// Settings used when compiling dotty with a non-bootstrapped dotty
Expand Down Expand Up @@ -328,6 +334,8 @@ object Build {
},
// sbt-dotty defines `scalaInstance in doc` so we need to override it manually
scalaInstance in doc := scalaInstance.value,

disableDocSetting,
)

lazy val commonBenchmarkSettings = Seq(
Expand Down Expand Up @@ -1153,6 +1161,14 @@ object Build {
lazy val `scala3-bench-bootstrapped` = project.in(file("bench")).asDottyBench(Bootstrapped)
lazy val `scala3-bench-run` = project.in(file("bench-run")).asDottyBench(Bootstrapped)

val testcasesOutputDir = taskKey[String]("Root directory where tests classses are generated")
val testcasesSourceRoot = taskKey[String]("Root directory where tests sources are generated")
val generateSelfDocumentation = taskKey[Unit]("Generate example documentation")
val generateScala3Documentation = taskKey[Unit]("Generate documentation for dotty lib")
val generateTestcasesDocumentation = taskKey[Unit]("Generate documentation for testcases, usefull for debugging tests")
lazy val `scala3doc` = project.in(file("scala3doc")).asScala3doc
lazy val `scala3doc-testcases` = project.in(file("scala3doc-testcases")).asScala3docTestcases

// sbt plugin to use Dotty in your own build, see
// https://github.com/lampepfl/scala3-example-project for usage.
lazy val `sbt-dotty` = project.in(file("sbt-dotty")).
Expand Down Expand Up @@ -1192,6 +1208,7 @@ object Build {
publishLocal in `scala3-staging`,
publishLocal in `scala3-tasty-inspector`,
publishLocal in `scala3-doc-bootstrapped`,
publishLocal in `scala3doc`,
publishLocal in `scala3-bootstrapped` // Needed because sbt currently hardcodes the dotty artifact
).evaluated
)
Expand Down Expand Up @@ -1393,7 +1410,7 @@ object Build {
def asDottyRoot(implicit mode: Mode): Project = project.withCommonSettings.
aggregate(`scala3-interfaces`, dottyLibrary, dottyCompiler, tastyCore, dottyDoc, `scala3-sbt-bridge`).
bootstrappedAggregate(`scala3-language-server`, `scala3-staging`, `scala3-tasty-inspector`,
`scala3-library-bootstrappedJS`).
`scala3-library-bootstrappedJS`, scala3doc).
dependsOn(tastyCore).
dependsOn(dottyCompiler).
dependsOn(dottyLibrary).
Expand Down Expand Up @@ -1440,6 +1457,70 @@ object Build {
settings(commonBenchmarkSettings).
enablePlugins(JmhPlugin)

def asScala3doc: Project = {
def generateDocumentation(targets: String, name: String, outDir: String, params: String = "") = Def.taskDyn {
val sourceMapping = "=https://github.com/lampepfl/dotty/tree/master#L"
run.in(Compile).toTask(s""" -d output/$outDir -t $targets -n "$name" -s $sourceMapping $params""")
}

project.settings(commonBootstrappedSettings).
dependsOn(`scala3-compiler-bootstrapped`).
dependsOn(`scala3-tasty-inspector`).
settings(
// Needed to download dokka and its dependencies
resolvers += Resolver.jcenterRepo,
// Needed to download dokka-site
resolvers += Resolver.bintrayRepo("virtuslab", "dokka"),
libraryDependencies ++= Seq(
"com.virtuslab.dokka" % "dokka-site" % "0.1.9",
"com.vladsch.flexmark" % "flexmark-all" % "0.42.12",
"nl.big-o" % "liqp" % "0.6.7",
"args4j" % "args4j" % "2.33",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this really needed? We already have a way to process arguments (https://github.com/lampepfl/dotty/blob/d09600de025e6760dc8614a4ce62d568e90d16d5/compiler/src/dotty/tools/dotc/config/CompilerCommand.scala#L36-L37), we shouldn't use multiple different argument parsers, and we shouldn't depend on external projects unless absolutely necessary.

Copy link
Contributor

@abgruszecki abgruszecki Oct 29, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, but doesn't this mean that any change to our CLI would require changing the compiler's CLI? Because I think that's the case, and because of that I think that we should have a separate arg parser for the doctool.


"org.jetbrains.dokka" % "dokka-test-api" % "1.4.10.2" % "test",
"com.novocode" % "junit-interface" % "0.11" % "test",
),
Test / test := (Test / test).dependsOn(compile.in(Compile).in(`scala3doc-testcases`)).value,
testcasesOutputDir.in(Test) := classDirectory.in(Compile).in(`scala3doc-testcases`).value.getAbsolutePath.toString,
testcasesSourceRoot.in(Test) := (baseDirectory.in(`scala3doc-testcases`).value / "src").getAbsolutePath.toString,
Compile / mainClass := Some("dotty.dokka.Main"),
// There is a bug in dokka that prevents parallel tests withing the same jvm
fork.in(test) := true,
generateSelfDocumentation := Def.taskDyn {
generateDocumentation(classDirectory.in(Compile).value.getAbsolutePath, "scala3doc", "self", "-p documentation")
}.value,
generateScala3Documentation := Def.taskDyn {
val dottyJars = Seq(
// All projects below will be used to generated documentation for Scala 3
classDirectory.in(`scala3-interfaces`).in(Compile).value,
classDirectory.in(`tasty-core`).in(Compile).value,
classDirectory.in(`scala3-library`).in(Compile).value,
// TODO this one fails to load using TASTY
// classDirectory.in(`stdlib-bootstrapped`).in(Compile).value,
)
val roots = dottyJars.map(_.toString).mkString(java.io.File.pathSeparator)

if (dottyJars.isEmpty) Def.task { streams.value.log.error("Dotty lib wasn't found") }
else generateDocumentation(roots, "Scala 3", "stdLib", "-p dotty-docs/docs")
}.value,
generateTestcasesDocumentation := Def.taskDyn {
generateDocumentation(Build.testcasesOutputDir.in(Test).value, "Scala3doc testcases", "testcases")
}.value,
buildInfoKeys in Test := Seq[BuildInfoKey](
Build.testcasesOutputDir.in(Test),
Build.testcasesSourceRoot.in(Test),
),
buildInfoPackage in Test := "dotty.dokka",
BuildInfoPlugin.buildInfoScopedSettings(Test),
BuildInfoPlugin.buildInfoDefaultSettings,
// Uncomment to debug dokka processing (require to run debug in listen mode on 5005 port)
// javaOptions.in(run) += "-agentlib:jdwp=transport=dt_socket,server=n,address=localhost:5005,suspend=y"
)
}

def asScala3docTestcases: Project =
project.dependsOn(`scala3-compiler-bootstrapped`).settings(commonBootstrappedSettings)

def asDist(implicit mode: Mode): Project = project.
enablePlugins(PackPlugin).
withCommonSettings.
Expand Down
3 changes: 3 additions & 0 deletions sbt-dotty/sbt-test/sbt-dotty/scala3doc/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
scalaVersion := sys.props("plugin.scalaVersion")

useScala3doc := true
1 change: 1 addition & 0 deletions sbt-dotty/sbt-test/sbt-dotty/scala3doc/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version"))
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package example

/**
* Automatic Tupling of Function Params: https://dotty.epfl.ch/docs/reference/other-new-features/auto-parameter-tupling.html
*/
object AutoParamTupling {

def test: Unit = {

/**
* In order to get thread safety, you need to put @volatile before lazy vals.
* https://dotty.epfl.ch/docs/reference/changed-features/lazy-vals.html
*/
@volatile lazy val xs: List[String] = List("d", "o", "t", "t", "y")

/**
* Current behaviour in Scala 2.12.2 :
* error: missing parameter type
* Note: The expected type requires a one-argument function accepting a 2-Tuple.
* Consider a pattern matching anonymous function, `{ case (s, i) => ... }`
*/
xs.zipWithIndex.map((s, i) => println(s"$i: $s"))

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package example

import scala.concurrent.{ExecutionContext, Future}
import scala.util.Try

/**
* Context Queries:
* - http://dotty.epfl.ch/docs/reference/contextual/query-types.html,
* - https://www.scala-lang.org/blog/2016/12/07/implicit-function-types.html
*/
object ContextQueries /* Formerly known as Implicit Function Types */ {

object context {
// type alias Contextual
type Contextual[T] = ExecutionContext ?=> T

// sum is expanded to sum(x, y)(ctx)
def asyncSum(x: Int, y: Int): Contextual[Future[Int]] = Future(x + y)

def asyncMult(x: Int, y: Int)(using ctx: ExecutionContext) = Future(x * y)
}

object parse {

type Parseable[T] = ImpliedInstances.StringParser[T] ?=> Try[T]

def sumStrings(x: String, y: String): Parseable[Int] = {
val parser = implicitly[ImpliedInstances.StringParser[Int]]
val tryA = parser.parse(x)
val tryB = parser.parse(y)

for {
a <- tryA
b <- tryB
} yield a + b
}
}

def test: Unit = {
import ExecutionContext.Implicits.global
context.asyncSum(3, 4).foreach(println)
context.asyncMult(3, 4).foreach(println)

println(parse.sumStrings("3", "4"))
println(parse.sumStrings("3", "a"))
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package example

import scala.language.implicitConversions

/**
* Conversions: http://dotty.epfl.ch/docs/reference/contextual/conversions.html
*/
object Conversion {

case class IntWrapper(a: Int) extends AnyVal
case class DoubleWrapper(b: Double) extends AnyVal

def convert[T, U](x: T)(using converter: Conversion[T, U]): U = converter(x)

given IntWrapperToDoubleWrapper as Conversion[IntWrapper, DoubleWrapper] = new Conversion[IntWrapper, DoubleWrapper] {
override def apply(i: IntWrapper): DoubleWrapper = new DoubleWrapper(i.a.toDouble)
}

def useConversion(using f: Conversion[IntWrapper, DoubleWrapper]) = {
val y: IntWrapper = new IntWrapper(4)
val x: DoubleWrapper = y
x
}

/* Not working anymore.
def useConversion(implicit f: A => B) = {
val y: A = ...
val x: B = a // error under Dotty
}
*/

def test: Unit = {
println(useConversion)
println(convert(new IntWrapper(42)))
}



}
Loading