I'm adding a classpath entry to the .classpath file in Eclipse to avoid having to add it manually each time I run the .eclipse task while I add a number of dependencies. I need some resources on the path to run locally.
this works,
eclipse.classpath.file {
withXml {
def node = it.asNode()
node.appendNode('classpathentry',
[kind: 'lib', path: '/some/path'])
}
}
this doesn't,
eclipse.classpath.file {
whenMerged { classpath ->
classpath.entries.add { entry -> kind: 'lib', path: '/some/path' }
}
}
The error I get is,
startup failed: build.gradle': 75: unexpected token: lib @ line 75, column 48. .entries.add { entry -> kind: 'lib', pat ^
For future reference, what is wrong with the second example?