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

Apply test dependencies #177

Merged
merged 3 commits into from
Nov 25, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
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"))
}
Loading