emilymye commented on a change in pull request #13211:
URL: https://github.com/apache/beam/pull/13211#discussion_r521899254



##########
File path: sdks/java/container/java11/build.gradle
##########
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+
+plugins {
+    id 'base'
+    id 'org.apache.beam.module'
+}
+
+project.ext {
+    imageJavaVersion = '11'

Review comment:
       I don't think apply from supports this (I think? gradle documentation is 
confusing but it seems like it's not supported via 
https://docs.gradle.org/current/dsl/org.gradle.api.Project.html#org.gradle.api.Project:apply(java.util.Map))
 but I tried to make this slightly cleaner so these files literally only holds 
the parameters before applying the script

##########
File path: sdks/java/container/common.gradle
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+applyDockerNature()
+
+def imageJavaVersion = project.hasProperty('imageJavaVersion') ? 
project.findProperty('imageJavaVersion').replace("java", "") : '8'

Review comment:
       done

##########
File path: sdks/java/container/common.gradle
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+applyDockerNature()
+
+def imageJavaVersion = project.hasProperty('imageJavaVersion') ? 
project.findProperty('imageJavaVersion').replace("java", "") : '8'
+
+description = "Apache Beam :: SDKs :: Python :: Container :: Java 
${imageJavaVersion} Container"
+
+configurations {
+    dockerDependency
+    sdkHarnessLauncher
+    pulledLicenses
+}
+
+dependencies {
+    pulledLicenses project(path: ":sdks:java:container", configuration: 
"pulledLicenses")
+    dockerDependency project(path: ":sdks:java:container", configuration: 
"dockerDependency")
+    sdkHarnessLauncher project(path: ":sdks:java:container", configuration: 
"sdkHarnessLauncher")
+}
+
+task copyDockerfileDependencies(type: Copy) {
+    from configurations.dockerDependency
+    rename "slf4j-api.*", "slf4j-api.jar"
+    rename "slf4j-jdk14.*", "slf4j-jdk14.jar"
+    rename 'beam-sdks-java-harness-.*.jar', 'beam-sdks-java-harness.jar'
+    rename 'beam-sdks-java-io-kafka.*.jar', 'beam-sdks-java-io-kafka.jar'
+    rename 'kafka-clients.*.jar', 'kafka-clients.jar'
+    into "build/target"
+}
+
+task copySdkHarnessLauncher(type: Copy) {
+    from configurations.sdkHarnessLauncher
+    into "build/target"
+}
+
+task copyPulledLicenses(type: Copy) {
+    from configurations.pulledLicenses
+    into "build/target"
+}
+
+task copyGolangLicenses(type: Copy) {
+    from "${project(':release:go-licenses:java').buildDir}/output"
+    into "build/target/go-licenses"
+    dependsOn ':release:go-licenses:java:createLicenses'
+}
+
+task skipPullLicenses(type: Exec) {
+    executable "sh"
+    args "-c", "mkdir -p build/target/third_party_licenses && touch 
build/target/third_party_licenses/skip"
+}
+
+docker {
+    name containerImageName(
+            name: 
"${project.docker_image_default_repo_prefix}java${imageJavaVersion}_sdk",

Review comment:
       If I adapted it to applyDockerNature I'd probably do it in a different 
PR since I'll be potentially affecting all the other containers

##########
File path: sdks/java/container/common.gradle
##########
@@ -0,0 +1,93 @@
+/*
+ * 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.
+ */
+
+applyDockerNature()
+
+def imageJavaVersion = project.hasProperty('imageJavaVersion') ? 
project.findProperty('imageJavaVersion').replace("java", "") : '8'
+
+description = "Apache Beam :: SDKs :: Python :: Container :: Java 
${imageJavaVersion} Container"

Review comment:
       I kind of like the safety that we only have to supply this description 
path in one place




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to