Running a function with Gradle & Kotlin (build.gradle.kts)
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Dokumentation
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Bereich
- documentation
Rechercherichtung
Beginne mit dem Gradle-Beispiel in der Dokumentation und vergleiche es mit der bereitgestellten build.gradle.kts-Konfiguration. Aktualisiere die Dokumentation, um die Kotlin DSL-Form und den Fallback für ein fehlendes runFunction.target aufzunehmen, und überprüfe anschließend, dass das Beispiel mit den angegebenen Kotlin- und Gradle-Versionen kompatibel ist.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
build.gradle.kts
val invoker by configurations.creating
dependencies {
implementation("com.google.cloud.functions:functions-framework-api:1.0.1")
invoker("com.google.cloud.functions.invoker:java-function-invoker:1.0.0-alpha-2-rc5")
}
task<JavaExec>("runFunction") {
main = "com.google.cloud.functions.invoker.runner.Invoker"
classpath(invoker)
inputs.files(configurations.runtimeClasspath, sourceSets["main"].output)
args(
"--target", project.findProperty("runFunction.target") ?: "",
"--port", project.findProperty("runFunction.port") ?: 8080
)
doFirst {
args("--classpath", files(configurations.runtimeClasspath, sourceSets["main"].output).asPath)
}
}
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 toIllegal null value provided in this collection: [--target, null, --port, 8080]`
- Vorherrschende Sprache
- Java
- Sterne
- 155
- Forks
- 64
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus GoogleCloudPlatform/functions-framework-java
-
enhancement P2
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 65/100
-
Incompatible conversion from Pub/Sub emulator to CloudEvent for `CloudEventsFunction`Evtl. wieder frei @taeold hat das vor 211 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement
GoogleCloudPlatform/functions-framework-java#375 · 1 Kommentar · 1 Reaktion · 1 zugewiesene Person ·
-
enhancement P2
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
GoogleCloudPlatform/functions-framework-java#372 · 1 Kommentar ·
-
Add support for auto-reload in run goal of function-maven-pluginEvtl. wieder frei @janell-chen hat das vor 999 Tagen übernommen, und es ist kein Pull Request offen. Offenenhancement P3
GoogleCloudPlatform/functions-framework-java#261 · 1 zugewiesene Person ·
-
How to run `google/fhir-data-pipes/pipelines/batch` uber JAR in Google Cloud Functions locally?OffenP3 question
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
GoogleCloudPlatform/functions-framework-java#254 · 1 Kommentar ·
Alle Issues in GoogleCloudPlatform/functions-framework-java
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 88/100
apache/arrow-java#1311 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
bug triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
security
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
IBM/networking-java-sdk#204 ·
-
bug Technical Debt
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
avniproject/avni-server#1080 ·