Assembler sources #577
pedrolamarao
started this conversation in
General
Replies: 2 comments 4 replies
-
This is our current solution: import dev.nokee.platform.cpp.CppLibrary
import dev.nokee.platform.nativebase.StaticLibraryBinary
import dev.nokee.platform.nativebase.tasks.internal.CreateStaticLibraryTask
plugins { base }
abstract class AsmExtension
{
abstract val source : ConfigurableFileCollection;
}
val asm = project.extensions.create<AsmExtension>("asm")
project.extensions.configure<CppLibrary> {
binaries.configureEach {
if (this is StaticLibraryBinary) {
val createTask = createTask.get()
if (createTask is CreateStaticLibraryTask) {
asm.source.asFileTree.forEach { asmSource ->
val asmTask = project.tasks.register<Assemble>("asm-${name}-${asmSource.hashCode()}") {
assemblerArgs = emptyList()
objectFileDir = file("${buildDir}/asm/main")
source(asmSource)
targetPlatform.set(createTask.targetPlatform)
toolChain.set(createTask.toolChain)
}
createTask.source(asmTask.get().outputs.files.asFileTree)
}
createTask.doLast { createTask.source.files.forEach { logger.lifecycle("${name}: ${it}") } }
}
}
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
-
Kotlin script support with code completion in the IDE helps a lot |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is perhaps someone else trying to add assembler sources to a Nokee project?
Gradle has an old
assembler
plugin which addsasm
source sets and does whatever it does.I am studying Nokee to try and contribute a new plugin but am advancing very slowly.
Beta Was this translation helpful? Give feedback.
All reactions