Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ee7acf3
add task skeleton
jdconrad Apr 27, 2025
619fd63
generate file for test dependencies
jdconrad Apr 28, 2025
1de3d1d
fix policy file
jdconrad Apr 28, 2025
9841168
update
jdconrad Apr 29, 2025
a69872e
convert to json file isntead of properties file
jdconrad Apr 29, 2025
73af578
fix dependency link
jdconrad May 1, 2025
40cc22f
start of jar entry lookup
jdconrad May 4, 2025
06522bd
Merge remote-tracking branch 'upstream/main' into eut2
jdconrad May 4, 2025
65c7d72
generate file with class to module info
jdconrad May 4, 2025
a9984fe
add module info to build info file
jdconrad May 5, 2025
445d3bf
added files to resources
jdconrad May 5, 2025
2c1a15f
protect task for plugins with no source
jdconrad May 5, 2025
73e6379
separate into separate plugin
jdconrad May 6, 2025
036fed8
add output for server
jdconrad May 6, 2025
fdf526e
remove todo
jdconrad May 6, 2025
7d7f8cd
Merge branch 'main' into eut2
jdconrad May 6, 2025
5f4c870
clean up
jdconrad May 7, 2025
729559b
add module info for directory
jdconrad May 7, 2025
9867a39
add module inference when plugin is not modular
jdconrad May 7, 2025
c4764b9
Merge branch 'main' into eut2
jdconrad May 7, 2025
ff80fda
Merge branch 'main' into eut2
jdconrad May 7, 2025
f6585fc
[CI] Auto commit changes from spotless
May 7, 2025
927f9bf
Merge branch 'main' into eut2
jdconrad May 8, 2025
32cadde
Merge branch 'main' into eut2
jdconrad May 8, 2025
887e600
add comments
jdconrad May 8, 2025
9949f91
Merge remote-tracking branch 'upstream/main' into eut2
prdoyle May 13, 2025
e57cd37
First pass addressing PR comments
prdoyle May 13, 2025
444da3d
WIP non-working TestBuildInfoPluginFuncTest
prdoyle May 13, 2025
dd56d50
TestBuildInfoPluginFuncTest
prdoyle May 13, 2025
854df10
Tweaks
prdoyle May 14, 2025
931deb9
TestBuildInfoPluginFuncTest check the file's contents
prdoyle May 14, 2025
461af45
Merge branch 'main' into eut2
jdconrad May 20, 2025
33ce238
Use Files.walkFileTree
prdoyle May 21, 2025
460ea40
some response to pr comments
jdconrad May 21, 2025
8833e6e
Merge remote-tracking branch 'origin/eut2' into eut2
jdconrad May 21, 2025
1266847
update gradle values to use callable
jdconrad May 21, 2025
a38969c
Split out extractModuleNameFromJar into smaller steps
prdoyle May 21, 2025
0df276a
fix test
jdconrad May 21, 2025
69742cf
Merge remote-tracking branch 'origin/eut2' into eut2
jdconrad May 21, 2025
1d1c27d
Merge branch 'main' into eut2
jdconrad May 21, 2025
75496f4
remove extraneous callable
jdconrad May 21, 2025
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
4 changes: 4 additions & 0 deletions build-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ gradlePlugin {
id = 'elasticsearch.stable-esplugin'
implementationClass = 'org.elasticsearch.gradle.plugin.StablePluginBuildPlugin'
}
testBuildInfo {
id = 'elasticsearch.test-build-info'
implementationClass = 'org.elasticsearch.gradle.test.TestBuildInfoPlugin'
}
javaRestTest {
id = 'elasticsearch.java-rest-test'
implementationClass = 'org.elasticsearch.gradle.test.JavaRestTestPlugin'
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
package org.elasticsearch.gradle.test

import com.fasterxml.jackson.databind.ObjectMapper

import org.elasticsearch.gradle.fixtures.AbstractGradleFuncTest
import org.gradle.testkit.runner.TaskOutcome

class TestBuildInfoPluginFuncTest extends AbstractGradleFuncTest {
def "works"() {
given:
file("src/main/java/com/example/Example.java") << """
package com.example;

public class Example {
}
"""

file("src/main/java/module-info.java") << """
module com.example {
exports com.example;
}
"""

buildFile << """
import org.elasticsearch.gradle.plugin.GenerateTestBuildInfoTask;

plugins {
id 'java'
id 'elasticsearch.test-build-info'
}

repositories {
mavenCentral()
}

tasks.withType(GenerateTestBuildInfoTask.class) {
componentName = 'example-component'
outputFile = new File('build/generated-build-info/plugin-test-build-info.json')
}
"""

when:
def result = gradleRunner('generateTestBuildInfo').build()
def task = result.task(":generateTestBuildInfo")


then:
task.outcome == TaskOutcome.SUCCESS

def output = file("build/generated-build-info/plugin-test-build-info.json")
output.exists() == true

def location = Map.of(
"module", "com.example",
"representative_class", "com/example/Example.class"
)
def expectedOutput = Map.of(
"component", "example-component",
"locations", List.of(location)
)
new ObjectMapper().readValue(output, Map.class) == expectedOutput
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,10 @@ private TaskProvider<Zip> createBundleTasks(final Project project, PluginPropert
task.getIsLicensed().set(providerFactory.provider(extension::isLicensed));

var mainSourceSet = project.getExtensions().getByType(SourceSetContainer.class).getByName(SourceSet.MAIN_SOURCE_SET_NAME);
FileCollection moduleInfoFile = mainSourceSet.getOutput().getAsFileTree().matching(p -> p.include("module-info.class"));
FileCollection moduleInfoFile = mainSourceSet.getOutput()
.getClassesDirs()
.getAsFileTree()
.matching(p -> p.include("module-info.class"));
task.getModuleInfoFile().setFrom(moduleInfoFile);

});
Expand Down
Loading