You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for putting all this together! I was trying to get the local invoker working on my local machine, which is setup using kotlin (1.3.72) and gradle (6.4.1) via the build.gradle.kts file.
The Gradle example in the documentation uses a format that doesn't seem compatible with the build.gradle.kts file, so I'm hoping sharing that particular configuration helps people set up their project.
Apart from the particular formatting for the .kts version, I did have to add one thing:
I had to add the elvis operator ?: "" for ``--target, otherwise you cannot build the project due to Illegal null value provided in this collection: [--target, null, --port, 8080]`
The text was updated successfully, but these errors were encountered:
@jasperroel
Hey there,
Where is val invoker by configurations.creating coming from? I can't resolve the example of yours because I have no idea what invoker is.
Did you add the implementation line that imports the dependencies? implementation("com.google.cloud.functions:functions-framework-api:1.0.1") (or even 1.0.4, I see there have been some updates since then).
This worked fine for me, too without specifying a new configuration. One only needs a configuration with resolve=false:
dependencies {
implementation(Libs.gfun)
compileOnly(Libs.gfunInvoker) // for running the function locally
}
tasks.register<JavaExec>("runFunction") {
main ="com.google.cloud.functions.invoker.runner.Invoker"
classpath(configurations.compileOnly)
inputs.files(configurations.runtimeClasspath.get(), sourceSets.main.get().output)
args(
"--target", "<My Target class>",
"--port", 8080// hard-coded port
)
doFirst {
args("--classpath", files(configurations.runtimeClasspath.get(), sourceSets.main.get().output).asPath)
}
}
where Libs.gfun is "com.google.cloud.functions:functions-framework-api:1.0.4" or the latest version
and Libs.gfunInvoker is "com.google.cloud.functions.invoker:java-function-invoker:1.0.2" or the latest version
Thanks for putting all this together! I was trying to get the local invoker working on my local machine, which is setup using kotlin (
1.3.72
) and gradle (6.4.1
) via thebuild.gradle.kts
file.The Gradle example in the documentation uses a format that doesn't seem compatible with the
build.gradle.kts
file, so I'm hoping sharing that particular configuration helps people set up their project.build.gradle.kts
Apart from the particular formatting for the
.kts
version, I did have to add one thing:?: ""
for ``--target, otherwise you cannot build the project due to
Illegal null value provided in this collection: [--target, null, --port, 8080]`The text was updated successfully, but these errors were encountered: