Skip to content

Commit 64c97bf

Browse files
committed
Fix remaining test failures for Gradle 8 and 9 compatibility
- Fix RequireJsTask: Add ProcessBuilder fallback for test contexts where project.javaexec is not available - Ensure all ProcessBuilder command elements are explicitly converted to strings - Consume output streams to prevent process from hanging - Fix JsPluginFunctionalTest: Implement getPatternSetFactory() in TestTask class - Required for SourceTask subclasses in Gradle 9 - Inject PatternSetFactory via constructor - Fix JsHintTask: Refactor warning detection logic to match JSHint behavior - Add setCheckSymbols(true) and setCheckGlobalThis(false) to compiler options to enable proper undefined variable detection - Implement custom BasicErrorManager to capture all Closure Compiler diagnostics - Refine warning detection logic to differentiate between lint warnings and critical warnings (undefined variables, unused variables, strict mode violations) - When JSHint options (undef, unused, strict) are enabled, fail on relevant warnings - When no options are enabled, only fail on critical warnings (undefined variables) - Filter out lint-only warnings (using var, missing semicolon) when checking for critical issues - Add comprehensive debug logging for diagnostic group configuration and warning detection - Fix JavaScriptExtension: Use source.configure(closure) for proper delegation All tests now pass with both Gradle 8.14.3 and Gradle 9.2.1.
1 parent 90ae098 commit 64c97bf

File tree

4 files changed

+411
-26
lines changed

4 files changed

+411
-26
lines changed

src/main/groovy/com/eriwen/gradle/js/JavaScriptExtension.groovy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ class JavaScriptExtension {
2222
}
2323

2424
void source(Closure closure) {
25-
closure.delegate = source
26-
closure.resolveStrategy = Closure.DELEGATE_FIRST
27-
closure.call(source)
25+
// Configure the container - use the container's configure method directly
26+
// This allows dynamic method calls like custom { } to work
27+
source.configure(closure)
2828
}
2929
}

0 commit comments

Comments
 (0)