2
我在Eclipse中为.classpath文件添加了一个类路径条目,以避免在每次运行.eclipse任务时手动添加它,同时添加一些依赖项。我需要一些资源在本地运行。Eclipse Gradle添加类路径条目
这个作品,
eclipse.classpath.file {
withXml {
def node = it.asNode()
node.appendNode('classpathentry',
[kind: 'lib', path: '/some/path'])
}
}
这不,
eclipse.classpath.file {
whenMerged { classpath ->
classpath.entries.add { entry -> kind: 'lib', path: '/some/path' }
}
}
我得到的是错误,
启动失败:的build.gradle':75:意外标记:lib @第75行,第48列。 .entries.add {entry - > kind:'lib',pat ^
为了将来的参考,第二个例子有什么问题?