Skip to content

Commit 131e514

Browse files
authored
Merge pull request #74 from SilentSliver/master
Merge from master
2 parents 97ff05b + d88730c commit 131e514

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pom.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
import java.nio.file.*
9797
9898
// 1. 读取.env文件
99-
def envFile = new File("${project.basedir}/.env")
99+
def envFile = Paths.get(project.basedir.toString(), ".env").toFile()
100100
def baseDir = "problems"
101101
if (envFile.exists()) {
102102
envFile.eachLine { line ->
@@ -107,19 +107,19 @@
107107
}
108108
109109
// 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()
111111
if (!configFile.exists()) {
112112
throw new RuntimeException("Config file not found: ${configFile.absolutePath}")
113113
}
114114
def config = new JsonSlurper().parse(configFile)
115115
116116
// 3. 构建源目录列表
117117
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)
119119
for (int i = 0; i < config.plans.size(); i += 2) {
120120
def problem = config.plans[i]
121121
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)
123123
}
124124
125125
println "==> 添加动态源目录:"

0 commit comments

Comments
 (0)