-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Use directory name as project name for libs #115720
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
Conversation
The libs projects are configured to all begin with `elasticsearch-`. While this is desireable for the artifacts to contain this consistent prefix, it means the project names don't match up with their directories. Additionally, it creates complexities for subproject naming that must be manually adjusted. This commit adjusts the project names for those under libs to be their directory names. The resulting artifacts for these libs are kept the same, all beginning with `elasticsearch-`.
|
Pinging @elastic/es-delivery (Team:Delivery) |
| } | ||
| c.getOutputs().doNotCacheIf("BWC distribution caching is disabled for local builds", task -> BuildParams.isCi() == false); | ||
| c.getArgs().add(projectPath.replace('/', ':') + ":" + assembleTaskName); | ||
| c.getArgs().add("-p"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using the directory name (which hasn't changed) this allows for bwc builds to run, even though this change has not yet been backported.
|
|
||
| testImplementation(project(":test:framework")) { | ||
| exclude group: 'org.elasticsearch', module: 'elasticsearch-core' | ||
| exclude group: 'org.elasticsearch', module: 'core' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the gradle "module name" matter? This PR produces the same artifact ids, though the "name" attribute in the pom is different. Is there a way to control this module name in gradle? I could only find archivesName which we set as the artifactId.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "name" is purely descriptive so I think it's fine if they are different. So long as the artifactId is the same we won't have to deal with updating dependencies.
name: Projects tend to have conversational names, beyond the artifactId. The Sun engineers did not refer to their project as "java-1.5", but rather just called it "Tiger". Here is where to set that value.
| ':server:generatePluginsList', | ||
| ':generateProviderImpls', | ||
| ':libs:elasticsearch-native:elasticsearch-native-libraries:extractLibs', | ||
| ':libs:native:libraries:extractLibs', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why has elasticsearch-native-libraries becomes simply libraries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's just the local project name. Before we manually changed it to elasticsearch-native-libraries in settings.gradle. Now the artifact remains the same (set recursively in libs/build.gradle), but the local name is simplified.
libs/build.gradle
Outdated
| } | ||
|
|
||
| if (project.name == 'log4j') { | ||
| return |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just wrap the last bit in a conditional. These conditionals that rely on returns are very easy to get removed, or other logic being added below that should apply, but doesn't.
libs/build.gradle
Outdated
| apply plugin: 'base' | ||
|
|
||
| def baseProject = project | ||
| def baseName = "elasticsearch-${it.name}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The term "base name" doesn't really make sense here anymore. Can we call this artifactId instead? I think that describes what where' trying to influence here.
libs/build.gradle
Outdated
| archivesName = baseName | ||
| } | ||
| subprojects { | ||
| plugins.withType(JavaPlugin).whenPluginAdded { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not gonna lie, I struggle to follow what we're trying to do here. Can we at least add some clarifying comments here to convey not just what we're doing, but why this is necessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added comments for the entire section explaining what we are doing.
|
@mark-vieira I believe this is all working now and I've addressed your comments. |
mark-vieira
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
💔 Backport failed
You can use sqren/backport to manually backport by running |
The libs projects are configured to all begin with `elasticsearch-`. While this is desireable for the artifacts to contain this consistent prefix, it means the project names don't match up with their directories. Additionally, it creates complexities for subproject naming that must be manually adjusted. This commit adjusts the project names for those under libs to be their directory names. The resulting artifacts for these libs are kept the same, all beginning with `elasticsearch-`.
* Use directory name as project name for libs (#115720) The libs projects are configured to all begin with `elasticsearch-`. While this is desireable for the artifacts to contain this consistent prefix, it means the project names don't match up with their directories. Additionally, it creates complexities for subproject naming that must be manually adjusted. This commit adjusts the project names for those under libs to be their directory names. The resulting artifacts for these libs are kept the same, all beginning with `elasticsearch-`. * fixes
The libs projects are configured to all begin with `elasticsearch-`. While this is desireable for the artifacts to contain this consistent prefix, it means the project names don't match up with their directories. Additionally, it creates complexities for subproject naming that must be manually adjusted. This commit adjusts the project names for those under libs to be their directory names. The resulting artifacts for these libs are kept the same, all beginning with `elasticsearch-`.
The libs projects are configured to all begin with
elasticsearch-. While this is desireable for the artifacts to contain this consistent prefix, it means the project names don't match up with their directories. Additionally, it creates complexities for subproject naming that must be manually adjusted.This commit adjusts the project names for those under libs to be their directory names. The resulting artifacts for these libs are kept the same, all beginning with
elasticsearch-.