Skip to content

Commit bb39299

Browse files
committed
fix: exclude demo modules from javadoc and publishing configuration
1 parent 3dc12d6 commit bb39299

File tree

2 files changed

+49
-52
lines changed

2 files changed

+49
-52
lines changed

build.gradle

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,6 @@ apply from: "spotless.gradle"
2121

2222
subprojects {
2323
apply from: "$rootDir/gradle/build-conventions.gradle"
24-
25-
// Skip Javadoc for demo modules
26-
if (project.path.startsWith(':demos:')) {
27-
tasks.withType(Javadoc) {
28-
onlyIf { false }
29-
}
30-
tasks.matching { it.name == 'javadocJar' }.configureEach {
31-
onlyIf { false }
32-
}
33-
}
3424
}
3525

3626
tasks.register('aggregateTestReport', TestReport) {

gradle/build-conventions.gradle

Lines changed: 49 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,12 @@ java {
88
}
99
sourceCompatibility = JavaVersion.VERSION_17
1010
targetCompatibility = JavaVersion.VERSION_17
11-
withJavadocJar()
12-
withSourcesJar()
11+
12+
// Only generate javadoc and sources JARs for non-demo modules
13+
if (!project.path.startsWith(':demos:')) {
14+
withJavadocJar()
15+
withSourcesJar()
16+
}
1317
}
1418

1519
test {
@@ -36,58 +40,61 @@ dependencies {
3640
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
3741
}
3842

39-
publishing {
40-
publications {
41-
mavenJava(MavenPublication) {
42-
from components.java
43-
groupId = project.group
44-
artifactId = project.name
45-
version = project.version
46-
description = project.description
43+
// Only configure publishing for non-demo modules
44+
if (!project.path.startsWith(':demos:')) {
45+
publishing {
46+
publications {
47+
mavenJava(MavenPublication) {
48+
from components.java
49+
groupId = project.group
50+
artifactId = project.name
51+
version = project.version
52+
description = project.description
4753

48-
versionMapping {
49-
usage('java-api') {
50-
fromResolutionOf('runtimeClasspath')
51-
}
52-
usage('java-runtime') {
53-
fromResolutionResult()
54+
versionMapping {
55+
usage('java-api') {
56+
fromResolutionOf('runtimeClasspath')
57+
}
58+
usage('java-runtime') {
59+
fromResolutionResult()
60+
}
5461
}
55-
}
5662

57-
pom {
58-
packaging = 'jar'
59-
name = project.name
60-
description = project.description
61-
url = "https://github.com/redis/redis-om-spring"
62-
inceptionYear = '2021'
63+
pom {
64+
packaging = 'jar'
65+
name = project.name
66+
description = project.description
67+
url = "https://github.com/redis/redis-om-spring"
68+
inceptionYear = '2021'
6369

64-
licenses {
65-
license {
66-
name = "MIT License"
67-
url = "https://opensource.org/licenses/MIT"
70+
licenses {
71+
license {
72+
name = "MIT License"
73+
url = "https://opensource.org/licenses/MIT"
74+
}
6875
}
69-
}
7076

71-
developers {
72-
developer {
73-
id = "bsbodden"
74-
name = "Brian Sam-Bodden"
75-
email = "bsb at redis.com"
77+
developers {
78+
developer {
79+
id = "bsbodden"
80+
name = "Brian Sam-Bodden"
81+
email = "bsb at redis.com"
82+
}
7683
}
77-
}
7884

79-
scm {
80-
connection = "scm:git:git://github.com/redis/redis-om-spring.git"
81-
developerConnection = "scm:git:ssh://github.com/redis/redis-om-spring.git"
82-
url = "https://github.com/redis/redis-om-spring"
85+
scm {
86+
connection = "scm:git:git://github.com/redis/redis-om-spring.git"
87+
developerConnection = "scm:git:ssh://github.com/redis/redis-om-spring.git"
88+
url = "https://github.com/redis/redis-om-spring"
89+
}
8390
}
8491
}
8592
}
86-
}
8793

88-
repositories {
89-
maven {
90-
url = rootProject.layout.buildDirectory.dir('staging-deploy')
94+
repositories {
95+
maven {
96+
url = rootProject.layout.buildDirectory.dir('staging-deploy')
97+
}
9198
}
9299
}
93100
}

0 commit comments

Comments
 (0)