PageRenderTime 30ms CodeModel.GetById 25ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/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
 1apply plugin: 'idea'
 2apply plugin: 'eclipse'
 3
 4def gitIgnore = file('.gitignore').readLines()
 5def gitIgnoreDirs = gitIgnore*.trim().findAll { !it.startsWith('#') && it.endsWith('/') }
 6
 7idea {
 8    project {
 9        jdkName '1.6'
10        configure(modules) {
11            excludeDirs = files(gitIgnoreDirs) as Set
12        }
13        ipr {
14            withXml { provider ->
15                def node = provider.asNode()
16                node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
17                node.component[0] + {
18                    component(name: 'AntConfiguration') {
19                        defaultAnt(bundledAnt: 'true')
20                        buildFile(url: 'file://$PROJECT_DIR$/build.xml') {
21                            additionalClassPath()
22                            antReference(projectDefault: 'true')
23                            customJdkName(value: '')
24                            maximumHeapSize(value: '128')
25                            maximumStackSize(value: '2')
26                            properties()
27                        }
28                    }
29                }
30            }
31        }
32    }
33    module {
34        iml {
35            withXml { provider ->
36                def node = provider.asNode()
37                final newModuleRootManager = node.component.find { it.'@name' == 'NewModuleRootManager' }
38                newModuleRootManager?.'@inherit-compiler-output' = 'false'
39                newModuleRootManager.'exclude-output' + {
40                    output(url: 'file://$MODULE_DIR$/build/classes/main')
41                    'output-test'(url: 'file://$MODULE_DIR$/build/classes/test')
42                }
43            }
44        }
45    }
46    workspace {
47        iws {
48            withXml { provider ->
49                def node = provider.asNode()
50                final runManager = node.component.find { it.'@name' == 'RunManager' }
51                runManager.replaceNode() {
52                    component(name: 'RunManager', selected: 'JUnit.All in job-dsl-plugin') {
53                        configuration(default: 'false', name: 'All in job-dsl-plugin', type:'JUnit', factoryName: 'JUnit', temporary: 'true') {
54                          extension(name: 'coverage', enabled: 'false', merge: 'false', runner: 'idea') {
55                            pattern {
56                              option(name: 'PATTERN', value: 'javaposse.jobdsl.*')
57                              option(name: 'ENABLED', value: 'true')
58                            }
59                          }
60                          module(name: 'job-dsl-plugin')
61                          option(name: 'ALTERNATIVE_JRE_PATH_ENABLED', value: 'false')
62                          option(name: 'TEST_OBJECT', value: 'package')
63                          option(name: 'WORKING_DIRECTORY', value: 'file://$PROJECT_DIR$')
64                          option(name: 'ENV_VARIABLES')
65                          option(name: 'PASS_PARENT_ENVS', value: 'true')
66                          option(name: 'TEST_SEARCH_SCOPE') {
67                            value(defaultName: 'singleModule')
68                          }
69                          RunnerSettings(RunnerId: 'Run')
70                          ConfigurationWrapper(RunnerId: 'Run')
71                          method() {
72                            option(name: 'AntTarget', enabled: 'true', antfile: 'file://$PROJECT_DIR$/build.xml', target: 'compile')
73                            option(name: 'Make', enabled: 'false')
74                          }
75                        }
76                    }
77                }
78                final toolWindowManager = node.component.find { it.'@name' == 'ToolWindowManager' }
79                toolWindowManager?.layout?.window_info?.each { it.'@active' = 'false' }
80                final antWindowInfo = toolWindowManager?.layout?.window_info?.find { it.'@id' == 'Ant Build' }
81                antWindowInfo?.'@active' = 'true'
82            }
83        }
84    }
85}