import BaseApplicationGenerator from '../base-application/index.js';
import writeTask from './files.js';
import cleanupTask from './cleanup.js';
export default class SpringWebsocketGenerator extends BaseApplicationGenerator {
    async beforeQueue() {
        if (!this.fromBlueprint) {
            await this.composeWithBlueprints();
        }
        if (!this.delegateToBlueprint) {
            await this.dependsOnBootstrapApplication();
        }
    }
    get writing() {
        return this.asWritingTaskGroup({
            cleanupTask,
            writeTask,
        });
    }
    get [BaseApplicationGenerator.WRITING]() {
        return this.delegateTasksToBlueprint(() => this.writing);
    }
    get postWriting() {
        return this.asPostWritingTaskGroup({
            addDependencies({ source }) {
                source.addJavaDependencies?.([
                    { groupId: 'org.springframework.boot', artifactId: 'spring-boot-starter-websocket' },
                    { groupId: 'org.springframework.security', artifactId: 'spring-security-messaging' },
                ]);
            },
        });
    }
    get [BaseApplicationGenerator.POST_WRITING]() {
        return this.delegateTasksToBlueprint(() => this.postWriting);
    }
}
