gemini-code-assist[bot] commented on code in PR #38874:
URL: https://github.com/apache/beam/pull/38874#discussion_r3382773705


##########
sdks/python/build.gradle:
##########
@@ -101,16 +101,32 @@ tasks.register("generateManagedIOPage") {
   }
 }
 
+tasks.register("prepareExpansionServicesForYamlDocs") {
+  description "Builds all expansion services referenced in 
apache_beam/yaml/*.*"
+
+  dependsOn ":sdks:java:extensions:schemaio-expansion-service:shadowJar"
+  dependsOn ":sdks:java:extensions:sql:expansion-service:shadowJar"
+  dependsOn ":sdks:java:io:expansion-service:shadowJar"
+  dependsOn ":sdks:java:io:google-cloud-platform:expansion-service:shadowJar"
+
+  doLast {
+    // Copy expansion service jar into cache path (.apache_beam/cache/jars/).
+    copy {
+      from ":sdks:java:extensions:schemaio-expansion-service:shadowJar"
+      from ":sdks:java:extensions:sql:expansion-service:shadowJar"
+      from ":sdks:java:io:expansion-service:shadowJar"
+      from ":sdks:java:io:google-cloud-platform:expansion-service:shadowJar"
+      into "${System.getProperty('user.home')}/.apache_beam/cache/jars/"
+    }

Review Comment:
   ![high](https://www.gstatic.com/codereviewagent/high-priority.svg)
   
   In Gradle, passing a task path string (e.g., 
`":sdks:java:extensions:schemaio-expansion-service:shadowJar"`) to the `from` 
method of a `copy` block does not resolve to the task's output files. Instead, 
Gradle treats it as a relative file path string, which will result in no files 
being copied. To resolve this, use `project.tasks.findByPath(...)` to obtain 
the actual task reference so Gradle can correctly resolve and copy its output 
files.
   
   ```
       copy {
         from 
project.tasks.findByPath(":sdks:java:extensions:schemaio-expansion-service:shadowJar")
         from 
project.tasks.findByPath(":sdks:java:extensions:sql:expansion-service:shadowJar")
         from 
project.tasks.findByPath(":sdks:java:io:expansion-service:shadowJar")
         from 
project.tasks.findByPath(":sdks:java:io:google-cloud-platform:expansion-service:shadowJar")
         into "${System.getProperty('user.home')}/.apache_beam/cache/jars/"
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to