sarutak commented on a change in pull request #33121:
URL: https://github.com/apache/spark/pull/33121#discussion_r660276243



##########
File path: project/SparkBuild.scala
##########
@@ -802,11 +802,30 @@ object Hive {
 }
 
 object YARN {
+  val genConfigProperties = TaskKey[Unit]("gen-config-properties",
+    "Generate config.properties which contains a setting whether Hadoop is 
provided or not")
+  val propFileName = "config.properties"
+  val hadoopProvidedProp = "spark.yarn.isHadoopProvided"
+
   lazy val settings = Seq(
     excludeDependencies --= Seq(
       ExclusionRule(organization = "com.sun.jersey"),
       ExclusionRule("javax.servlet", "javax.servlet-api"),
-      ExclusionRule("javax.ws.rs", "jsr311-api"))
+      ExclusionRule("javax.ws.rs", "jsr311-api")),
+    Compile / unmanagedResources :=
+      (Compile / 
unmanagedResources).value.filter(!_.getName.endsWith(s"$propFileName")),
+    genConfigProperties := {
+      val file = (Compile / classDirectory).value / 
s"org/apache/spark/deploy/yarn/$propFileName"
+      val isHadoopProvided = 
SbtPomKeys.effectivePom.value.getProperties.get(hadoopProvidedProp)
+      IO.write(file, s"$hadoopProvidedProp = $isHadoopProvided")
+    },
+    (Compile / copyResources) := (Def.taskDyn {
+      val c = (Compile / copyResources).value
+        Def.task {

Review comment:
       Ah, still mis-intended. I'll fix it.




-- 
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: reviews-unsubscr...@spark.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to