File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 96
96
import java.nio.file.*
97
97
98
98
// 1. 读取.env文件
99
- def envFile = new File("${ project.basedir}/. env")
99
+ def envFile = Paths.get( project.basedir.toString(), ". env").toFile( )
100
100
def baseDir = "problems"
101
101
if (envFile.exists()) {
102
102
envFile.eachLine { line ->
107
107
}
108
108
109
109
// 2. 读取config.json
110
- def configFile = new File("${ project.basedir}/ daily-${baseDir}.json")
110
+ def configFile = Paths.get( project.basedir.toString(), " daily-${baseDir}.json").toFile( )
111
111
if (!configFile.exists()) {
112
112
throw new RuntimeException("Config file not found: ${configFile.absolutePath}")
113
113
}
114
114
def config = new JsonSlurper().parse(configFile)
115
115
116
116
// 3. 构建源目录列表
117
117
def sources = [] as Set
118
- sources.add(new File (project.basedir, "${baseDir}/${baseDir} _${config.daily}/" ).absolutePath)
118
+ sources.add(Paths.get (project.basedir.toString(), baseDir, "${baseDir}_${config.daily}").toFile( ).absolutePath)
119
119
for (int i = 0; i < config.plans.size(); i += 2) {
120
120
def problem = config.plans[i]
121
121
def folder = config.plans[i + 1]
122
- sources.add(new File (project.basedir, "${folder}/${folder} _${problem}/" ).absolutePath)
122
+ sources.add(Paths.get (project.basedir.toString(), folder, "${folder}_${problem}").toFile( ).absolutePath)
123
123
}
124
124
125
125
println "==> 添加动态源目录:"
You can’t perform that action at this time.
0 commit comments