Skip to content

Commit

Permalink
Merge pull request #8 from ams-tschoening/windows_paths
Browse files Browse the repository at this point in the history
Windows paths are forwarded using / instead of \ to EditorConfig.
  • Loading branch information
stempler authored Oct 31, 2018
2 parents 863d0b2 + eafb334 commit 9ec6656
Showing 1 changed file with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,19 @@ class EclipseConfigPlugin implements Plugin<Project> {
result
}

void applyJavaConfiguration(Project project, EditorConfig editorConfig) {
File dummyFile = project.file('Dummy.java')
private Map getDummyFileProps(Project project, EditorConfig editorConfig) {
File dummyFile = project.file('Dummy.java')
String dummyFileStr = dummyFile.absolutePath.replaceAll("\\\\", "/")
Map settings = toMap(editorConfig.getProperties(dummyFileStr))

project.logger.debug(".editorconfig read for: ${dummyFile} -> ${dummyFileStr}")
project.logger.debug(".editorconfig contents: ${settings}")

settings
}

def settings = toMap(editorConfig.getProperties(dummyFile.absolutePath))
void applyJavaConfiguration(Project project, EditorConfig editorConfig) {
def settings = getDummyFileProps(project, editorConfig)

// JDT properties
/* Use of eclipse plugin DSL leads to errors when plugin is used via new plugin mechanism
Expand Down Expand Up @@ -155,9 +164,7 @@ class EclipseConfigPlugin implements Plugin<Project> {
}

void applyCommonConfiguration(Project project, EditorConfig editorConfig) {
File dummyFile = project.file('Dummy.java')

def settings = toMap(editorConfig.getProperties(dummyFile.absolutePath))
def settings = getDummyFileProps(project, editorConfig)

// remove properties on clean
project.tasks.cleanEclipse.doLast {
Expand Down

0 comments on commit 9ec6656

Please sign in to comment.