/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

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