From 9a1cf387c0021d863d735eda0783c0a0b603adc8 Mon Sep 17 00:00:00 2001 From: hstyi Date: Sat, 25 Jan 2025 21:19:50 +0800 Subject: [PATCH] fix: check-license --- build.gradle.kts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/build.gradle.kts b/build.gradle.kts index 642ffdc..f9e8985 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -415,6 +415,18 @@ tasks.register("check-license") { thirdParty[nameWithVersion.replace(StringUtils.SPACE, "-")] = license thirdPartyNames.add(nameWithVersion.split(StringUtils.SPACE).first()) } + + for (file in configurations.runtimeClasspath.get()) { + val name = file.nameWithoutExtension + if (!thirdParty.containsKey(name)) { + if (logger.isWarnEnabled) { + logger.warn("$name does not exist in third-party") + } + if (!thirdPartyNames.contains(name)) { + throw GradleException("$name No license found") + } + } + } } }