我有一个使用 Gradle 作为构建系统的 Java 应用程序。这是多项目构建的(几个 Java 项目)。
当我运行gradlew test并且某些测试失败时,我注意到并非所有测试都实际运行。
如果我添加以下代码,build.gradle它会运行所有测试,但当然,构建总是成功完成:
test {
ignoreFailures = true
}
Run Code Online (Sandbox Code Playgroud)
我有两个问题:
我从TSLint收到此错误,并且试图了解为什么它在抱怨。
我有一个函数,该函数调用另一个返回诺言的方法,但是第一个函数不返回诺言,因为它只是等待其完成并更新内部状态。
我已将其简化为此函数,仅用于Q()模拟返回承诺的调用。
export function DoSomethingAsync(): void {
Q().then(r => {
console.log('test');
}).catch(err => {
log.error("wow");
}).finally(() => {
log.info("at finally")
});
}
Run Code Online (Sandbox Code Playgroud)
tslint现在在我的项目上运行时,出现以下错误:
错误:C:/dev/local_cache_service.ts [31,5]:必须正确处理承诺
如果我取消finally通话,tslint会顺利通过。
export function DoSomethingAsync(): void {
Q().then(r => {
console.log('test');
}).catch(err => {
log.error("wow");
});
}
Run Code Online (Sandbox Code Playgroud)
当我在种子打字稿项目上创建相同的功能时,此行为不会重现...
我正在尝试使用ANTLR为使用C#代码生成的简单语言创建解析器.
我已成功地使用名为"rule"的非常简单的规则来生产MyLangLexer.cs和MyLangParser.cs.
问题是生成的方法rule()是私有的.
我想要的是使用ANTLR将字符串解析为AST.
谢谢,Ido.
我尝试在我的网络应用程序上将EmberJS从pre1更新为pre2,但我注意到它将所有车把模板作为最后的车身元素,有时根本没有.
我使用starter-kit 创建了一个repro,只需在模板前后放置div,就可以显示模板将被添加到错误的位置.使用pre1运行同一页面,一切正常.
的index.html
....
<body>
<div>this is before the template</div>
<script type="text/x-handlebars" data-template-name="application">
<h1>Hello from Ember.js</h1>
</script>
<div>this is after the template</div>
Run Code Online (Sandbox Code Playgroud)
....
我正在使用ASP MVC 4并且我同时启用了ClientValidationEnabled和UnobtrusiveJavaScriptEnabled appSettings,但是当我提交具有不显眼的验证数据属性的表单时,即使它无效也会提交.出现验证消息,但表单仍然提交.
当然,我的浏览器启用了JavaScript.
我正在使用 expand 方法复制文件并替换其中的字符串。
问题是当 expand 的值改变时,gradle 仍然将目标文件视为最新的。我必须清理和构建文件才能获得正确的值。
这是复制任务:
task copyProductionConfig(type: Copy) {
from 'source'
include 'config.properties'
into 'build/war/WEB-INF/config'
expand([
databaseHostname: 'db.company.com',
version: versionId,
buildNumber: (int)(Math.random() * 1000),
date: new Date()
])
}
Run Code Online (Sandbox Code Playgroud)
即使版本更改,gradle 仍然将结果文件视为最新的。
gradle ×2
antlr ×1
antlr3 ×1
asp.net-mvc ×1
c# ×1
ember.js ×1
java ×1
javascript ×1
q ×1
tslint ×1
typescript ×1