是否有插件或一些很好的方法让gradle在后台编译和测试我的应用程序?
我知道有一些intellij和eclipse的插件(其中包括最多的插件),但我正在寻找一个通用的gradle解决方案,无论IDE如何.
开始测试-damon并使用growl或其他一些通知工具让我知道代码没有编译或测试失败会很好.
如果用户决定报告崩溃,Android的开发人员控制台具有报告运行时崩溃的功能.其他框架具有类似的功能,可在不涉及用户的情况下发送崩溃报告.
有谁知道报告失败的安装或升级的方法?使用android 5.0,我收到越来越多的安装失败的用户报告,但很难从我的应用程序的非技术用户获取日志.
在协程中我正在使用OkHttpClient进行http请求.请求是从具有suspend关键字的函数完成的:
suspend fun doSomethingFromHttp(someParam:String): Something {
...
val response = HttpReader.get(url)
return unmarshalSomething(response)!!
}
Run Code Online (Sandbox Code Playgroud)
我假设函数可以在入口时暂停,因为它有suspend关键字,但在执行http请求时协程会被挂起吗?那么其他类型的阻塞IO呢?
我正在分析一个库,发现调用的函数runtime.memclrNoHeapPointers占用了大约 0.82 秒的 cpu 时间。
这个函数的作用是什么?它告诉我有关我正在分析的库的内存使用情况的什么信息?
为了完整起见,输出:
File: gribtest.test
Type: cpu
Time: Feb 12, 2019 at 8:27pm (CET)
Duration: 5.21s, Total samples = 5.11s (98.15%)
Showing nodes accounting for 4.94s, 96.67% of 5.11s total
Dropped 61 nodes (cum <= 0.03s)
flat flat% sum% cum cum%
1.60s 31.31% 31.31% 1.81s 35.42% github.com/nilsmagnus/grib/griblib.(*BitReader).readBit
1.08s 21.14% 52.45% 2.89s 56.56% github.com/nilsmagnus/grib/griblib.(*BitReader).readUint
0.37s 7.24% 59.69% 0.82s 16.05% encoding/binary.(*decoder).value
0.35s 6.85% 66.54% 0.35s 6.85% runtime.memclrNoHeapPointers
Run Code Online (Sandbox Code Playgroud) 在我的项目中,我尝试在build.gradle中使用这样的系统环境配置我的应用程序:
apply plugin: 'application'
applicationDefaultJvmArgs = ["-Ddw.server.applicationConnectors[0].port=${System.env.PORT}"]
Run Code Online (Sandbox Code Playgroud)
如果将PORT设置为常量,则可以这样工作,例如9001.但是如果我将PORT更改为另一个变量,则可执行脚本不会更改,它已在build/install/bin/{可执行文件中编译为旧值PORT -script},像这样:
DEFAULT_JVM_OPTS='"-Ddw.server.applicationConnectors[0].port=9001"'
Run Code Online (Sandbox Code Playgroud)
而不是我想要的,
DEFAULT_JVM_OPTS='"-Ddw.server.applicationConnectors[0].port=$PORT"'
Run Code Online (Sandbox Code Playgroud)
有没有办法告诉应用程序插件使用系统环境变量而不是评估system.env变量?
顺便说一句,我也试过没有单引号来避免评估$ PORT表达式
applicationDefaultJvmArgs = ['-Ddw.server.applicationConnectors[0].port=$PORT']
Run Code Online (Sandbox Code Playgroud)
和
applicationDefaultJvmArgs = ['-Ddw.server.applicationConnectors[0].port=\$PORT']
Run Code Online (Sandbox Code Playgroud)
但是这两个都编译成了这个不起作用.
DEFAULT_JVM_OPTS='"-Ddw.server.applicationConnectors[0].port=\$PORT"'
Run Code Online (Sandbox Code Playgroud) 在Go中,从函数返回的效率更高:返回uint或返回*uint?
该函数在cpu密集型库的内部for循环中调用.
go ×2
gradle ×2
android ×1
continuous ×1
kotlin ×1
performance ×1
pointers ×1
profiling ×1
testing ×1