最近用到了kts文件:
1、简单解析一下:
.kt
— normal source files, .kts
— script files
这.kts
个文件是作为脚本文件运行的,不需要单独编译.它使用以下命令运行:
kotlinc -script <filename>.kts
You don't need main function in a .kts file, It will be executed line by line just like a bash/python script.
2、官网
https://developer.android.com/studio/build/migrate-to-kts?hl=zh-cn
3、如何运行脚本:
https://stackoverflow.com/questions/72105852/execute-kts-kotlin-script-from-gradle