import { createNeedleCallback } from '../../base/support/index.mjs';
export const applyFromGradleCallback = ({ script }) => createNeedleCallback({
    needle: 'gradle-apply-from',
    contentToAdd: `apply from: "${script}"`,
});
export const addGradleDependencyCallback = ({ groupId, artifactId, version, scope }) => createNeedleCallback({
    needle: 'gradle-dependency',
    contentToAdd: `${scope} "${groupId}:${artifactId}${version ? `:${version}` : ''}"`,
});
export const addGradlePluginCallback = ({ id, version }) => createNeedleCallback({
    needle: 'gradle-plugins',
    contentToAdd: `id "${id}"${version ? ` version "${version}"` : ''}`,
});
export const addGradlePluginManagementCallback = ({ id, version }) => createNeedleCallback({
    needle: 'gradle-plugin-management-plugins',
    contentToAdd: `id "${id}" version "${version}"`,
});
export const addGradlePropertyCallback = ({ property, value }) => createNeedleCallback({
    needle: 'gradle-property',
    contentToAdd: `${property}=${value}`,
    contentToCheck: new RegExp(`\n${property}=`),
    autoIndent: false,
});
export const addGradleMavenRepositoryCallback = ({ url, username, password }) => createNeedleCallback({
    needle: 'gradle-repositories',
    contentToAdd: `
maven {
    url "${url}"${username || password ? `
    credentials {${username ? `
        username = "${username}"` : ''}${password ? `
        password = "${password}"` : ''}
    }` : ''}
}`,
});
