Skip to content

Instantly share code, notes, and snippets.

@danhyun
Created August 11, 2015 22:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danhyun/980319864f75967ccd8a to your computer and use it in GitHub Desktop.
Save danhyun/980319864f75967ccd8a to your computer and use it in GitHub Desktop.
build gradle with git and gradle window setup
apply plugin: 'idea'
idea {
project {
jdkName "1.8"
languageLevel "1.8"
ipr {
withXml { provider ->
def node = provider.asNode()
node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
node.append(new XmlParser().parseText('''
<component name="GradleSettings">
<option name="linkedExternalProjectsSettings">
<GradleProjectSettings>
<option name="distributionType" value="DEFAULT_WRAPPED" />
<option name="externalProjectPath" value="$PROJECT_DIR$" />
<option name="useAutoImport" value="true" />
</GradleProjectSettings>
</option>
</component>
'''))
}
}
}
}
@jkschneider
Copy link

Naturally, I would never recommend setting jdkName on an OSS project as that can vary from one machine to another.

@robfletcher
Copy link

You can set languageLevel = "JDK_1_8" safely, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment