import { execAsync } from '../../../utils.js';
import { createModuleLogger } from '../../../logger.js';
const logger = createModuleLogger('SwiftPackageCleaner');
/**
 * Handles cleaning Swift packages (Single Responsibility: Cleaning)
 */
export class SwiftPackageCleaner {
    /**
     * Clean Swift package build artifacts
     */
    async clean(packagePath, options) {
        const command = `swift package clean --package-path "${packagePath}"`;
        logger.debug({ command }, 'Clean command');
        try {
            await execAsync(command);
            logger.info({ packagePath }, 'Clean succeeded');
        }
        catch (error) {
            logger.error({ error: error.message, packagePath }, 'Clean failed');
            throw new Error(`Clean failed: ${error.message}`);
        }
    }
}
//# sourceMappingURL=SwiftPackageCleaner.js.map