Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix intellij autocomplete etc inside whelktool scripts #1286

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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