gh-yzou commented on code in PR #1991:
URL: https://github.com/apache/polaris/pull/1991#discussion_r2180983046


##########
plugins/spark/v3.5/spark-bundle/build.gradle.kts:
##########
@@ -0,0 +1,71 @@
+/*
+ * 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("polaris-client")
+  id("com.gradleup.shadow")
+}
+
+// get version information
+val sparkMajorVersion = "3.5"
+val scalaVersion = getAndUseScalaVersionForProject()
+val icebergVersion = pluginlibs.versions.iceberg.get()
+val spark35Version = pluginlibs.versions.spark35.get()
+
+val scalaLibraryVersion =
+  if (scalaVersion == "2.12") {
+    pluginlibs.versions.scala212.get()
+  } else {
+    pluginlibs.versions.scala213.get()
+  }
+
+dependencies { 
implementation(project(":polaris-spark-${sparkMajorVersion}_${scalaVersion}")) }
+
+tasks.named<ShadowJar>("shadowJar") {
+  archiveClassifier = null
+  isZip64 = true
+
+  // pack all the dependencies into an uber jar
+  configurations = listOf(project.configurations.runtimeClasspath.get())
+
+  // recursively remove all LICENSE and NOTICE file under META-INF, includes
+  // directories contains 'license' in the name
+  exclude("META-INF/**/*LICENSE*")
+  exclude("META-INF/**/*NOTICE*")
+  // exclude the top level LICENSE, LICENSE-*.txt and NOTICE
+  exclude("LICENSE*")
+  exclude("NOTICE*")
+
+  // add polaris customized LICENSE and NOTICE for the bundle jar at top 
level. Note that the
+  // customized LICENSE and NOTICE file are called BUNDLE-LICENSE and 
BUNDLE-NOTICE,
+  // and renamed to LICENSE and NOTICE after include, this is to avoid the file
+  // being excluded due to the exclude pattern matching used above.

Review Comment:
   Yeah, I need to make sure the original file name doesn't match any of the 
matching rules to avoid being excluded, the rename actually happens after the 
excluding. I have verified manually, the LICENSE and NOTICE is the only one I 
see at top level, and they are the right one



-- 
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: issues-unsubscr...@polaris.apache.org

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

Reply via email to