Skip to content
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

build: Add Gradle task to assemble module build harness #5137

Merged
merged 3 commits into from
Sep 10, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions build-logic/src/main/kotlin/terasology-metrics.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,28 @@ tasks.withType<Test> {
}
}

tasks.withType<Checkstyle> {
dependsOn(tasks.getByPath(":extractConfig"))
}
tasks.withType<Checkstyle> {
//FIXME: This is a workaround for module harness builds, where the config
// files are part of the harness but the task is not defined.
if (rootProject.name == "Terasology") {
dependsOn(tasks.getByPath(":extractConfig"))
}
}

tasks.withType<Pmd> {
dependsOn(tasks.getByPath(":extractConfig"))
//FIXME: This is a workaround for module harness builds, where the config
// files are part of the harness but the task is not defined.
if (rootProject.name == "Terasology") {
dependsOn(tasks.getByPath(":extractConfig"))
}
}

tasks.withType<SpotBugsTask> {
dependsOn(tasks.getByPath(":extractConfig"))
//FIXME: This is a workaround for module harness builds, where the config
// files are part of the harness but the task is not defined.
if (rootProject.name == "Terasology") {
dependsOn(tasks.getByPath(":extractConfig"))
}
}

// The config files here work in both a multi-project workspace (IDEs, running from source) and for solo module builds
Expand Down
51 changes: 51 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,54 @@
cleanIdea.doLast {
new File('Terasology.iws').delete()
}

// A task to assemble various files into a single zip for distribution as 'build-harness.zip' for module builds
task assembleBuildHarness(type: Zip) {
description 'Assembles a zip of files useful for module development'

dependsOn extractNatives
from('natives'){
include '**/*'
// TODO: use output of extractNatives?

Check warning on line 293 in build.gradle

View check run for this annotation

Terasology Jenkins.io / Open Tasks Scanner

TODO

NORMAL: use output of extractNatives?
// TODO: which module needs natives to build?

Check warning on line 294 in build.gradle

View check run for this annotation

Terasology Jenkins.io / Open Tasks Scanner

TODO

NORMAL: which module needs natives to build?
into 'natives'
}

dependsOn extractConfig
from('config'){
//include 'gradle/**/*', 'metrics/**/*'
include '**/*'
// TODO: depend on output of extractConfig?

Check warning on line 302 in build.gradle

View check run for this annotation

Terasology Jenkins.io / Open Tasks Scanner

TODO

NORMAL: depend on output of extractConfig?
into 'config'
}

from('gradle'){
include '**/*' // include all files in 'gradle'
// TODO: exclude groovy jar?

Check warning on line 308 in build.gradle

View check run for this annotation

Terasology Jenkins.io / Open Tasks Scanner

TODO

NORMAL: exclude groovy jar?
into 'gradle'
}

from('build-logic'){
include 'src/**', '*.kts'
into 'build-logic'
}

from('templates') {
include 'build.gradle'
}

from('.') {
include 'gradlew'
}

// include file 'templates/module.logback-test.xml' as 'src/test/resources/logback-test.xml'
from('templates'){
include 'module.logback-test.xml'
rename 'module.logback-test.xml', 'logback-test.xml'
into 'src/test/resources'
}

// set the archive name
archiveFileName.set('build-harness.zip')
}

skaldarnar marked this conversation as resolved.
Show resolved Hide resolved
Loading