@@ -31,7 +31,6 @@ plugins {
3131 id ' jacoco'
3232 id ' opensearch.opensearchplugin'
3333 id ' com.diffplug.spotless'
34- id ' com.gradleup.shadow'
3534}
3635
3736apply plugin : ' opensearch.pluginzip'
@@ -227,57 +226,10 @@ testingConventions.enabled = false
227226// TODO: need to verify the thirdPartyAudit
228227// currently it complains missing classes like ibatis, mysql etc, should not be a problem
229228thirdPartyAudit. enabled = false
230- tasks. named(" publishShadowPublicationToMavenLocal" ) {
231- dependsOn tasks. named(" generatePomFileForNebulaPublication" )
232- }
233229apply plugin : ' com.netflix.nebula.ospackage'
234230validateNebulaPom. enabled = false
235- generatePomFileForShadowPublication. enabled = false
236- validateShadowPom. enabled = false
237- // generatePomFileForShadowPublication.enabled = false
238231// This is afterEvaluate because the bundlePlugin ZIP task is updated afterEvaluate and changes the ZIP name to match the plugin name
239232afterEvaluate {
240- tasks. named(" bundlePlugin" , Zip ). configure { zipTask ->
241- zipTask. doLast {
242- def zipFile = zipTask. archiveFile. get(). asFile
243- println " Original bundlePlugin ZIP: ${ zipFile.absolutePath} "
244-
245- // Create a temporary directory for processing
246- def tempDir = file(" $buildDir /tempBundle" )
247- delete(tempDir)
248- tempDir. mkdirs()
249-
250- // Extract the ZIP into the temporary directory
251- copy {
252- from zipTree(zipFile)
253- into tempDir
254- }
255- println " Extracted ZIP to: ${ tempDir.absolutePath} "
256-
257- // Determine the relocated jar produced by shadowJar.
258- def relocatedJar = shadowJar. archiveFile. get(). asFile
259- def jarName = relocatedJar. getName()
260- println " Relocated jar to keep: ${ jarName} "
261-
262- // Delete all jar files (files ending with .jar) that are not the relocated jar.
263- fileTree(dir : tempDir, includes : [' **/*.jar' ]). each { File jarFile ->
264- if (! jarFile. getName(). equals(jarName)) {
265- println " Deleting jar file: ${ jarFile.absolutePath} "
266- jarFile. delete()
267- }
268- }
269-
270- // Reassemble the ZIP using the remaining files
271- ant. zip(destfile : zipFile) {
272- fileset(dir : tempDir)
273- }
274- println " Final bundlePlugin ZIP updated: ${ zipFile.absolutePath} "
275-
276- // Clean up the temporary directory
277- delete(tempDir)
278- }
279- }
280-
281233 ospackage {
282234 packageName = " ${ rootProject.name} "
283235 release = isSnapshot ? " 0.1" : ' 1'
@@ -369,22 +321,3 @@ run {
369321 useCluster testClusters. integTest
370322}
371323
372- def compileOnlyResolveableFiles = project. configurations. getByName(CompileOnlyResolvePlugin . RESOLVEABLE_COMPILE_ONLY_CONFIGURATION_NAME ). files
373- shadowJar {
374- configurations = [project. configurations. runtimeClasspath]
375- exclude { details ->
376- def file = details. file
377- return compileOnlyResolveableFiles. contains(file)
378- }
379-
380- destinationDirectory = file(" ${ project.buildDir} /distributions" )
381- archiveClassifier. set(null )
382-
383- exclude ' META-INF/maven/com.google.guava/**'
384- exclude ' com/google/thirdparty/**'
385- exclude ' org/opensearch/jobscheduler/**'
386- exclude ' org/apache/lucene/**'
387-
388- relocate ' com.google.common' , ' shaded.com.google.common'
389- relocate ' org.joda.time' , ' shaded.org.joda.time'
390- }
0 commit comments