Skip to content

Commit

Permalink
chore: regenerate stdlib docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lars-reimann committed Jun 7, 2022
1 parent e9a55e6 commit 7d95524
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 1,517 deletions.
12 changes: 10 additions & 2 deletions DSL/de.unibonn.simpleml/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ val koverExcludes = listOf(
)

tasks {
build {
dependsOn(project.tasks.named("generateStdlibDocumentation"))
}

compileJava {
dependsOn(rootProject.tasks.named("generateXtextLanguage"))
}
Expand Down Expand Up @@ -122,10 +126,14 @@ tasks.register<JavaExec>("generateStdlibDocumentation") {
group = "documentation"
description = "Generate documentation for the standard library."

val inputDirectory = project.file("src/main/resources/stdlib")
val outputDirectory = rootProject.file("../docs/Stdlib/API").absolutePath

inputs.dir(inputDirectory)
outputs.dirs(outputDirectory)

dependsOn(sourceSets.main.get().runtimeClasspath)
classpath = sourceSets.main.get().runtimeClasspath.filter { it.exists() }
mainClass.set("de.unibonn.simpleml.stdlibDocumentation.MainKt")

val outputDirectory = rootProject.file("../docs/Stdlib/API").absolutePath
args = listOf(outputDirectory)
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ private val autogenWarning = """
* @param outputDirectory Where to place the created files.
*/
fun EObject.generateDocumentation(outputDirectory: Path) {
outputDirectory.toFile().deleteRecursively()
outputDirectory.createDirectories()

val packagesToDeclarations: Map<String, List<EObject>> = allGlobalDeclarations()
Expand Down Expand Up @@ -110,7 +111,7 @@ private fun createPackageDocumentation(

appendLine("# Package `$packageName`")

appendLine("$prefix")
appendLine(prefix)

// Table of contents
if (annotations.isNotEmpty() || classes.isNotEmpty() || enums.isNotEmpty() || globalFunctions.isNotEmpty()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package tests.unresolvedNamespace

// semantic_error "No declaration with qualified name 'simpleml.models.Model' exists."
import »simpleml.models.Model«
// no_semantic_error "No declaration with qualified name 'simpleml.model.Model' exists."
import »simpleml.model.Model«
// semantic_error "No declaration with qualified name 'simpleml.langs.Any' exists."
import »simpleml.langs.Any«
// no_semantic_error "No declaration with qualified name 'simpleml.lang.Any' exists."
import »simpleml.lang.Any«
// no_semantic_error "No declaration with qualified name 'tests.unresolvedNamespace.C' exists."
import »tests.unresolvedNamespace.C«

// semantic_error "No package with qualified name 'simpleml.models' exists."
import »simpleml.models.*«
// semantic_error "No package with qualified name 'simpleml.langs' exists."
import »simpleml.langs.*«
// no_semantic_error "No package with qualified name 'simpleml.model' exists."
import »simpleml.model.*«
import »simpleml.lang.*«

class C
55 changes: 0 additions & 55 deletions docs/Stdlib/API/simpleml_collections.md

This file was deleted.

Loading

0 comments on commit 7d95524

Please sign in to comment.