Skip to content

Commit

Permalink
Fix build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jaguililla committed Feb 1, 2020
1 parent dca8dfd commit 7bda1b0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 20 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -2,7 +2,8 @@
# Gradle
.gradle/
build/
local*
local_*
private_*

# Eclipse
.settings/
Expand Down
41 changes: 22 additions & 19 deletions build.gradle.kts
Expand Up @@ -64,9 +64,17 @@ tasks.register<JacocoReport>("jacocoReport") {

val rootPath = rootDir.absolutePath
val execPattern = "**/build/jacoco/test.exec"
val sourcePattern = "**/src/main/kotlin"
executionData.setFrom(fileTree(rootPath).include(execPattern))
sourceDirectories.setFrom(fileTree(rootPath).include(sourcePattern))

subprojects.forEach {
// try {
// println(it.tasks["build"].javaClass)
// }
// catch (e: Throwable) {
// e.printStackTrace()
// }
// sourceSets(it.sourceSets.main as SourceSet)
}

Expand All @@ -84,25 +92,20 @@ childProjects.forEach { pair ->
val empty = prj.getTasksByName("dokkaMd", false)?.isEmpty() ?: true
val siteContentPath = "${rootDir}/hexagon_site/content"

if (!(name in listOf("hexagon_benchmark", "hexagon_site", "hexagon_starters")) && empty) {
project(name) {
tasks.register<DokkaTask>("dokkaMd") {
outputFormat = "gfm"
outputDirectory = siteContentPath

configuration {
reportUndocumented = false
includes = filesCollection(prj.projectDir, "*.md")
samples = filesCollection(
"${prj.projectDir}/src/test/kotlin",
"**/*SamplesTest.kt"
)
sourceRoot { path = "$projectDir/src/main/kotlin" }
}

doLast {
addMetadata(siteContentPath, prj)
}
if (name !in listOf("hexagon_benchmark", "hexagon_site", "hexagon_starters") && empty) {
project(name).tasks.register<DokkaTask>("dokkaMd") {
outputFormat = "gfm"
outputDirectory = siteContentPath

configuration {
reportUndocumented = false
includes = filesCollection(prj.projectDir, "*.md")
samples = filesCollection("${prj.projectDir}/src/test/kotlin", "**/*SamplesTest.kt")
sourceRoot { path = "$projectDir/src/main/kotlin" }
}

doLast {
addMetadata(siteContentPath, prj)
}
}
}
Expand Down

0 comments on commit 7bda1b0

Please sign in to comment.