Skip to content

Merge from master #74

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
import java.nio.file.*

// 1. 读取.env文件
def envFile = new File("${project.basedir}/.env")
def envFile = Paths.get(project.basedir.toString(), ".env").toFile()
def baseDir = "problems"
if (envFile.exists()) {
envFile.eachLine { line ->
Expand All @@ -107,19 +107,19 @@
}

// 2. 读取config.json
def configFile = new File("${project.basedir}/daily-${baseDir}.json")
def configFile = Paths.get(project.basedir.toString(), "daily-${baseDir}.json").toFile()
if (!configFile.exists()) {
throw new RuntimeException("Config file not found: ${configFile.absolutePath}")
}
def config = new JsonSlurper().parse(configFile)

// 3. 构建源目录列表
def sources = [] as Set
sources.add(new File(project.basedir, "${baseDir}/${baseDir}_${config.daily}/").absolutePath)
sources.add(Paths.get(project.basedir.toString(), baseDir, "${baseDir}_${config.daily}").toFile().absolutePath)
for (int i = 0; i < config.plans.size(); i += 2) {
def problem = config.plans[i]
def folder = config.plans[i + 1]
sources.add(new File(project.basedir, "${folder}/${folder}_${problem}/").absolutePath)
sources.add(Paths.get(project.basedir.toString(), folder, "${folder}_${problem}").toFile().absolutePath)
}

println "==> 添加动态源目录:"
Expand Down