Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Shadow jar publication to lang-painless module. #2681

Merged
merged 4 commits into from
Apr 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions modules/lang-painless/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@
*/

import org.opensearch.gradle.testclusters.DefaultTestClustersTask;
import com.github.jengelman.gradle.plugins.shadow.ShadowBasePlugin

apply plugin: 'opensearch.validate-rest-spec'
apply plugin: 'opensearch.yaml-rest-test'
apply plugin: 'com.github.johnrengelman.shadow'

opensearchplugin {
description 'An easy, safe and fast scripting language for OpenSearch'
Expand All @@ -46,14 +49,39 @@ testClusters.all {

dependencies {
api 'org.antlr:antlr4-runtime:4.9.3'
api 'org.ow2.asm:asm-util:9.2'
api 'org.ow2.asm:asm-tree:9.2'
api 'org.ow2.asm:asm-commons:9.2'
api 'org.ow2.asm:asm-analysis:7.2'
api 'org.ow2.asm:asm:9.2'
implementation 'org.ow2.asm:asm-util:9.2'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any chance someone was relying on this dependency and using through lang-painless module?

#### implementation

Dependencies that are used by the project at compile and runtime but are not exposed as a compile dependency to other dependent projects. Dependencies added to the `implementation` configuration are considered an implementation detail that can be changed at a later date without affecting any dependent projects.

#### api

Dependencies that are used as compile and runtime dependencies of a project and are considered part of the external api of the project.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its possible, will revisit this if performing our own shadowing is the right path fwd, I'm not convinced thats the case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've changed these back to api, but I don't think this will make a difference because we are rewriting the package namespace.

implementation 'org.ow2.asm:asm-tree:9.2'
implementation 'org.ow2.asm:asm-commons:9.2'
implementation 'org.ow2.asm:asm-analysis:9.2'
implementation 'org.ow2.asm:asm:9.2'
api project('spi')
}

test {
doFirst {
test.classpath -= project.files(project.tasks.named('shadowJar'))
test.classpath -= project.configurations.getByName(ShadowBasePlugin.CONFIGURATION_NAME)
test.classpath += project.extensions.getByType(SourceSetContainer).getByName(SourceSet.MAIN_SOURCE_SET_NAME).runtimeClasspath
}
systemProperty 'tests.security.manager', 'false'
}

shadowJar {
classifier = null
relocate 'org.objectweb', 'org.opensearch.repackage.org.objectweb'
dependencies {
include(dependency('org.ow2.asm:asm:9.2'))
include(dependency('org.ow2.asm:asm-util:9.2'))
include(dependency('org.ow2.asm:asm-tree:9.2'))
include(dependency('org.ow2.asm:asm-commons:9.2'))
include(dependency('org.ow2.asm:asm-analysis:9.2'))
include(dependency('org.ow2.asm:asm:9.2'))
}
}

tasks.validateNebulaPom.dependsOn tasks.generatePomFileForShadowPublication
tasks.validateShadowPom.dependsOn tasks.generatePomFileForNebulaPublication

tasks.named("dependencyLicenses").configure {
mapping from: /asm-.*/, to: 'asm'
}
Expand Down
1 change: 0 additions & 1 deletion modules/lang-painless/licenses/asm-analysis-7.2.jar.sha1

This file was deleted.

1 change: 1 addition & 0 deletions modules/lang-painless/licenses/asm-analysis-9.2.jar.sha1
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
7487dd756daf96cab9986e44b9d7bcb796a61c10