Skip to content

Commit 6ec8141

Browse files
committed
Fix "Duplicate content roots detected" error
1 parent 7f96693 commit 6ec8141

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

buildSrc/build.gradle.kts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,3 @@ dependencies {
4747
implementation(libs.zxing.javase)
4848
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) // https://github.com/gradle/gradle/issues/15383
4949
}
50-
51-
sourceSets {
52-
named("main") {
53-
java {
54-
srcDir("../theme-contract/src/main/java")
55-
setIncludes(listOf("com/orange/ouds/theme/OudsVersion.kt"))
56-
}
57-
}
58-
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../../../../../theme-contract/src/main/java/com/orange/ouds/theme/OudsVersion.kt

buildSrc/src/main/kotlin/documentation.gradle.kts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
*/
1212

1313
import com.github.mustachejava.DefaultMustacheFactory
14+
import com.orange.ouds.theme.OudsVersion
1415
import java.io.FileOutputStream
1516
import java.io.PrintWriter
1617
import kotlin.reflect.full.declaredMemberProperties
@@ -22,8 +23,7 @@ tasks.register<DefaultTask>("prepareDocumentation") {
2223
// Retrieve OudsVersion.Component object and fill the table in core/Module.md with the component design versions
2324
val coreModuleDocumentationWriter = PrintWriter(FileOutputStream("core/Module.md"))
2425
// Build a map in order to loop through all component versions in core Module.mustache
25-
val componentVersions = Class.forName("com.orange.ouds.theme.OudsVersion${'$'}Component")
26-
.kotlin
26+
val componentVersions = OudsVersion.Component::class
2727
.declaredMemberProperties
2828
.map { property ->
2929
val name = property.name
@@ -46,11 +46,10 @@ tasks.register<DefaultTask>("prepareDocumentation") {
4646
"theme-sosh"
4747
)
4848
// Use OudsVersion.Tokens directly in various Module.mustache files
49-
val tokensVersions = Class.forName("com.orange.ouds.theme.OudsVersion${'$'}Tokens").kotlin.objectInstance
5049
moduleDocumentationDirectories.forEach { moduleDocumentationDirectory ->
5150
val moduleDocumentationWriter = PrintWriter(FileOutputStream("$moduleDocumentationDirectory/Module.md"))
5251
mustacheFactory.compile("$moduleDocumentationDirectory/Module.mustache")
53-
.execute(moduleDocumentationWriter, tokensVersions)
52+
.execute(moduleDocumentationWriter, OudsVersion.Tokens)
5453
.flush()
5554
}
5655
}

0 commit comments

Comments
 (0)