phanikumv commented on code in PR #69444:
URL: https://github.com/apache/airflow/pull/69444#discussion_r3534186374


##########
java-sdk/build.gradle.kts:
##########
@@ -0,0 +1,120 @@
+/*
+ * 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 org.gradle.process.CommandLineArgumentProvider
+
+plugins {
+    id("io.github.gradle-nexus.publish-plugin") version "2.0.0"
+}
+
+val projectVersion: String by project
+
+group = "org.apache.airflow"
+version = projectVersion
+
+if (!project.hasProperty("mavenUrl")) {
+    nexusPublishing {
+        repositories {
+            create("apache") {
+                
nexusUrl.set(uri("https://repository.apache.org/service/local/";))
+                snapshotRepositoryUrl.set(
+                    
uri("https://repository.apache.org/content/repositories/snapshots/";),
+                )
+                username.set(
+                    providers.gradleProperty("mavenUsername")
+                        
.orElse(providers.environmentVariable("ASF_NEXUS_USERNAME")),
+                )
+                password.set(
+                    providers.gradleProperty("mavenPassword")
+                        
.orElse(providers.environmentVariable("ASF_NEXUS_PASSWORD")),
+                )
+            }
+        }
+    }
+}
+
+val sourceReleaseDir = layout.buildDirectory.dir("distributions")
+val sourceReleaseTarball = sourceReleaseDir.map { 
it.file("apache-airflow-java-sdk-$version-src.tar.gz") }
+
+val sourceTarball by tasks.registering(Exec::class) {
+    group = "release"
+    description = "Assembles the source tarball from committed java-sdk 
sources."
+    executable = "git"
+    workingDir = rootDir
+
+    // Capture early to keep compatibility to the Gradle configuration cache.
+    val gitRef = providers.gradleProperty("gitRef").getOrNull()
+    val archiveVersion = version.toString()
+    val tarball = sourceReleaseTarball.get().asFile
+
+    argumentProviders.add(
+        CommandLineArgumentProvider {
+            if (gitRef == null) throw GradleException("sourceRelease requires 
-PgitRef=<tag>")
+            listOf(
+                "archive",
+                "--format=tar.gz",
+                "--prefix=apache-airflow-java-sdk-$archiveVersion/",
+                "-o", tarball.absolutePath,
+                gitRef,

Review Comment:
   Heads-up (non-blocking): the source tarball will include 
`gradle/wrapper/gradle-wrapper.jar`. It's Apache-2.0 and commonly shipped, so 
no objection — just flagging in case you'd rather `export-ignore` it so an RC 
checker doesn't ping it in the vote.



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