Skip to content

Instantly share code, notes, and snippets.

@danhyun danhyun/build.gradle
Created Aug 11, 2015

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

commented Aug 12, 2015

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

@robfletcher

This comment has been minimized.

Copy link

commented Aug 14, 2015

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
You can’t perform that action at this time.