Skip to content

Commit

Permalink
Fix nasty errors when importing into IntelliJ
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-vieira committed Mar 24, 2020
1 parent 7ce3849 commit 59f259b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 22 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ out/
# include shared intellij config
!.idea/scopes/x_pack.xml
!.idea/inspectionProfiles/Project_Default.xml
!.idea/runConfigurations/Debug_Elasticsearch.xml

# These files are generated in the main tree by IntelliJ
benchmarks/src/main/generated/*
Expand Down
23 changes: 1 addition & 22 deletions gradle/ide.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,27 +35,6 @@ tasks.register('configureIdeaGradleJvm') {
}
}

tasks.register('configureIdeaRunConfigs') {
group = 'ide'
description = 'Configures default run configuration settings'

doLast {
modifyXml('.idea/workspace.xml') { xml ->
def runManager = xml.component.find { it.'@name' == 'RunManager' }
if (runManager == null) {
throw new GradleException("IntelliJ 'RunManager' configuration is missing from workspace.xml. You may need to refresh your Gradle project.")
}

def debugConfig = runManager.configuration.find { it.'@name' == 'Debug Elasticsearch' }
// Enable "auto restart" on remote debug run configuration
if (debugConfig.option.any { it.'@name' == 'AUTO_RESTART' && it.'@value' == 'true'} == false) {
def restart = new NodeBuilder().option(name: 'AUTO_RESTART', value: 'true')
debugConfig.append(restart)
}
}
}
}

idea {
project {
vcs = 'Git'
Expand All @@ -67,7 +46,7 @@ idea {
testRunner = 'choose_per_test'
}
taskTriggers {
afterSync tasks.named('configureIdeaGradleJvm'), tasks.named('configureIdeaRunConfigs')
afterSync tasks.named('configureIdeaGradleJvm')
}
codeStyle {
java {
Expand Down

0 comments on commit 59f259b

Please sign in to comment.