Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLeitwolf2026-11-16 12:33:40 +0300
committerGitHub2026-11-16 12:33:40 +0300
commit61d6027e4d0127170210af07bfd94c22f2c814be (patch)
tree2695116aecb1cfaf3d68ccd3b94b0d2d6b48c5b0
parent8e63d3f5351aff40eb033fdfb81f9ed74c003a24 (diff)
parent4ddcd84f3f777145bd7ccda770ff9a092e4a0ffd (diff)
downloadtazel-docs/code-of-conduct.tar.gz
Merge branch 'main' into docs/code-of-conductdocs/code-of-conduct
-rw-r--r--gradle-plugin/sources/test/kotlin/com/progmasoft/tazel/gradle/TazelPluginPluginTest.kt2
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/cli/Main.kt1
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/driver/Actions.kt2
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/driver/Builder.kt4
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/driver/CcToolchain.kt11
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/driver/Jobs.kt1
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/driver/Processes.kt1
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/driver/SourceTools.kt5
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/dsl/BuildDsl.kt8
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/dsl/ModuleDsl.kt37
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/dsl/TargetOptions.kt1
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/dsl/Targets.kt27
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/dsl/Triple.kt1
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/dsl/custom/lexer/CustomLexer.kt1
-rw-r--r--sources/main/kotlin/com/progmasoft/tazel/label/Label.kt1
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/cli/CustomCommandsTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/cli/MainTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/cli/SourceCommandTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/cli/TazelOptionsTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/cli/TestCommandTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/driver/DriverTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/label/LabelTest.kt2
-rw-r--r--sources/test/kotlin/com/progmasoft/tazel/project/ModuleLoaderTest.kt2
24 files changed, 111 insertions, 10 deletions
diff --git a/gradle-plugin/sources/test/kotlin/com/progmasoft/tazel/gradle/TazelPluginPluginTest.kt b/gradle-plugin/sources/test/kotlin/com/progmasoft/tazel/gradle/TazelPluginPluginTest.kt
index 257c5f6..777748d 100644
--- a/gradle-plugin/sources/test/kotlin/com/progmasoft/tazel/gradle/TazelPluginPluginTest.kt
+++ b/gradle-plugin/sources/test/kotlin/com/progmasoft/tazel/gradle/TazelPluginPluginTest.kt
@@ -15,7 +15,7 @@ import kotlin.test.assertTrue
import org.gradle.testkit.runner.GradleRunner
/** Runs the plugin in a project of its own, as a plugin author would. */
-class TazelPluginPluginTest {
+internal class TazelPluginPluginTest {
private lateinit var project: File
@BeforeTest
diff --git a/sources/main/kotlin/com/progmasoft/tazel/cli/Main.kt b/sources/main/kotlin/com/progmasoft/tazel/cli/Main.kt
index 7ed9924..8339621 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/cli/Main.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/cli/Main.kt
@@ -181,6 +181,7 @@ private fun stopping(err: Appendable, block: () -> Int): Int =
ExitCode.FAILURE
}
+/** Runs the command line [arguments] and exits with the code of the command. */
fun main(arguments: Array<String>) {
exitProcess(run(arguments.toList(), System.out, System.err))
}
diff --git a/sources/main/kotlin/com/progmasoft/tazel/driver/Actions.kt b/sources/main/kotlin/com/progmasoft/tazel/driver/Actions.kt
index aa10ad6..66a464d 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/driver/Actions.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/driver/Actions.kt
@@ -83,7 +83,9 @@ class Digests {
return digest
}
+ /** Digests of bytes, for keys that are not files. */
companion object {
+ /** The SHA-256 of [bytes], as lowercase hexadecimal. */
fun sha256(bytes: ByteArray): String =
java.security.MessageDigest.getInstance("SHA-256").digest(bytes).joinToString("") {
"%02x".format(it)
diff --git a/sources/main/kotlin/com/progmasoft/tazel/driver/Builder.kt b/sources/main/kotlin/com/progmasoft/tazel/driver/Builder.kt
index 618a6e5..6ede757 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/driver/Builder.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/driver/Builder.kt
@@ -45,6 +45,10 @@ class Builder(
private val digests = Digests()
private val cache = ActionCache(digests)
+ /**
+ * Builds every target of the plan: returns where each product is and how many commands ran, and
+ * throws [BuildFailure] with the message of every failed action.
+ */
fun build(): BuildResult {
val units = mutableListOf<BuildUnit<Unit>>()
for (target in plan.targets) {
diff --git a/sources/main/kotlin/com/progmasoft/tazel/driver/CcToolchain.kt b/sources/main/kotlin/com/progmasoft/tazel/driver/CcToolchain.kt
index e1f148e..31238a9 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/driver/CcToolchain.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/driver/CcToolchain.kt
@@ -31,6 +31,10 @@ data class CcCompiler(
class CcToolchain(private val programs: Programs, private val host: TargetTriple) {
private val cache = java.util.concurrent.ConcurrentHashMap<Pair<Compiler?, String>, CcCompiler>()
+ /**
+ * The compiler of [language] for [triple]: the [choice] of the target, or the first one found
+ * without one. A compiler is found once for each choice and triple.
+ */
fun compiler(choice: Compiler?, language: Language, triple: TargetTriple): CcCompiler =
cache.getOrPut(choice to triple.text) { find(choice, language, triple) }
@@ -111,10 +115,16 @@ private val VENDORS = setOf("unknown", "pc", "apple", "w64", "none", "suse", "re
/** The file names a triple gives the outputs of a target, from the name of the target. */
object OutputNames {
+ /** The executable [name] makes on [os]: `name.exe` on Windows, `name` elsewhere. */
fun executable(name: String, os: Os) = if (os == Os.WINDOWS) "$name.exe" else name
+ /** The static library [name] makes on [os]: `name.lib` on Windows, `libname.a` elsewhere. */
fun staticLibrary(name: String, os: Os) = if (os == Os.WINDOWS) "$name.lib" else "lib$name.a"
+ /**
+ * The shared library [name] makes on [os], with [soVersion] in it when there is one: `name.dll`,
+ * `libname.dylib` or `libname.so`.
+ */
fun sharedLibrary(name: String, os: Os, soVersion: String?) =
when (os) {
Os.WINDOWS -> "$name.dll"
@@ -122,5 +132,6 @@ object OutputNames {
else -> if (soVersion == null) "lib$name.so" else "lib$name.so.$soVersion"
}
+ /** The suffix of object files on [os]: `.obj` on Windows, `.o` elsewhere. */
fun objectSuffix(os: Os) = if (os == Os.WINDOWS) ".obj" else ".o"
}
diff --git a/sources/main/kotlin/com/progmasoft/tazel/driver/Jobs.kt b/sources/main/kotlin/com/progmasoft/tazel/driver/Jobs.kt
index 2b261f1..3387740 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/driver/Jobs.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/driver/Jobs.kt
@@ -44,6 +44,7 @@ class BuildProfile {
}
}
+ /** Writes the trace of every job run so far to [file], creating its directory. */
fun write(file: Path) {
file.parent?.let(Files::createDirectories)
val lines =
diff --git a/sources/main/kotlin/com/progmasoft/tazel/driver/Processes.kt b/sources/main/kotlin/com/progmasoft/tazel/driver/Processes.kt
index 102df81..2562aad 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/driver/Processes.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/driver/Processes.kt
@@ -88,6 +88,7 @@ data class GatheredRun(
val output: String,
)
+/** The [Processes] of the operating system: every command is started as a process. */
object SystemProcesses : Processes {
override fun run(
command: List<String>,
diff --git a/sources/main/kotlin/com/progmasoft/tazel/driver/SourceTools.kt b/sources/main/kotlin/com/progmasoft/tazel/driver/SourceTools.kt
index 1a1ce3d..671b8d3 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/driver/SourceTools.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/driver/SourceTools.kt
@@ -206,6 +206,11 @@ class Linter(
private val out: Appendable,
private val jobs: Int,
) {
+ /**
+ * Runs clang-tidy on [entries] with the compilation database [database], adding [extraArguments];
+ * with [fix] it applies the fixes, one unit at a time. Returns how many units were checked and
+ * how many failed.
+ */
fun lint(
entries: List<CompileEntry>,
database: Path,
diff --git a/sources/main/kotlin/com/progmasoft/tazel/dsl/BuildDsl.kt b/sources/main/kotlin/com/progmasoft/tazel/dsl/BuildDsl.kt
index 301540e..fbf358d 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/dsl/BuildDsl.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/dsl/BuildDsl.kt
@@ -56,15 +56,19 @@ internal constructor(
private val language: Language,
private val declare: (TargetDeclaration) -> Unit,
) {
+ /** Declares the program [name]: `tazel build` links it and `tazel run` runs it. */
fun bin(name: String, block: CcTargetScope<L, KindMark.Bin>.() -> Unit) =
add(name, TargetKind.BIN, block)
+ /** Declares the static library [name], an archive of its object files. */
fun staticlib(name: String, block: CcTargetScope<L, KindMark.StaticLib>.() -> Unit) =
add(name, TargetKind.STATICLIB, block)
+ /** Declares the shared library [name], linked like a program. */
fun sharedlib(name: String, block: CcTargetScope<L, KindMark.SharedLib>.() -> Unit) =
add(name, TargetKind.SHAREDLIB, block)
+ /** Declares the test [name]: a program that `tazel test` runs. */
fun test(name: String, block: CcTargetScope<L, KindMark.Test>.() -> Unit) =
add(name, TargetKind.TEST, block)
@@ -83,15 +87,19 @@ internal constructor(
/** `zig`: the four kinds of Zig target. */
class ZigTargets internal constructor(private val declare: (TargetDeclaration) -> Unit) {
+ /** Declares the Zig program [name]: `tazel build` builds it and `tazel run` runs it. */
fun bin(name: String, block: ZigTargetScope<KindMark.Bin>.() -> Unit) =
add(name, TargetKind.BIN, block)
+ /** Declares the Zig static library [name]. */
fun staticlib(name: String, block: ZigTargetScope<KindMark.StaticLib>.() -> Unit) =
add(name, TargetKind.STATICLIB, block)
+ /** Declares the Zig shared library [name]. */
fun sharedlib(name: String, block: ZigTargetScope<KindMark.SharedLib>.() -> Unit) =
add(name, TargetKind.SHAREDLIB, block)
+ /** Declares the Zig test [name], which `tazel test` runs. */
fun test(name: String, block: ZigTargetScope<KindMark.Test>.() -> Unit) =
add(name, TargetKind.TEST, block)
diff --git a/sources/main/kotlin/com/progmasoft/tazel/dsl/ModuleDsl.kt b/sources/main/kotlin/com/progmasoft/tazel/dsl/ModuleDsl.kt
index b2c10f9..df6737f 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/dsl/ModuleDsl.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/dsl/ModuleDsl.kt
@@ -7,6 +7,10 @@ package com.progmasoft.tazel.dsl
import com.progmasoft.tazel.label.Labels
+/**
+ * Marks the receivers of the project files, so that a block can call only its own settings and not
+ * those of the blocks around it.
+ */
@DslMarker annotation class TazelDsl
/** What `module { }` says about the module. */
@@ -97,26 +101,34 @@ class ModuleFileScope internal constructor() {
private var cache: CacheSettings? = null
private var execution: ExecutionSettings? = null
+ /**
+ * What the module is: its name, version, description, authors and license. Every `MODULE.kts` has
+ * it, once.
+ */
fun module(block: ModuleScope.() -> Unit) {
once(info, "module")
info = ModuleScope().apply(block).build()
}
+ /** The packages the targets of the module may depend on; at most once. */
fun dependencies(block: DependenciesScope.() -> Unit) {
once(dependencies, "dependencies")
dependencies = DependenciesScope().apply(block)
}
+ /** How the module is pushed to ViGet; at most once. */
fun viget(block: VigetScope.() -> Unit) {
once(viget, "viget")
viget = VigetScope().apply(block).build()
}
+ /** The local cache and the remote caches of results; at most once. */
fun cache(block: CacheScope.() -> Unit) {
once(cache, "cache")
cache = CacheScope().apply(block).build()
}
+ /** How many commands run at a time, and where; at most once. */
fun execution(block: ExecutionScope.() -> Unit) {
once(execution, "execution")
execution = ExecutionScope().apply(block).build()
@@ -163,6 +175,7 @@ class ModuleFileScope internal constructor() {
}
}
+/** The receiver of `module { }`; [name] is required. */
@TazelDsl
class ModuleScope internal constructor() {
var name: String? = null
@@ -171,6 +184,7 @@ class ModuleScope internal constructor() {
var license: String? = null
private val authors = mutableListOf<String>()
+ /** Adds the authors [names] of the module, in order. */
fun authors(vararg names: String) {
names.forEach { authors += requireText(it, "an author") }
}
@@ -185,6 +199,7 @@ class ModuleScope internal constructor() {
)
}
+/** The receiver of `dependencies { }`. */
@TazelDsl
class DependenciesScope internal constructor() {
internal val remote = mutableListOf<RemoteDependency>()
@@ -211,6 +226,7 @@ class DependenciesScope internal constructor() {
}
}
+/** The receiver of one ViGet dependency: its [name], [version] and, if wanted, [alias]. */
@TazelDsl
class RemoteDependencyScope internal constructor() {
var name: String? = null
@@ -238,15 +254,21 @@ class RemoteDependencyScope internal constructor() {
}
}
+/**
+ * The receiver of one local dependency: the [name] its labels use and the `.vipkg` files it
+ * includes.
+ */
@TazelDsl
class LocalDependencyScope internal constructor() {
var name: String? = null
private val packages = mutableListOf<FileSelection>()
+ /** Includes the `.vipkg` files [paths], relative to the module root. */
fun include(vararg paths: String) {
paths.forEach { packages += FilePath(requireRelativePath(it, "local package")) }
}
+ /** Includes the `.vipkg` files the [globs] match. */
fun include(vararg globs: Glob) {
packages += globs
}
@@ -262,6 +284,7 @@ class LocalDependencyScope internal constructor() {
}
}
+/** The receiver of `viget { }`; with [push], the module is pushed as a package. */
@TazelDsl
class VigetScope internal constructor() {
var push: Boolean = false
@@ -273,10 +296,12 @@ class VigetScope internal constructor() {
targets += labels
}
+ /** Leaves the files [paths] out of the package. */
fun exclude(vararg paths: String) {
paths.forEach { excludes += FilePath(requireRelativePath(it, "viget exclude")) }
}
+ /** Leaves the files the [globs] match out of the package. */
fun exclude(vararg globs: Glob) {
excludes += globs
}
@@ -284,6 +309,7 @@ class VigetScope internal constructor() {
internal fun build() = VigetSettings(push, targets.toList(), excludes.toList())
}
+/** The receiver of `cache { }`: the [local] cache and the remote ones. */
@TazelDsl
class CacheScope internal constructor() {
var local: Boolean = true
@@ -291,6 +317,7 @@ class CacheScope internal constructor() {
var keep: Int = 8
private val remotes = mutableListOf<RemoteCache>()
+ /** Adds the remote cache at the https:// address [url]. */
fun remote(url: String, block: RemoteCacheScope.() -> Unit = {}) {
remotes += RemoteCacheScope().apply(block).build(requireUrl(url))
}
@@ -301,6 +328,10 @@ class CacheScope internal constructor() {
}
}
+/**
+ * The receiver of one remote cache: whether Tazel [read]s from and [write]s to it, and the keys it
+ * uses.
+ */
@TazelDsl
class RemoteCacheScope internal constructor() {
var read: Boolean = true
@@ -312,6 +343,10 @@ class RemoteCacheScope internal constructor() {
internal fun build(url: String) = RemoteCache(url, read, write, token, publicKey, signingKey)
}
+/**
+ * The receiver of `execution { }`: how many [jobs] run at a time, the [memory] they may take, and
+ * whether the build [keepGoing]s after a failure.
+ */
@TazelDsl
class ExecutionScope internal constructor() {
var jobs: Int? = null
@@ -319,6 +354,7 @@ class ExecutionScope internal constructor() {
var keepGoing: Boolean = false
private val remotes = mutableListOf<RemoteExecution>()
+ /** Adds the machine at the https:// address [url] that runs commands. */
fun remote(url: String, block: RemoteExecutionScope.() -> Unit = {}) {
remotes += RemoteExecutionScope().apply(block).build(requireUrl(url))
}
@@ -332,6 +368,7 @@ class ExecutionScope internal constructor() {
}
}
+/** The receiver of one remote execution machine: the [token] it is reached with. */
@TazelDsl
class RemoteExecutionScope internal constructor() {
var token: String? = null
diff --git a/sources/main/kotlin/com/progmasoft/tazel/dsl/TargetOptions.kt b/sources/main/kotlin/com/progmasoft/tazel/dsl/TargetOptions.kt
index dfed834..4941ddf 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/dsl/TargetOptions.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/dsl/TargetOptions.kt
@@ -154,6 +154,7 @@ var TargetScope<KindMark.Test>.shards: Int
settings = settings.copy(shards = value)
}
+/** Adds [tags] to the test, which say how `tazel test` treats it. */
fun TargetScope<KindMark.Test>.tags(vararg tags: TestTag) {
settings = settings.copy(tags = settings.tags + tags)
}
diff --git a/sources/main/kotlin/com/progmasoft/tazel/dsl/Targets.kt b/sources/main/kotlin/com/progmasoft/tazel/dsl/Targets.kt
index 3e3dbc9..32f5750 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/dsl/Targets.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/dsl/Targets.kt
@@ -32,20 +32,28 @@ enum class TargetKind(val keyword: String) {
* them so that a setting a language does not have is a compile error in the project file.
*/
sealed interface LanguageMark {
+ /** C and Objective-C: languages whose standard is a C standard. */
sealed interface CStandardFamily : LanguageMark
+ /** C++ and Objective-C++: languages whose standard is a C++ standard. */
sealed interface CppStandardFamily : LanguageMark
+ /** Objective-C and Objective-C++: languages that can make an app bundle. */
sealed interface Objective : LanguageMark
+ /** The C language. */
interface C : CStandardFamily
+ /** The C++ language. */
interface Cpp : CppStandardFamily
+ /** The Objective-C language. */
interface ObjC : CStandardFamily, Objective
+ /** The Objective-C++ language. */
interface ObjCpp : CppStandardFamily, Objective
+ /** The Zig language. */
interface Zig : LanguageMark
}
@@ -57,14 +65,19 @@ sealed interface KindMark {
/** bin, sharedlib and test: the linker makes them. */
sealed interface Linked : KindMark
+ /** staticlib and sharedlib: the libraries. */
sealed interface Library : KindMark
+ /** A program. */
interface Bin : Runnable, Linked
+ /** A static library. */
interface StaticLib : Library
+ /** A shared library. */
interface SharedLib : Library, Linked
+ /** A test program. */
interface Test : Runnable, Linked
}
@@ -160,6 +173,7 @@ internal constructor(
val BUILD_MODE: BuildMode
get() = buildMode
+ /** Adds the source files [paths], relative to the package. */
fun sources(vararg paths: String) {
settings =
settings.copy(
@@ -167,6 +181,7 @@ internal constructor(
)
}
+ /** Adds the source files the [globs] match. */
fun sources(vararg globs: Glob) {
settings = settings.copy(sources = settings.sources + globs)
}
@@ -190,6 +205,7 @@ internal constructor(
)
}
+ /** Adds the files the [globs] match to the files copied beside the output. */
fun data(vararg globs: Glob) {
settings = settings.copy(data = settings.data + globs)
}
@@ -206,6 +222,7 @@ internal constructor(
class CcTargetScope<out L : LanguageMark, out K : KindMark>
internal constructor(triple: TargetTriple, buildMode: BuildMode) :
TargetScope<K>(triple, buildMode) {
+ /** Leaves the files [paths] out of the sources. */
fun exclude(vararg paths: String) {
settings =
settings.copy(
@@ -213,6 +230,7 @@ internal constructor(triple: TargetTriple, buildMode: BuildMode) :
)
}
+ /** Leaves the files the [globs] match out of the sources. */
fun exclude(vararg globs: Glob) {
settings = settings.copy(excludes = settings.excludes + globs)
}
@@ -244,6 +262,7 @@ internal constructor(triple: TargetTriple, buildMode: BuildMode) :
)
}
+ /** Adds the files the [globs] match to the textual headers. */
fun textualHeaders(vararg globs: Glob) {
settings = settings.copy(textualHeaders = settings.textualHeaders + globs)
}
@@ -343,6 +362,7 @@ internal constructor(triple: TargetTriple, buildMode: BuildMode) :
settings = settings.copy(strip = value)
}
+ /** Compiles and links the target with [sanitizers]. */
fun sanitize(vararg sanitizers: Sanitizer) {
settings = settings.copy(sanitizers = settings.sanitizers + sanitizers)
}
@@ -353,6 +373,7 @@ internal constructor(triple: TargetTriple, buildMode: BuildMode) :
settings.copy(links = settings.links + libraries.map { requireText(it, "a library") })
}
+ /** Passes [flags] to the linker as they are. */
fun linkFlags(vararg flags: String) {
settings = settings.copy(linkFlags = settings.linkFlags + flags)
}
@@ -376,6 +397,10 @@ internal constructor(triple: TargetTriple, buildMode: BuildMode) :
}
}
+/**
+ * The receiver of `bundle { }`: the bundle [identifier], its `Info.plist`, the identity it is
+ * signed with and its resources.
+ */
@TazelDsl
class BundleScope internal constructor() {
var identifier: String? = null
@@ -383,10 +408,12 @@ class BundleScope internal constructor() {
var codesignIdentity: String? = null
private val resources = mutableListOf<FileSelection>()
+ /** Adds the files [paths] to the resources of the bundle. */
fun resources(vararg paths: String) {
paths.forEach { resources += FilePath(requireRelativePath(it, "bundle resource")) }
}
+ /** Adds the files the [globs] match to the resources of the bundle. */
fun resources(vararg globs: Glob) {
resources += globs
}
diff --git a/sources/main/kotlin/com/progmasoft/tazel/dsl/Triple.kt b/sources/main/kotlin/com/progmasoft/tazel/dsl/Triple.kt
index d0a5d61..766373f 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/dsl/Triple.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/dsl/Triple.kt
@@ -9,6 +9,7 @@ package com.progmasoft.tazel.dsl
data class TargetTriple(val text: String, val os: Os, val arch: Arch) {
override fun toString(): String = text
+ /** Reads triples. */
companion object {
/** Reads [text]; a triple whose processor or system Tazel does not know is refused. */
fun parse(text: String): TargetTriple {
diff --git a/sources/main/kotlin/com/progmasoft/tazel/dsl/custom/lexer/CustomLexer.kt b/sources/main/kotlin/com/progmasoft/tazel/dsl/custom/lexer/CustomLexer.kt
index d3afd58..697762a 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/dsl/custom/lexer/CustomLexer.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/dsl/custom/lexer/CustomLexer.kt
@@ -127,6 +127,7 @@ class CustomLexer(
return Token(TokenKind.NAME, text.substring(begin, position), startLine, startColumn)
}
+ /** Every token of the text, in order; a character that starts no token is an error. */
fun tokens(): List<Token> = buildList {
while (position < text.length) {
val letter = text[position]
diff --git a/sources/main/kotlin/com/progmasoft/tazel/label/Label.kt b/sources/main/kotlin/com/progmasoft/tazel/label/Label.kt
index ac51664..b8f613d 100644
--- a/sources/main/kotlin/com/progmasoft/tazel/label/Label.kt
+++ b/sources/main/kotlin/com/progmasoft/tazel/label/Label.kt
@@ -19,6 +19,7 @@ data class PackageId(val repository: String?, val path: String) {
return if (path.isEmpty()) "$prefix//" else "$prefix//$path/"
}
+ /** The package every module has. */
companion object {
/** The root package of this module. */
val ROOT = PackageId(null, "")
diff --git a/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt b/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt
index 19e5060..87b9680 100644
--- a/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt
+++ b/sources/test/kotlin/com/progmasoft/tazel/cli/BuildCommandTest.kt
@@ -22,7 +22,7 @@ import kotlin.test.assertTrue
* Builds and runs a small module with the C compiler of this machine. Without Clang or GCC on PATH
* there is nothing to build with, and the tests return early.
*/
-class BuildCommandTest {
+internal class BuildCommandTest {
private val os = TargetTriple.host().os
private val programs = Programs(os)
private val compiler = programs.find("clang") ?: programs.find("gcc")
diff --git a/sources/test/kotlin/com/progmasoft/tazel/cli/CustomCommandsTest.kt b/sources/test/kotlin/com/progmasoft/tazel/cli/CustomCommandsTest.kt
index f6c6695..3b98840 100644
--- a/sources/test/kotlin/com/progmasoft/tazel/cli/CustomCommandsTest.kt
+++ b/sources/test/kotlin/com/progmasoft/tazel/cli/CustomCommandsTest.kt
@@ -18,7 +18,7 @@ import kotlin.test.assertContains
import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
-class CustomCommandsTest {
+internal class CustomCommandsTest {
private fun program(vararg arguments: String) =
CustomStep.Program(arguments.map(CustomArgument::Text))
diff --git a/sources/test/kotlin/com/progmasoft/tazel/cli/MainTest.kt b/sources/test/kotlin/com/progmasoft/tazel/cli/MainTest.kt
index 294db0e..87cc2e3 100644
--- a/sources/test/kotlin/com/progmasoft/tazel/cli/MainTest.kt
+++ b/sources/test/kotlin/com/progmasoft/tazel/cli/MainTest.kt
@@ -9,7 +9,7 @@ import kotlin.test.Test
import kotlin.test.assertEquals
import kotlin.test.assertTrue
-class MainTest {
+internal class MainTest {
@Test
fun versionPrintsTheVersion() {
val out = StringBuilder()
diff --git a/sources/test/kotlin/com/progmasoft/tazel/cli/SourceCommandTest.kt b/sources/test/kotlin/com/progmasoft/tazel/cli/SourceCommandTest.kt
index 8bd0e41..e5d6cd7 100644
--- a/sources/test/kotlin/com/progmasoft/tazel/cli/SourceCommandTest.kt
+++ b/sources/test/kotlin/com/progmasoft/tazel/cli/SourceCommandTest.kt
@@ -18,7 +18,7 @@ import kotlin.test.assertTrue
* Formats and lints a small module with the clang-format and clang-tidy of this machine. Without
* them the tests return early.
*/
-class SourceCommandTest {
+internal class SourceCommandTest {
private val os = TargetTriple.host().os
private val programs = Programs(os)
diff --git a/sources/test/kotlin/com/progmasoft/tazel/cli/TazelOptionsTest.kt b/sources/test/kotlin/com/progmasoft/tazel/cli/TazelOptionsTest.kt
index 64578c4..0724314 100644
--- a/sources/test/kotlin/com/progmasoft/tazel/cli/TazelOptionsTest.kt
+++ b/sources/test/kotlin/com/progmasoft/tazel/cli/TazelOptionsTest.kt
@@ -17,7 +17,7 @@ import kotlin.test.assertEquals
import kotlin.test.assertFailsWith
import kotlin.test.assertNotNull
-class TazelOptionsTest {
+internal class TazelOptionsTest {
private fun rejection(text: String) =
assertFailsWith<TazelOptionsException> { parseTazelOptions(text) }.message.orEmpty()
diff --git a/sources/test/kotlin/com/progmasoft/tazel/cli/TestCommandTest.kt b/sources/test/kotlin/com/progmasoft/tazel/cli/TestCommandTest.kt
index 373b53e..b3f9203 100644
--- a/sources/test/kotlin/com/progmasoft/tazel/cli/TestCommandTest.kt
+++ b/sources/test/kotlin/com/progmasoft/tazel/cli/TestCommandTest.kt
@@ -20,7 +20,7 @@ import kotlin.test.assertTrue
* Runs `tazel test` on C tests built with the compiler of this machine. Without Clang or GCC on
* PATH there is nothing to build with, and the tests return early.
*/
-class TestCommandTest {
+internal class TestCommandTest {
private val os = TargetTriple.host().os
private val programs = Programs(os)
private val compiler = programs.find("clang") ?: programs.find("gcc")
diff --git a/sources/test/kotlin/com/progmasoft/tazel/driver/DriverTest.kt b/sources/test/kotlin/com/progmasoft/tazel/driver/DriverTest.kt
index 46dad41..91a4a5b 100644
--- a/sources/test/kotlin/com/progmasoft/tazel/driver/DriverTest.kt
+++ b/sources/test/kotlin/com/progmasoft/tazel/driver/DriverTest.kt
@@ -18,7 +18,7 @@ import kotlin.test.assertFailsWith
import kotlin.test.assertFalse
import kotlin.test.assertTrue
-class DriverTest {
+internal class DriverTest {
@Test
fun depfilesAreReadWithTheirEscapes() {
val text = "obj/a.c.o: src/a.c include/a\\ b.h \\\n include/c.h \\\r\n /usr/include/stdio.h\n"
diff --git a/sources/test/kotlin/com/progmasoft/tazel/label/LabelTest.kt b/sources/test/kotlin/com/progmasoft/tazel/label/LabelTest.kt
index 378cd0b..f94f71c 100644
--- a/