File tree Expand file tree Collapse file tree 1 file changed +19
-16
lines changed
Expand file tree Collapse file tree 1 file changed +19
-16
lines changed Original file line number Diff line number Diff line change @@ -158,6 +158,24 @@ val installDependencies by tasks.registering(Copy::class) {
158158 destinationDir = file(" src/main/resources" )
159159}
160160
161+ // 复制资源到沙盒的任务
162+ val copyResourcesToSandbox by tasks.registering(Copy ::class ) {
163+ group = " build setup"
164+ description = " Copy resources to sandbox"
165+
166+ dependsOn(installDependencies)
167+
168+ from(" src/main/resources/server" ) {
169+ into(" server" )
170+ }
171+ from(" src/main/resources/debugger" ) {
172+ into(" debugger" )
173+ }
174+
175+ // 目标目录将在执行时由prepareSandbox任务设置
176+ destinationDir = layout.buildDirectory.dir(" idea-sandbox/plugins/EmmyLua2" ).get().asFile
177+ }
178+
161179// 清理任务
162180val cleanDependencies by tasks.registering(Delete ::class ) {
163181 group = " build setup"
@@ -241,22 +259,7 @@ tasks {
241259
242260 // 准备沙盒环境
243261 prepareSandbox {
244- val projectDir = layout.projectDirectory
245- val pluginNameProvider = pluginName
246-
247- doLast {
248- // 复制服务器文件到沙盒
249- copy {
250- from(projectDir.dir(" src/main/resources/server" ))
251- into(" ${destinationDir.path} /${pluginNameProvider.get()} /server" )
252- }
253-
254- // 复制调试器文件到沙盒
255- copy {
256- from(projectDir.dir(" src/main/resources/debugger" ))
257- into(" ${destinationDir.path} /${pluginNameProvider.get()} /debugger" )
258- }
259- }
262+ dependsOn(copyResourcesToSandbox)
260263 }
261264
262265 // 清理任务
You can’t perform that action at this time.
0 commit comments