Skip to content

Instantly share code, notes, and snippets.

@mike-neck
Created July 4, 2014 06:45
Show Gist options
  • Save mike-neck/4cda08a436a04f8452d3 to your computer and use it in GitHub Desktop.
Save mike-neck/4cda08a436a04f8452d3 to your computer and use it in GitHub Desktop.
あまり本質的な対処ではない
apply plugin: 'groovy'
apply plugin: 'idea'
sourceCompatibility = 1.8
version = '1.0'
group = 'hoge.piyo'
repositories {
mavenCentral()
}
dependencies {
compile 'org.codehaus.groovy:groovy-all:2.3.2'
testCompile group: 'junit', name: 'junit', version: '4.11'
}
idea.project.ipr {
withXml {xml ->
def root = xml.node
def component = root.appendNode('component', [name : 'GradleSettings'])
def option = component.appendNode('option', [name : 'linkedExternalProjectsSettings'])
def setting = option.appendNode('GradleProjectSettings')
['distributionType' : 'DEFAULT_WRAPPED',
'externalProjectPath' : '$PROJECT_DIR$',
'gradleHome' : '$USER_HOME$/.gvm/gradle/1.12'].each {name, value ->
setting.appendNode('option', [name : name, value : value])
}
setting.appendNode('option', [name : 'modules'])
.appendNode('set')
.appendNode('option', [value : '$PROJECT_DIR$'])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment