Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save bijukunjummen/8181062de7be37cbc89c8738f6719ea4 to your computer and use it in GitHub Desktop.
Save bijukunjummen/8181062de7be37cbc89c8738f6719ea4 to your computer and use it in GitHub Desktop.
configurations {
invoker
}
dependencies {
...
invoker("com.google.cloud.functions.invoker:java-function-invoker:1.1.0")
...
}
tasks.register("runFunction", JavaExec) {
main = 'com.google.cloud.functions.invoker.runner.Invoker'
classpath(configurations.invoker)
inputs.files(configurations.runtimeClasspath, sourceSets.main.output)
args(
'--target', project.findProperty('run.functionTarget') ?: 'functions.HelloHttp',
'--port', project.findProperty('run.port') ?: 8080
)
doFirst {
args('--classpath', files(configurations.runtimeClasspath, sourceSets.main.output).asPath)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment