Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个用于测试的 Kotlin 脚本。为了快速运行它,我使用kotlinc -script它来评估它,它会立即在控制台中打印我的结果。
kotlinc -script
现在,当脚本变得足够大时,我想将其拆分为不同的子模块/包。是否可以评估具有多个文件的脚本kotlinc?
kotlinc
请注意,该设置仅用于测试目的,这就是我不想编译它的原因,以避免额外的步骤。想象一下,直接从控制台进行操作,并且您不想使用 Gradle 设置项目。
谢谢。
看起来kscript是答案。
//INCLUDE directory/requiredFile.kts
requiredFile.kts
./mainScript.kts
chmod +x mainScript.kts
如果有人知道如何直接kotlinc告诉我。