Slackbot
10/06/2022, 2:42 AMephemient
10/06/2022, 2:45 AM@Inject constructor()Caleb Cushing
10/06/2022, 2:46 AM@InjectCaleb Cushing
10/06/2022, 2:47 AMChris Lee
10/06/2022, 2:50 AMabstract class GenerateFederatedGraphqlSchema : Exec() {ephemient
10/06/2022, 2:50 AMgraphql in register()? if you're not taking any parameters then there shouldn't be any givenChris Lee
10/06/2022, 2:51 AMephemient
10/06/2022, 2:51 AMregistering which derives the name automaticallyCaleb Cushing
10/06/2022, 2:51 AMCaleb Cushing
10/06/2022, 2:52 AM@Inject that I did 😉 it just tells me it should beCaleb Cushing
10/06/2022, 2:52 AMChris Lee
10/06/2022, 2:54 AMChris Lee
10/06/2022, 2:54 AMinternal abstract class GenerateJarProperties : DefaultTask() {Caleb Cushing
10/06/2022, 2:57 AMCaleb Cushing
10/06/2022, 2:58 AMChris Lee
10/06/2022, 2:58 AMconstructor()Caleb Cushing
10/06/2022, 2:58 AMCaleb Cushing
10/06/2022, 2:58 AMChris Lee
10/06/2022, 2:59 AMCaleb Cushing
10/06/2022, 2:59 AMCaleb Cushing
10/06/2022, 2:59 AM@Inject constructor() and then it says inject should be on the constructorCaleb Cushing
10/06/2022, 2:59 AMephemient
10/06/2022, 3:00 AMephemient
10/06/2022, 3:01 AMexec and file implicitly capture them from build script scope, which the compiler handles by adding hidden parametersChris Lee
10/06/2022, 3:02 AMephemient
10/06/2022, 3:02 AM@Inject constructor()):
@TaskAction
fun action() {
workingDir = project.file("../../")
project.exec {
commandLine = mutableListOf("yarn", "generate:graphql")
}
project.exec {
commandLine = mutableListOf("yarn", "prettier", "--write", outputSchema.get().asFile.path)
}
}ephemient
10/06/2022, 3:03 AMChris Lee
10/06/2022, 3:03 AMabstract class GenerateFederatedGraphqlSchema : DefaultTask {
@get:Inject
protected abstract val execOps : ExecOperations
@get:Inject
protected abstract val layout : ProjectLayout
@get:SkipWhenEmpty
@get:InputFiles
@get:PathSensitive(PathSensitivity.RELATIVE)
abstract val sourceFiles: ConfigurableFileCollection
@get:OutputFile
abstract val outputSchema: RegularFileProperty
@TaskAction
fun action() {
workingDir = layout.projectDirectory.file("../../")
execOps.exec {
commandLine = mutableListOf("yarn", "generate:graphql")
}
execOps.exec {
commandLine = mutableListOf("yarn", "prettier", "--write", outputSchema.get().asFile.path)
}
}
}ephemient
10/06/2022, 3:04 AMChris Lee
10/06/2022, 3:05 AMfile in a custom task…Caleb Cushing
10/06/2022, 3:10 AMCaleb Cushing
10/06/2022, 3:53 AM