Skip to content

Commit 9dd28e2

Browse files
committed
fix: add task dependencies to runAllExamples for ClassNotFoundException
1 parent f11ea25 commit 9dd28e2

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

python-embed-examples/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ subprojects {
2424

2525
def heavyExamples = ['numpy-basic', 'pandas-dataframe', 'spring-boot-example']
2626

27+
evaluationDependsOnChildren()
28+
2729
tasks.register('runAllExamples') {
2830
group = 'verification'
2931
description = 'Runs all example subprojects with timeouts and failure isolation'
@@ -32,6 +34,16 @@ tasks.register('runAllExamples') {
3234
def defaultTimeoutMs = 90_000L
3335
def heavyTimeoutMs = 120_000L
3436

37+
// Ensure every example subproject is compiled before execution
38+
subprojects.each { subproject ->
39+
if (subproject.plugins.hasPlugin('application')) {
40+
def mainClass = subproject.application.mainClass.getOrNull()
41+
if (mainClass != null) {
42+
dependsOn "${subproject.path}:classes"
43+
}
44+
}
45+
}
46+
3547
doLast {
3648
subprojects.each { subproject ->
3749
if (!subproject.plugins.hasPlugin('application')) return

0 commit comments

Comments
 (0)