Skip to content

Instantly share code, notes, and snippets.

@childnode
Created August 16, 2016 05:07
Show Gist options
  • Save childnode/6df6d14c6b3aa47a327bb73ffd731444 to your computer and use it in GitHub Desktop.
Save childnode/6df6d14c6b3aa47a327bb73ffd731444 to your computer and use it in GitHub Desktop.
idea gradle project setup for additional sourceSets
// fixing setup of what idea does not automatically - see https://github.com/bmuschko/gradle-docker-plugin/blob/master/build.gradle
idea.project {
jdkName = '1.8'
languageLevel = compatibilityVersion
ipr.withXml { provider ->
def node = provider.asNode()
// Use GIT
def vcsConfig = node.component.find { it.'@name' == 'VcsDirectoryMappings' }
vcsConfig.mapping[0].'@vcs' = 'Git'
// Set Gradle home
def gradleSettings = node.appendNode('component', [name: 'GradleSettings'])
gradleSettings.appendNode('option', [name: 'SDK_HOME', value: gradle.gradleHomeDir])
}
}
// adds integrationTest sourceSet - see https://github.com/bmuschko/gradle-docker-plugin/blob/master/gradle/integration-test.gradle
idea.module {
sourceSets.integrationTest.allSource.srcDirs.each {
testSourceDirs += it
}
scopes.TEST.plus += [configurations.integrationTestCompile]
scopes.TEST.plus += [configurations.integrationTestRuntime]
}
@childnode
Copy link
Author

see also https://gist.github.com/childnode/b8ae38d4962e3a77c3a2b233d63cf732 for additional sourceSets in gradle

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment