Skip to content

Commit 112de1b

Browse files
committed
Rework dependencies declaration for repository-s3
1 parent 124285f commit 112de1b

File tree

3 files changed

+68
-42
lines changed

3 files changed

+68
-42
lines changed

build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/InternalClusterTestPlugin.java

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ public void apply(Project project) {
2929
project.getPluginManager().apply(JavaPlugin.class);
3030
project.getPluginManager().apply(JvmTestSuitePlugin.class);
3131
TestingExtension testing = project.getExtensions().getByType(TestingExtension.class);
32+
3233
testing.getSuites().register(SOURCE_SET_NAME, JvmTestSuite.class, suite -> {
3334
suite.useJUnit();
3435
suite.getDependencies().getImplementation().add(suite.getDependencies().project());

build-tools/src/main/java/org/elasticsearch/gradle/util/GradleUtils.java

+1
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ public static boolean isModuleProject(String projectPath) {
196196
}
197197

198198
public static void disableTransitiveDependencies(Configuration config) {
199+
System.out.println("config = " + config);
199200
config.getDependencies().configureEach(dep -> {
200201
if (dep instanceof ModuleDependency
201202
&& dep instanceof ProjectDependency == false

modules/repository-s3/build.gradle

+66-42
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,15 @@
66
* your election, the "Elastic License 2.0", the "GNU Affero General Public
77
* License v3.0 only", or the "Server Side Public License, v 1".
88
*/
9-
import org.apache.tools.ant.filters.ReplaceTokens
10-
import org.elasticsearch.gradle.internal.test.InternalClusterTestPlugin
9+
org.elasticsearch.gradle.internal.test.rest.RestTestSuite
1110

1211
apply plugin: 'elasticsearch.internal-yaml-rest-test'
1312
apply plugin: 'elasticsearch.internal-cluster-test'
1413
apply plugin: 'elasticsearch.internal-java-rest-test'
1514

1615
esplugin {
1716
description = 'The S3 repository plugin adds S3 repositories'
18-
classname ='org.elasticsearch.repositories.s3.S3RepositoryPlugin'
17+
classname = 'org.elasticsearch.repositories.s3.S3RepositoryPlugin'
1918
}
2019

2120
dependencies {
@@ -39,31 +38,53 @@ dependencies {
3938
api 'javax.xml.bind:jaxb-api:2.2.2'
4039

4140
testImplementation project(':test:fixtures:s3-fixture')
41+
}
42+
43+
tasks.named('check') {
44+
dependsOn tasks.withType(Test)
45+
}
46+
4247

43-
internalClusterTestImplementation project(':test:fixtures:minio-fixture')
44-
internalClusterTestRuntimeOnly "org.slf4j:slf4j-simple:${versions.slf4j}"
45-
46-
yamlRestTestImplementation project(':modules:repository-s3')
47-
yamlRestTestImplementation project(':test:fixtures:aws-fixture-utils')
48-
yamlRestTestImplementation project(':test:fixtures:s3-fixture')
49-
yamlRestTestImplementation project(':test:fixtures:testcontainer-utils')
50-
yamlRestTestImplementation project(':test:framework')
51-
yamlRestTestRuntimeOnly "org.slf4j:slf4j-simple:${versions.slf4j}"
52-
53-
javaRestTestImplementation project(':modules:repository-s3')
54-
javaRestTestImplementation project(':test:fixtures:aws-fixture-utils')
55-
javaRestTestImplementation project(':test:fixtures:aws-sts-fixture')
56-
javaRestTestImplementation project(':test:fixtures:ec2-imds-fixture')
57-
javaRestTestImplementation project(':test:fixtures:minio-fixture')
58-
javaRestTestImplementation project(':test:fixtures:s3-fixture')
59-
javaRestTestImplementation project(':test:fixtures:testcontainer-utils')
60-
javaRestTestImplementation project(':test:framework')
61-
javaRestTestRuntimeOnly "org.slf4j:slf4j-simple:${versions.slf4j}"
48+
testing {
49+
suites {
50+
internalClusterTest {
51+
dependencies {
52+
implementation project(':test:fixtures:minio-fixture')
53+
}
54+
}
55+
javaRestTest {
56+
dependencies {
57+
implementation project()
58+
implementation project(':test:fixtures:aws-fixture-utils')
59+
implementation project(':test:fixtures:s3-fixture')
60+
implementation project(':test:fixtures:testcontainer-utils')
61+
implementation project(':test:fixtures:aws-sts-fixture')
62+
implementation project(':test:fixtures:ec2-imds-fixture')
63+
implementation project(':test:fixtures:minio-fixture')
64+
implementation project(':test:fixtures:testcontainer-utils')
65+
}
66+
}
67+
yamlRestTest {
68+
dependencies {
69+
implementation project()
70+
implementation project(':test:fixtures:aws-fixture-utils')
71+
implementation project(':test:fixtures:s3-fixture')
72+
implementation project(':test:fixtures:testcontainer-utils')
73+
}
74+
}
75+
configureEach {
76+
dependencies {
77+
implementation project(':test:framework')
78+
implementation project(':test:fixtures:s3-fixture')
79+
runtimeOnly "org.slf4j:slf4j-simple:${versions.slf4j}"
80+
}
81+
}
82+
}
6283
}
6384

6485
restResources {
6586
restApi {
66-
include '_common', 'cluster', 'nodes', 'snapshot','indices', 'index', 'bulk', 'count'
87+
include '_common', 'cluster', 'nodes', 'snapshot', 'indices', 'index', 'bulk', 'count'
6788
}
6889
}
6990

@@ -75,33 +96,36 @@ tasks.named("dependencyLicenses").configure {
7596
}
7697

7798
esplugin.bundleSpec.from('config/repository-s3') {
78-
into 'config'
99+
into 'config'
79100
}
80101

81102
tasks.named("internalClusterTest").configure {
82103
// TODO: remove once https://github.com/elastic/elasticsearch/issues/101608 is fixed
83104
systemProperty 'es.insecure_network_trace_enabled', 'true'
84105
}
85106

107+
86108
tasks.named("thirdPartyAudit").configure {
87109
ignoreMissingClasses(
88-
// classes are missing
89-
'javax.servlet.ServletContextEvent',
90-
'javax.servlet.ServletContextListener',
91-
'org.apache.avalon.framework.logger.Logger',
92-
'org.apache.log.Hierarchy',
93-
'org.apache.log.Logger',
94-
'javax.jms.Message',
95-
// We don't use the kms dependency
96-
'com.amazonaws.services.kms.AWSKMS',
97-
'com.amazonaws.services.kms.AWSKMSClient',
98-
'com.amazonaws.services.kms.AWSKMSClientBuilder',
99-
'com.amazonaws.services.kms.model.DecryptRequest',
100-
'com.amazonaws.services.kms.model.DecryptResult',
101-
'com.amazonaws.services.kms.model.EncryptRequest',
102-
'com.amazonaws.services.kms.model.EncryptResult',
103-
'com.amazonaws.services.kms.model.GenerateDataKeyRequest',
104-
'com.amazonaws.services.kms.model.GenerateDataKeyResult',
105-
'javax.activation.DataHandler'
110+
// classes are missing
111+
'javax.servlet.ServletContextEvent',
112+
'javax.servlet.ServletContextListener',
113+
'org.apache.avalon.framework.logger.Logger',
114+
'org.apache.log.Hierarchy',
115+
'org.apache.log.Logger',
116+
'javax.jms.Message',
117+
// We don't use the kms dependency
118+
'com.amazonaws.services.kms.AWSKMS',
119+
'com.amazonaws.services.kms.AWSKMSClient',
120+
'com.amazonaws.services.kms.AWSKMSClientBuilder',
121+
'com.amazonaws.services.kms.model.DecryptRequest',
122+
'com.amazonaws.services.kms.model.DecryptResult',
123+
'com.amazonaws.services.kms.model.EncryptRequest',
124+
'com.amazonaws.services.kms.model.EncryptResult',
125+
'com.amazonaws.services.kms.model.GenerateDataKeyRequest',
126+
'com.amazonaws.services.kms.model.GenerateDataKeyResult',
127+
'javax.activation.DataHandler'
106128
)
107129
}
130+
131+

0 commit comments

Comments
 (0)