Skip to content

Commit

Permalink
Apply test dependencies (#177)
Browse files Browse the repository at this point in the history
* Update Gradle Metal to 0.4+

* Add test dependencies to testImplementation configuration

* Update Gradle Metal to 0.4
  • Loading branch information
pedrolamarao authored Nov 25, 2023
1 parent a636bdb commit e0ca57b
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 36 deletions.
7 changes: 1 addition & 6 deletions elf/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ group = "br.dev.pedrolamarao.metal.elf"

dependencies {
api(project(":psys"))
testImplementation(project(":googletest"))
}

metal {
compileOptions = listOf("-fasm-blocks","-g","-std=c++20","-Wno-unused-command-line-argument")

applications { test { targets = setOf("x86_64-pc-linux-gnu","x86_64-pc-windows-msvc") } }
ixx.main { public = true }
}

// TODO: enhance Gradle Metal with component-specific dependencies

dependencies {
implementation(project(":googletest"))
}
2 changes: 1 addition & 1 deletion gradle/plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ group = "br.dev.pedrolamarao.metal.plugins"

val elf = "1.0.0-SNAPSHOT"
val gdb = "1.0.0-SNAPSHOT"
val metal = "0.3"
val metal = "0.4"

kotlin.jvmToolchain {
languageVersion.set(JavaLanguageVersion.of(17))
Expand Down
8 changes: 4 additions & 4 deletions gradle/plugins/src/main/kotlin/metal-test.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ plugins {
id("br.dev.pedrolamarao.metal.cxx")
}

val linkExecutable = metal.applications.named("main").flatMap { it.linkTask }
val mainExecutable = metal.applications.named("main").flatMap { it.output }

val createImage = project.tasks.register<MultibootCreateImageTask>("make-main-image") {
dependsOn(linkExecutable)
inputFile = linkExecutable.flatMap { it.output }
dependsOn("link-main")
inputFile = mainExecutable
}

tasks.register("image") {
Expand All @@ -17,7 +17,7 @@ tasks.register("image") {

val testImage = project.tasks.register<MultibootTestImageTask>("test-main-image") {
imageFile = createImage.flatMap { it.outputFile }
executableFile = linkExecutable.flatMap { it.output }
executableFile = mainExecutable
}

tasks.test {
Expand Down
7 changes: 1 addition & 6 deletions multiboot2/foo/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,12 @@ plugins {

dependencies {
api(project(":psys"))
testImplementation(project(":googletest"))
}

metal {
compileOptions = listOf("-fasm-blocks","-g","-std=c++20","-Wno-unused-command-line-argument")

applications { test { targets = setOf("x86_64-pc-linux-gnu","x86_64-pc-windows-msvc") } }
ixx { main { public = true } }
}

// TODO: enhance Gradle Metal with component-specific dependencies

dependencies {
implementation(project(":googletest"))
}
7 changes: 1 addition & 6 deletions pc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,12 @@ group = "br.dev.pedrolamarao.metal.pc"

dependencies {
api(project(":psys"))
testImplementation(project(":googletest"))
}

metal {
compileOptions = listOf("-fasm-blocks","-g","-std=c++20","-Wno-unused-command-line-argument")

applications { test { targets = setOf("x86_64-pc-linux-gnu","x86_64-pc-windows-msvc") } }
ixx { main { public = true } }
}

// TODO: enhance Gradle Metal with component-specific dependencies

dependencies {
implementation(project(":googletest"))
}
10 changes: 4 additions & 6 deletions psys/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,13 @@ plugins {

group = "br.dev.pedrolamarao.metal.psys"

dependencies {
testImplementation(project(":googletest"))
}

metal {
compileOptions = listOf("-fasm-blocks","-g","-std=c++20")

applications { test { targets = setOf("x86_64-pc-linux-gnu","x86_64-pc-windows-msvc") } }
ixx { main { public = true } }
}

// TODO: enhance Gradle Metal with component-specific dependencies

dependencies {
implementation(project(":googletest"))
}
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id.startsWith("br.dev.pedrolamarao.metal.")) {
useModule("br.dev.pedrolamarao.gradle.metal:plugins:0.3")
useModule("br.dev.pedrolamarao.gradle.metal:plugins:0.4")
}
}
}
Expand Down
7 changes: 1 addition & 6 deletions x86/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ group = "br.dev.pedrolamarao.metal.x86"

dependencies {
api(project(":psys"))
testImplementation(project(":googletest"))
}

metal {
Expand All @@ -30,10 +31,4 @@ tasks.named<MetalCompileTask>("compile-main-cxx") {
"x86_64-pc-linux-gnu",
"x86_64-pc-windows-msvc" -> include("x86_64/*")
}
}

// TODO: enhance Gradle Metal with component-specific dependencies

dependencies {
implementation(project(":googletest"))
}

0 comments on commit e0ca57b

Please sign in to comment.