Skip to content

Commit

Permalink
Fix build-tools-internal integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Nov 14, 2023
1 parent a84b999 commit ece6ee8
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
id 'elasticsearch.java'
id 'elasticsearch.publish'
}
version = "1.0"
group = 'org.acme'
description = "custom project description"
Expand Down Expand Up @@ -92,11 +92,11 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
id 'elasticsearch.publish'
id 'com.github.johnrengelman.shadow'
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.slf4j:log4j-over-slf4j:1.7.30'
shadow 'org.slf4j:slf4j-api:1.7.30'
Expand All @@ -110,8 +110,8 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
}
}
version = "1.0"
group = 'org.acme'
description = 'some description'
group = 'org.acme'
description = 'some description'
"""

when:
Expand Down Expand Up @@ -179,7 +179,7 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
}
dependencies {
shadow project(":someLib")
shadow project(":someLib")
}
publishing {
repositories {
Expand All @@ -192,10 +192,10 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
allprojects {
apply plugin: 'elasticsearch.java'
version = "1.0"
group = 'org.acme'
group = 'org.acme'
}
description = 'some description'
description = 'some description'
"""

when:
Expand Down Expand Up @@ -263,31 +263,31 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
id 'elasticsearch.publish'
id 'com.github.johnrengelman.shadow'
}
esplugin {
name = 'hello-world-plugin'
classname 'org.acme.HelloWorldPlugin'
description = "custom project description"
}
publishing {
repositories {
maven {
url = "\$buildDir/repo"
}
}
}
// requires elasticsearch artifact available
tasks.named('bundlePlugin').configure { enabled = false }
licenseFile.set(file('license.txt'))
noticeFile.set(file('notice.txt'))
version = "1.0"
group = 'org.acme'
group = 'org.acme'
"""

when:
def result = gradleRunner('assemble', '--stacktrace').build()
def result = gradleRunner('assemble', '--stacktrace', '-x', 'generateHistoricalFeaturesMetadata').build()

then:
result.task(":generatePom").outcome == TaskOutcome.SUCCESS
Expand Down Expand Up @@ -348,19 +348,19 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
id 'elasticsearch.internal-es-plugin'
id 'elasticsearch.publish'
}
esplugin {
name = 'hello-world-plugin'
classname 'org.acme.HelloWorldPlugin'
description = "custom project description"
}
// requires elasticsearch artifact available
tasks.named('bundlePlugin').configure { enabled = false }
licenseFile.set(file('license.txt'))
noticeFile.set(file('notice.txt'))
version = "2.0"
group = 'org.acme'
group = 'org.acme'
"""

when:
Expand Down Expand Up @@ -420,9 +420,9 @@ class PublishPluginFuncTest extends AbstractGradleFuncTest {
apply plugin:'elasticsearch.publish'
version = "1.0"
group = 'org.acme'
group = 'org.acme'
description = "just a test project"
ext.projectLicenses.set(['The Apache Software License, Version 2.0': 'http://www.apache.org/licenses/LICENSE-2.0'])
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.elasticsearch.gradle.internal.conventions.util.Util;
import org.elasticsearch.gradle.internal.info.BuildParams;
import org.elasticsearch.gradle.internal.precommit.JarHellPrecommitPlugin;
import org.elasticsearch.gradle.internal.test.HistoricalFeaturesMetadataPlugin;
import org.elasticsearch.gradle.plugin.PluginBuildPlugin;
import org.elasticsearch.gradle.plugin.PluginPropertiesExtension;
import org.elasticsearch.gradle.testclusters.ElasticsearchCluster;
Expand All @@ -36,6 +37,7 @@ public void apply(Project project) {
project.getPluginManager().apply(PluginBuildPlugin.class);
project.getPluginManager().apply(JarHellPrecommitPlugin.class);
project.getPluginManager().apply(ElasticsearchJavaPlugin.class);
project.getPluginManager().apply(HistoricalFeaturesMetadataPlugin.class);
// Clear default dependencies added by public PluginBuildPlugin as we add our
// own project dependencies for internal builds
// TODO remove once we removed default dependencies from PluginBuildPlugin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
import org.elasticsearch.gradle.VersionProperties;
import org.elasticsearch.gradle.internal.conventions.util.Util;
import org.elasticsearch.gradle.internal.info.BuildParams;
import org.elasticsearch.gradle.internal.test.HistoricalFeaturesMetadataPlugin;
import org.gradle.api.Action;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
Expand Down Expand Up @@ -45,7 +44,6 @@ public void apply(Project project) {
project.getPluginManager().apply(ElasticsearchJavaBasePlugin.class);
project.getPluginManager().apply(JavaLibraryPlugin.class);
project.getPluginManager().apply(ElasticsearchJavaModulePathPlugin.class);
project.getPluginManager().apply(HistoricalFeaturesMetadataPlugin.class);

// configureConfigurations(project);
configureJars(project);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ public class HistoricalFeaturesMetadataPlugin implements Plugin<Project> {

@Override
public void apply(Project project) {
project.getPluginManager().apply(CompileOnlyResolvePlugin.class);

Configuration featureMetadataExtractorConfig = project.getConfigurations().create("featuresMetadataExtractor", c -> {
// Don't bother adding this dependency if the project doesn't exist which simplifies testing
if (project.findProject(":test:metadata-extractor") != null) {
Expand Down

0 comments on commit ece6ee8

Please sign in to comment.