Skip to content

Commit e9db5c0

Browse files
committed
Fix POM files so that they don't include test fixtures dependencies
Also, ready the gradle files for Gradle 8 by removing deprecated usages, and clean up the `.gitignore` to exclude the `gen` directory properly
1 parent 5703a97 commit e9db5c0

File tree

7 files changed

+27
-13
lines changed

7 files changed

+27
-13
lines changed

.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ atlassian-ide-plugin.xml
6060
protogen/
6161
/protogen/
6262
*/protogen/*
63-
*/gen/*
63+
**/gen/*
6464

6565
*.orig
6666
/.classpath*

build.gradle

+4-4
Original file line numberDiff line numberDiff line change
@@ -128,17 +128,17 @@ allprojects {
128128
task sourcesJar(type: Jar, dependsOn: 'compileJava') {
129129
description = "Assembles a Jar archive containing the main sources."
130130
group = JavaBasePlugin.DOCUMENTATION_GROUP
131-
appendix = null
132-
classifier = "sources"
131+
archiveAppendix = null
132+
archiveClassifier = "sources"
133133
from sourceSets.main.allSource
134134
}
135135

136136
// Create the Javadoc jar
137137
task javadocJar(type: Jar) {
138138
description = "Assembles a Jar archive containing the main Javadoc."
139139
group = JavaBasePlugin.DOCUMENTATION_GROUP
140-
appendix = null
141-
classifier = "javadoc"
140+
archiveAppendix = null
141+
archiveClassifier = "javadoc"
142142
from tasks.javadoc
143143
}
144144

fdb-record-layer-core-shaded/fdb-record-layer-core-shaded.gradle

+5-4
Original file line numberDiff line numberDiff line change
@@ -48,17 +48,17 @@ createDistribution {dependsOn('shadowJar')}
4848
task shadedSourcesJar(type: Jar) {
4949
description = "Assembles a Jar archive containing the main sources."
5050
group = JavaBasePlugin.DOCUMENTATION_GROUP
51-
setArchiveAppendix(null)
52-
setArchiveClassifier("sources")
51+
archiveAppendix = null
52+
archiveClassifier = "sources"
5353
from project(coreProject).sourceSets.main.allSource
5454
from project(':fdb-extensions').sourceSets.main.allSource
5555
}
5656

5757
task shadedJavadocJar(type: Jar) {
5858
description = "Assembles a Jar archive containing the main Javadoc."
5959
group = JavaBasePlugin.DOCUMENTATION_GROUP
60-
appendix = null
61-
classifier = "javadoc"
60+
archiveAppendix = null
61+
archiveClassifier = "javadoc"
6262
from project(coreProject).tasks.javadoc
6363
}
6464

@@ -80,6 +80,7 @@ def addDependencies(projectObj, dependenciesNode) {
8080
}
8181

8282
apply from: rootProject.file('gradle/publishing.gradle')
83+
8384
publishing {
8485
publications.remove(publishing.publications.library)
8586

fdb-record-layer-core/fdb-record-layer-core.gradle

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ sourceSets {
6565
}
6666

6767
task testShadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
68-
classifier = 'standalone-tests'
68+
archiveClassifier = 'standalone-tests'
6969
from sourceSets.main.output
7070
from sourceSets.test.output
7171
configurations = [ project.configurations.testRuntimeOnly ]
@@ -79,7 +79,7 @@ task testShadowJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.Shadow
7979
}
8080

8181
task replJar(type: com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar) {
82-
classifier = 'repl'
82+
archiveClassifier = 'repl'
8383
from sourceSets.main.output
8484
from sourceSets.test.output
8585
configurations = [ project.configurations.repl ]

fdb-relational-api/fdb-relational-api.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ dependencies {
6464
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
6565

6666
testFixturesImplementation "org.assertj:assertj-core:${assertjVersion}"
67-
testFixturesImplementation "com.google.protobuf:protobuf-java:${protobufVersion}"
6867
}
6968

7069
sourceSets {

gradle/publishing.gradle

+14
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,20 @@ publishing {
5656
publications {
5757
library(MavenPublication) { publication ->
5858
from components.java
59+
60+
// Test fixtures appear to be placing their dependencies in the wrong scope
61+
// for maven compilation, which means that their dependencies wing up in the
62+
// final project's pom.xml.
63+
// See: https://github.com/gradle/gradle/issues/14936
64+
// Until this is fixed, skip these configurations to avoid polluting the list of dependencies
65+
configurations.each { config ->
66+
if (config.name == 'testFixturesApiElements' || config.name == 'testFixturesRuntimeElements') {
67+
components.java.withVariantsFromConfiguration(config) {
68+
skip()
69+
}
70+
}
71+
}
72+
5973
artifact tasks.sourcesJar
6074
artifact tasks.javadocJar
6175
artifact tasks.testJar

gradle/testing.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ tasks.withType(Test).configureEach { task ->
234234
task testJar(type: Jar, dependsOn: testClasses) {
235235
group = 'Build'
236236
description = 'Build a jar file of test classes as an exported artifact'
237-
classifier='test'
237+
archiveClassifier = 'test'
238238
from sourceSets.test.output
239239
}
240240

0 commit comments

Comments
 (0)