@@ -185,6 +185,13 @@ object CoreJassProvider {
185185 buildFolder.resolve(" core-jass.provenance" ),
186186 " wc3Patch: $patch \n jassHistoryFolder: ${jassHistoryFolderForPatch(patch).orEmpty()} \n "
187187 )
188+ // Single happy-path line; stay quiet when a fallback already warned about an issue.
189+ val sources = materializedFiles.map { it.source }
190+ when {
191+ sources.all { it == CoreJassSource .CACHED } -> log.info(" ✔ Core JASS ready ($patch , cached)" )
192+ sources.all { it == CoreJassSource .CACHED || it == CoreJassSource .FRESH } ->
193+ log.info(" ✔ Core JASS ready ($patch , updated)" )
194+ }
188195 } else {
189196 log.warn(
190197 " Existing _build core JASS files have no Grill provenance; leaving them project-owned. " +
@@ -228,7 +235,11 @@ object CoreJassProvider {
228235 return (base + listOfNotNull(latestExactVersion)).distinct()
229236 }
230237
231- private data class MaterializedFile (val path : Path , val managedByGrill : Boolean )
238+ private enum class CoreJassSource { CACHED , FRESH , FALLBACK , PROJECT_OWNED }
239+
240+ private data class MaterializedFile (val path : Path , val source : CoreJassSource ) {
241+ val managedByGrill: Boolean get() = source != CoreJassSource .PROJECT_OWNED
242+ }
232243
233244 private fun resolveSupportedPatch (wc3Patch : String? ): String {
234245 val patch = normalizePatchInput(wc3Patch)
@@ -247,28 +258,27 @@ object CoreJassProvider {
247258 }
248259
249260 if (previousPatch == null && Files .exists(target)) {
250- log.info( " Keeping existing _build/ $fileName because it has no Grill provenance. " )
251- return MaterializedFile (target, managedByGrill = false )
261+ // Project-owned file: reported once as a warning in ensureFiles, not per file here.
262+ return MaterializedFile (target, CoreJassSource . PROJECT_OWNED )
252263 }
253264
254265 val canKeepExisting = previousPatch == patch
255266 if (canKeepExisting && isValidCoreJassFile(target)) {
256- log.info(" Using cached _build/$fileName for $patch ." )
257- return MaterializedFile (target, managedByGrill = true )
267+ return MaterializedFile (target, CoreJassSource .CACHED )
258268 }
259269
260270 try {
261271 downloadJassHistoryFile(fileName, patch, jassHistoryFolder, target)
262- return MaterializedFile (target, managedByGrill = true )
272+ return MaterializedFile (target, CoreJassSource . FRESH )
263273 } catch (e: Exception ) {
264274 if (canKeepExisting && isValidCoreJassFile(target)) {
265275 log.warn(" Could not refresh $fileName for $patch ; keeping existing _build copy. Reason: ${e.message} " )
266- return MaterializedFile (target, managedByGrill = true )
276+ return MaterializedFile (target, CoreJassSource . FALLBACK )
267277 }
268278 if (hasBundledCoreJass(patch)) {
269279 log.warn(" Could not download $fileName for $patch ; falling back to bundled core JASS. Reason: ${e.message} " )
270280 copyBundledCoreJass(fileName, patch, target)
271- return MaterializedFile (target, managedByGrill = true )
281+ return MaterializedFile (target, CoreJassSource . FALLBACK )
272282 }
273283 throw RuntimeException (" Could not download $fileName for WC3 patch <$patch > from wurstscript/jass-history." , e)
274284 }
0 commit comments