Skip to content

Conversation

vga91
Copy link
Collaborator

@vga91 vga91 commented Mar 19, 2025

Changes

  • updated distributionUrl to https\://services.gradle.org/distributions/gradle-8.5-bin.zip like here in Core

  • Added extra-dependencies subproject in main gradle here
    Otherwise they are not detected

  • Needed to add the core mechanism like this (see here), to make work StartupExtendedTest and other which use APOC Core jar

  • Needed to add the extended mechanism as well, see here

  • Needed to add the extra-dependencies mechanism here
    The extra-dependencies doesn't work in the same way (i.e. project(':core').tasks.shadowJar.archiveFile into layout.buildDirectory.dir),
    we have to pick them from the build/allJars folder

  • Updated excludedTaskNames, otherwise the core mechanism doesn't create the jar (without errors..), see here

  • Moved stuff removed from TestContainerUtil to ExtendedTestContainerUtil.

  • moved copyFilesToFolder (removed from core here) to ExtendedTestUtil,
    generalized by calling it copyFilesToFolder instead of copyPluginsToFolder

  • Added description = 'APOC :: Extra Dependencies' to extra-dependencies/build.gradle, for consistencies and to make debug clearer.

  • Updated deprecated 'task ' , deprecated , to tasks.register('<nameTask>').


Additional notes, Tried other ways which don't work

  • extended-it gradle:
tasks.register('copyJars', Copy) {
    from subprojects.collect { it.tasks.withType(Jar) }
    into "$buildDir/allJars"
}
  • extended-it gradle:
gradle.projectsEvaluated {
    task buildDependencies {
        project(":extra-dependencies").allprojects.subprojects.each {
            dependsOn("${it.name}:clean")
        }
        project(":extra-dependencies").subprojects.each { dependsOn("${it.name}:build") }
        project(":extra-dependencies").subprojects.each { dependsOn("${it.name}:shadowJar") }
        dependsOn(copyJars)
    }
}
  • parent build.gradle
tasks.register('buildDependencies') {
    project(":extra-dependencies").childProjects.each {
        println('it.name' + it.name)
        dependsOn("${it.name}:clean")
    }
    project(":extra-dependencies").subprojects.each { dependsOn("${it.name}:build") }
    project(":extra-dependencies").subprojects.each { dependsOn("${it.name}:shadowJar") }
    dependsOn(copyJars)
}
  • settings.gradle
//project(':extra-dependencies').projectDir = new File(rootDir, 'extra-dependencies')
  • settings.gradle
include('nlp')
include('mongodb')
include('email')
// ...
  • settings.gradle:
includeBuild(':extra-dependencies')
  • extended-it gradle
gradle.projectsEvaluated {
    project(":extra-dependencies").subprojects.each { subproject ->
        println("brambilla: ${subproject.name}")
    }
}
  • build.gradle
gradle.taskGraph.whenReady { taskGraph -> {
       
        if (taskGraph.hasTask(':extended-it:core:shadowJar')) {
            println 'qualcosa'
            gradle.startParameter.excludedTaskNames.remove(':core:shadowJar')
            gradle.startParameter.excludedTaskNames.remove(':submodule:core:shadowJar')
        }
    }
}

@vga91 vga91 marked this pull request as draft March 19, 2025 14:25
@vga91 vga91 force-pushed the dev-fix-ci-march-2025 branch from f323c88 to afcda8e Compare March 21, 2025 08:29
@vga91 vga91 marked this pull request as ready for review March 21, 2025 10:32
@RobertoSannino RobertoSannino merged commit 39ad8c9 into dev Mar 21, 2025
5 checks passed
@RobertoSannino RobertoSannino deleted the dev-fix-ci-march-2025 branch March 21, 2025 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants