2019-12-03 23:26:13 +00:00
|
|
|
; -*- mode: Lisp;-*-
|
|
|
|
|
2023-03-15 21:52:13 +00:00
|
|
|
; SPDX-FileCopyrightText: 2021 The CC: Tweaked Developers
|
|
|
|
;
|
2023-10-11 07:00:07 +00:00
|
|
|
; SPDX-License-Identifier: MPL-2.0
|
2023-03-15 21:52:13 +00:00
|
|
|
|
2019-12-03 23:26:13 +00:00
|
|
|
(sources
|
2022-05-05 12:24:02 +00:00
|
|
|
/doc/
|
2022-11-09 23:58:56 +00:00
|
|
|
/projects/forge/build/docs/luaJavadoc/
|
2022-11-04 22:31:56 +00:00
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/bios.lua
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/
|
|
|
|
/projects/core/src/test/resources/test-rom
|
2023-09-28 20:00:00 +00:00
|
|
|
/projects/web/src/frontend/mount)
|
2019-12-03 23:26:13 +00:00
|
|
|
|
2020-04-10 09:27:53 +00:00
|
|
|
(doc
|
2022-11-06 13:37:07 +00:00
|
|
|
; Also defined in projects/web/build.gradle.kts
|
|
|
|
(destination /projects/web/build/illuaminate)
|
2020-04-10 09:27:53 +00:00
|
|
|
(index doc/index.md)
|
2020-12-28 18:20:13 +00:00
|
|
|
|
|
|
|
(site
|
|
|
|
(title "CC: Tweaked")
|
2022-11-09 23:58:56 +00:00
|
|
|
(logo projects/common/src/main/resources/pack.png)
|
2020-12-28 18:20:13 +00:00
|
|
|
(url https://tweaked.cc/)
|
2021-10-17 17:14:22 +00:00
|
|
|
(source-link https://github.com/cc-tweaked/CC-Tweaked/blob/${commit}/${path}#L${line})
|
2020-12-28 18:20:13 +00:00
|
|
|
|
2023-10-03 08:19:19 +00:00
|
|
|
(styles /projects/web/build/rollup/index.css)
|
2022-11-06 13:37:07 +00:00
|
|
|
(scripts /projects/web/build/rollup/index.js)
|
2020-12-28 18:20:13 +00:00
|
|
|
(head doc/head.html))
|
2020-04-10 09:27:53 +00:00
|
|
|
|
2020-06-24 11:10:54 +00:00
|
|
|
(module-kinds
|
2020-12-10 22:16:49 +00:00
|
|
|
(peripheral Peripherals)
|
2021-01-14 18:19:22 +00:00
|
|
|
(generic_peripheral "Generic Peripherals")
|
Add arbitrary audio support to speakers (#982)
Speakers can now play arbitrary PCM audio, sampled at 48kHz and with a
resolution of 8 bits. Programs can build up buffers of audio locally,
play it using `speaker.playAudio`, where it is encoded to DFPWM, sent
across the network, decoded, and played on the client.
`speaker.playAudio` may return false when a chunk of audio has been
submitted but not yet sent to the client. In this case, the program
should wait for a speaker_audio_empty event and try again, repeating
until it works.
While the API is a little odd, this gives us fantastic flexibility (we
can play arbitrary streams of audio) while still being resilient in the
presence of server lag (either TPS or on the computer thread).
Some other notes:
- There is a significant buffer on both the client and server, which
means that sound take several seconds to finish after playing has
started. One can force it to be stopped playing with the new
`speaker.stop` call.
- This also adds a `cc.audio.dfpwm` module, which allows encoding and
decoding DFPWM1a audio files.
- I spent so long writing the documentation for this. Who knows if it'll
be helpful!
2021-12-13 22:56:59 +00:00
|
|
|
(event Events)
|
2022-05-05 12:24:02 +00:00
|
|
|
(guide Guides)
|
|
|
|
(reference Reference))
|
2020-06-24 11:10:54 +00:00
|
|
|
|
2020-04-10 09:27:53 +00:00
|
|
|
(library-path
|
|
|
|
/doc/stub/
|
2022-11-09 23:58:56 +00:00
|
|
|
/projects/forge/build/docs/luaJavadoc/
|
2020-04-10 09:27:53 +00:00
|
|
|
|
2022-11-04 22:31:56 +00:00
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/apis/
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/apis/command/
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/apis/turtle/
|
2020-04-10 09:27:53 +00:00
|
|
|
|
2022-11-04 22:31:56 +00:00
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/modules/main/
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/modules/command/
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/modules/turtle/))
|
2020-04-10 09:27:53 +00:00
|
|
|
|
2019-12-03 23:26:13 +00:00
|
|
|
(at /
|
|
|
|
(linters
|
2020-04-18 09:09:40 +00:00
|
|
|
syntax:string-index
|
2023-08-23 17:10:01 +00:00
|
|
|
doc:docusaurus-admonition
|
2023-08-24 09:48:30 +00:00
|
|
|
doc:ldoc-reference
|
2020-04-18 09:09:40 +00:00
|
|
|
|
2019-12-10 18:54:43 +00:00
|
|
|
;; It'd be nice to avoid this, but right now there's a lot of instances of
|
|
|
|
;; it.
|
2019-12-03 23:26:13 +00:00
|
|
|
-var:set-loop
|
|
|
|
|
|
|
|
;; It's useful to name arguments for documentation, so we allow this. It'd
|
|
|
|
;; be good to find a compromise in the future, but this works for now.
|
2020-04-28 08:42:34 +00:00
|
|
|
-var:unused-arg)
|
2020-02-04 16:41:29 +00:00
|
|
|
|
2020-04-18 09:09:40 +00:00
|
|
|
(lint
|
|
|
|
(bracket-spaces
|
|
|
|
(call no-space)
|
|
|
|
(function-args no-space)
|
|
|
|
(parens no-space)
|
|
|
|
(table space)
|
2020-04-28 08:42:34 +00:00
|
|
|
(index no-space))
|
|
|
|
|
2021-09-26 16:13:26 +00:00
|
|
|
(allow-clarifying-parens true)
|
|
|
|
|
2020-04-28 08:42:34 +00:00
|
|
|
;; colours imports from colors, and we don't handle that right now.
|
|
|
|
;; keys is entirely dynamic, so we skip it.
|
2020-10-11 21:38:18 +00:00
|
|
|
(dynamic-modules colours keys _G)
|
2020-04-28 08:42:34 +00:00
|
|
|
|
|
|
|
(globals
|
|
|
|
:max
|
|
|
|
_CC_DEFAULT_SETTINGS
|
|
|
|
_CC_DISABLE_LUA51_FEATURES
|
2021-10-08 10:29:52 +00:00
|
|
|
_HOST
|
2020-04-28 08:42:34 +00:00
|
|
|
;; Ideally we'd pick these up from bios.lua, but illuaminate currently
|
|
|
|
;; isn't smart enough.
|
|
|
|
sleep write printError read rs)))
|
2019-12-03 23:26:13 +00:00
|
|
|
|
2023-08-27 14:35:36 +00:00
|
|
|
;; We disable the unused global linter in bios.lua, APIs and our documentation
|
|
|
|
;; stubs docs. In the future hopefully we'll get illuaminate to handle this.
|
2019-12-03 23:26:13 +00:00
|
|
|
(at
|
2023-08-27 14:35:36 +00:00
|
|
|
(/doc/stub/
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/bios.lua
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/apis/
|
|
|
|
/projects/forge/build/docs/luaJavadoc/)
|
2020-04-10 09:27:53 +00:00
|
|
|
(linters -var:unused-global)
|
|
|
|
(lint (allow-toplevel-global true)))
|
2020-04-21 11:12:44 +00:00
|
|
|
|
2020-04-22 13:39:39 +00:00
|
|
|
;; Suppress warnings for currently undocumented modules.
|
2020-04-21 11:12:44 +00:00
|
|
|
(at
|
2021-04-03 11:44:22 +00:00
|
|
|
(; Lua APIs
|
2022-11-04 22:31:56 +00:00
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/apis/window.lua)
|
2020-04-22 13:39:39 +00:00
|
|
|
|
Generate documentation stubs from Javadocs
illuaminate does not handle Java files, for obvious reasons. In order to
get around that, we have a series of stub files within /doc/stub which
mirrored the Java ones. While this works, it has a few problems:
- The link to source code does not work - it just links to the stub
file.
- There's no guarantee that documentation remains consistent with the
Java code. This change found several methods which were incorrectly
documented beforehand.
We now replace this with a custom Java doclet[1], which extracts doc
comments from @LuaFunction annotated methods and generates stub-files
from them. These also contain a @source annotation, which allows us to
correctly link them back to the original Java code.
There's some issues with this which have yet to be fixed. However, I
don't think any of them are major blockers right now:
- The custom doclet relies on Java 9 - I think it's /technically/
possible to do this on Java 8, but the API is significantly uglier.
This means that we need to run javadoc on a separate JVM.
This is possible, and it works locally and on CI, but is definitely
not a nice approach.
- illuaminate now requires the doc stubs to be generated in order for
the linter to pass, which does make running the linter locally much
harder (especially given the above bullet point).
We could notionally include the generated stubs (or at least a cut
down version of them) in the repo, but I'm not 100% sure about that.
[1]: https://docs.oracle.com/javase/9/docs/api/jdk/javadoc/doclet/package-summary.html
2020-07-03 12:31:26 +00:00
|
|
|
(linters -doc:undocumented -doc:undocumented-arg -doc:undocumented-return))
|
2020-04-22 13:39:39 +00:00
|
|
|
|
2021-04-03 11:44:22 +00:00
|
|
|
;; Suppress warnings for various APIs using its own deprecated members.
|
|
|
|
(at
|
2022-11-04 22:31:56 +00:00
|
|
|
(/projects/core/src/main/resources/data/computercraft/lua/bios.lua
|
|
|
|
/projects/core/src/main/resources/data/computercraft/lua/rom/apis/turtle/turtle.lua)
|
2020-10-11 21:38:18 +00:00
|
|
|
(linters -var:deprecated))
|
|
|
|
|
2022-11-04 22:31:56 +00:00
|
|
|
(at /projects/core/src/test/resources/test-rom
|
2020-08-04 18:50:36 +00:00
|
|
|
; We should still be able to test deprecated members.
|
|
|
|
(linters -var:deprecated)
|
|
|
|
|
2020-04-28 08:42:34 +00:00
|
|
|
(lint
|
|
|
|
(globals
|
|
|
|
:max sleep write
|
2022-12-04 21:59:30 +00:00
|
|
|
cct_test describe expect howlci fail it pending stub before_each)))
|
2020-11-12 19:01:50 +00:00
|
|
|
|
2023-09-28 20:00:00 +00:00
|
|
|
(at /projects/web/src/frontend/mount/expr_template.lua (lint (globals :max __expr__)))
|