Skip to content

Commit

Permalink
Fix intellij autocomplete etc inside whelktool scripts (#1286)
Browse files Browse the repository at this point in the history
Co-authored-by: Kalle Wåhlin <[email protected]>
  • Loading branch information
olovy and kwahlin authored Aug 17, 2023
1 parent 2a6f6a4 commit dac3242
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions whelktool/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,18 @@ sourceSets {
test {
groovy { srcDir 'src/test/groovy/' }
}
// This is just so that intellij will understand whelk-core and whelktool classes
// inside whelktool scripts. So that autocomplete and navigation etc works.
//
// After importing the gradle project the 'scripts' directory needs to be manually
// unmarked as "source root" for whelktool classes to work. And so that 'scripts'
// is displayed as directories instead of as packages. Autocomplete etc. still works.
//
// Right-click on the 'scripts' directory and select
// "Mark directory as" > "Unmark as Sources root"
whelktoolScripts {
groovy { srcDir 'scripts' }
}
}

mainClassName = "whelk.datatool.WhelkTool"
Expand Down Expand Up @@ -54,6 +66,8 @@ dependencies {
implementation "org.codehaus.groovy:groovy:${groovyVersion}"
implementation 'org.codehaus.jackson:jackson-mapper-asl:1.9.12'
implementation group: 'xml-apis', name: 'xml-apis', version: '1.4.01'
whelktoolScriptsCompileOnly sourceSets.main.output
whelktoolScriptsCompileOnly project(':whelk-core')
}

jar {
Expand Down

0 comments on commit dac3242

Please sign in to comment.