/gradle/ide.gradle
http://github.com/JavaPosseRoundup/job-dsl-plugin · Gradle · 85 lines · 83 code · 2 blank · 0 comment · 0 complexity · 906c6a9e2db3a64c6239d522269f3c9e MD5 · raw file
- apply plugin: 'idea'
- apply plugin: 'eclipse'
- def gitIgnore = file('.gitignore').readLines()
- def gitIgnoreDirs = gitIgnore*.trim().findAll { !it.startsWith('#') && it.endsWith('/') }
- idea {
- project {
- jdkName '1.6'
- configure(modules) {
- excludeDirs = files(gitIgnoreDirs) as Set
- }
- ipr {
- withXml { provider ->
- def node = provider.asNode()
- node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
- node.component[0] + {
- component(name: 'AntConfiguration') {
- defaultAnt(bundledAnt: 'true')
- buildFile(url: 'file://$PROJECT_DIR$/build.xml') {
- additionalClassPath()
- antReference(projectDefault: 'true')
- customJdkName(value: '')
- maximumHeapSize(value: '128')
- maximumStackSize(value: '2')
- properties()
- }
- }
- }
- }
- }
- }
- module {
- iml {
- withXml { provider ->
- def node = provider.asNode()
- final newModuleRootManager = node.component.find { it.'@name' == 'NewModuleRootManager' }
- newModuleRootManager?.'@inherit-compiler-output' = 'false'
- newModuleRootManager.'exclude-output' + {
- output(url: 'file://$MODULE_DIR$/build/classes/main')
- 'output-test'(url: 'file://$MODULE_DIR$/build/classes/test')
- }
- }
- }
- }
- workspace {
- iws {
- withXml { provider ->
- def node = provider.asNode()
- final runManager = node.component.find { it.'@name' == 'RunManager' }
- runManager.replaceNode() {
- component(name: 'RunManager', selected: 'JUnit.All in job-dsl-plugin') {
- configuration(default: 'false', name: 'All in job-dsl-plugin', type:'JUnit', factoryName: 'JUnit', temporary: 'true') {
- extension(name: 'coverage', enabled: 'false', merge: 'false', runner: 'idea') {
- pattern {
- option(name: 'PATTERN', value: 'javaposse.jobdsl.*')
- option(name: 'ENABLED', value: 'true')
- }
- }
- module(name: 'job-dsl-plugin')
- option(name: 'ALTERNATIVE_JRE_PATH_ENABLED', value: 'false')
- option(name: 'TEST_OBJECT', value: 'package')
- option(name: 'WORKING_DIRECTORY', value: 'file://$PROJECT_DIR$')
- option(name: 'ENV_VARIABLES')
- option(name: 'PASS_PARENT_ENVS', value: 'true')
- option(name: 'TEST_SEARCH_SCOPE') {
- value(defaultName: 'singleModule')
- }
- RunnerSettings(RunnerId: 'Run')
- ConfigurationWrapper(RunnerId: 'Run')
- method() {
- option(name: 'AntTarget', enabled: 'true', antfile: 'file://$PROJECT_DIR$/build.xml', target: 'compile')
- option(name: 'Make', enabled: 'false')
- }
- }
- }
- }
- final toolWindowManager = node.component.find { it.'@name' == 'ToolWindowManager' }
- toolWindowManager?.layout?.window_info?.each { it.'@active' = 'false' }
- final antWindowInfo = toolWindowManager?.layout?.window_info?.find { it.'@id' == 'Ant Build' }
- antWindowInfo?.'@active' = 'true'
- }
- }
- }
- }