Running a function with Gradle & Kotlin (build.gradle.kts)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Tài liệu
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu từ ví dụ Gradle trong tài liệu và so sánh với cấu hình build.gradle.kts được cung cấp. Cập nhật tài liệu để bao gồm dạng Kotlin DSL và fallback khi thiếu runFunction.target, sau đó xác minh rằng ví dụ tương thích với các phiên bản Kotlin và Gradle đã nêu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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]`
- Ngôn ngữ chính
- Java
- Star
- 154
- Fork
- 63
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của GoogleCloudPlatform/functions-framework-java
-
enhancement P2
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 65/100
-
enhancement
GoogleCloudPlatform/functions-framework-java#375 · 1 bình luận · 1 reaction · 1 người được giao ·
-
enhancement P2
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 30/100
GoogleCloudPlatform/functions-framework-java#372 · 1 bình luận ·
-
enhancement P3
GoogleCloudPlatform/functions-framework-java#261 · 1 người được giao ·
-
How to run `google/fhir-data-pipes/pipelines/batch` uber JAR in Google Cloud Functions locally? Đang mởP3 question
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
GoogleCloudPlatform/functions-framework-java#254 · 1 bình luận ·
Tất cả issue của GoogleCloudPlatform/functions-framework-java
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
elastic/gradle-plugins#157 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
cryptomator/hub#497 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
johanhaleby/occurrent#1120 ·