plugins {
    id("gradlebuild.distribution.api-java")
}

description = "Worker process management infrastructure for starting, configuring, and communicating with worker processes."

dependencies {
    api(projects.baseServices)
    api(projects.buildOperations)
    api(projects.buildProcessServices)
    api(projects.classloaders)
    api(projects.stdlibJavaExtensions)
    api(projects.fileTemp)
    api(projects.logging)
    api(projects.loggingApi)
    api(projects.messaging)
    api(projects.native)
    api(projects.problemsApi)
    api(projects.processMemoryServices)
    api(projects.processServices)
    api(projects.processServicesApi)
    api(projects.requestHandlerWorker)
    api(projects.scopedPersistentCache)
    api(projects.serialization)
    api(projects.serviceProvider)
    api(projects.workerMain)

    api(libs.jspecify)

    implementation(projects.baseAsm)
    implementation(projects.concurrent)
    implementation(projects.coreApi)
    implementation(projects.io)
    implementation(projects.modelReflect)
    implementation(projects.persistentCache)

    implementation(libs.asmCommons)
    implementation(libs.guava)
    implementation(libs.slf4jApi)

    testImplementation(testFixtures(projects.core)) {
        because("Unit tests use ConcurrentTestUtil and MultithreadedTestRule from core test fixtures")
    }
    testImplementation(testFixtures(projects.logging))

    testFixturesImplementation(projects.requestHandlerWorker)

    integTestImplementation(testFixtures(projects.core)) {
        because("AbstractWorkerProcessIntegrationSpec uses core infrastructure: ClassPathRegistry, ModuleRegistry, GlobalScopeServices, TestFiles, NativeServicesTestFixture")
    }
    integTestDistributionRuntimeOnly(projects.distributionsCore)
}

packageCycles {
    excludePatterns.add("org/gradle/process/internal/worker/**")
}

gradleModule {
    computedRuntimes {
        // Auto-generated by `:checkTargetRuntimes --fix`
        client = true
        daemon = true
        worker = true
    }
}
