Abacn commented on code in PR #26023:
URL: https://github.com/apache/beam/pull/26023#discussion_r1185503222


##########
transform-service/controller/build.gradle:
##########
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * License); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an AS IS BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
+
+plugins {
+    id 'org.apache.beam.module'
+    id 'com.github.johnrengelman.shadow'
+}
+
+apply plugin: 'org.apache.beam.module'
+applyJavaNature(
+        automaticModuleName: 'org.apache.beam.transformservice.controller',
+)
+
+applyDockerNature()
+applyGoNature()
+
+description = "Apache Beam :: Transform Service :: Controller"
+
+configurations {
+    dockerDependency
+}
+
+dependencies {
+    dockerDependency project(path: ":transform-service:controller", 
configuration: "shadow")
+    implementation project(path: ":model:pipeline", configuration: "shadow")
+    implementation project(path: ":model:job-management", configuration: 
"shadow")
+    implementation project(path: ":sdks:java:core", configuration: "shadow")
+    implementation project(path: ":runners:core-construction-java")
+    implementation project(path: ":sdks:java:fn-execution")
+    implementation library.java.vendored_grpc_1_54_0
+    implementation library.java.vendored_guava_26_0_jre
+    implementation library.java.jackson_annotations
+    implementation library.java.jackson_databind
+    implementation library.java.jackson_dataformat_yaml
+    testImplementation library.java.junit
+    testImplementation library.java.mockito_core
+    testImplementation project(path: ":runners:java-fn-execution")
+}
+
+goBuild {
+    goTargets = '*.go' // only build the immediate directory.
+    outputLocation = './build/target/launcher/${GOOS}_${GOARCH}/boot'
+}
+
+task copyDockerfileDependencies(type: Copy) {
+    from configurations.dockerDependency
+    rename 'beam-transform-service-controller-.*.jar', 
'beam-transform-service-controller.jar'
+    setDuplicatesStrategy(DuplicatesStrategy.INCLUDE)
+    into "build/target"
+}
+
+task copyConfigFile(type: Copy) {
+    from "transform_service_config.yml"
+    into "build/target"
+}
+
+docker {
+    name containerImageName(
+            name: project.docker_image_default_repo_prefix + 
"transform_service_controller",
+            root: project.rootProject.hasProperty(["docker-repository-root"]) ?
+                    project.rootProject["docker-repository-root"] :
+                    project.docker_image_default_repo_root,
+            tag: project.rootProject.hasProperty(["docker-tag"]) ?
+                    project.rootProject["docker-tag"] : project.sdk_version)
+    // tags used by dockerTag task
+    tags containerImageTags()
+    files "./build"
+}
+
+dockerPrepare.dependsOn goBuild
+dockerPrepare.dependsOn copyConfigFile
+dockerPrepare.dependsOn copyDockerfileDependencies
+
+if (project.rootProject.hasProperty(["docker-pull-licenses"])) {
+    def copyGolangLicenses = tasks.register("copyGolangLicenses", Copy) {
+        from "${project(':release:go-licenses:py').buildDir}/output"
+        into "build/target/go-licenses"
+        dependsOn ':release:go-licenses:py:createLicenses'
+    }
+    dockerPrepare.dependsOn copyGolangLicenses
+} else {
+    def skipPullLicenses = tasks.register("skipPullLicenses", Exec) {
+        executable "sh"
+        // Touch a dummy file to ensure the directory exists.
+        args "-c", "mkdir -p build/target/go-licenses && touch 
build/target/go-licenses/skip"
+    }
+    dockerPrepare.dependsOn skipPullLicenses
+}
+
+task pushAll {
+    dependsOn ":sdks:java:expansion-service:container:dockerPush"

Review Comment:
   can just be
   
   dependsOn ":sdks:java:transform-service:controller-container:dockerPush" -> 
dependsOn dockerPush
   
   since they are in same project
   
   same for `sdks/java/expansion-service/container/build.gradle`



-- 
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