"use strict";
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.generateNuspec = void 0;
function removeCd(path) {
    return path.startsWith('./') ? path.replace('./', '') : path;
}
async function generateNuspec(project) {
    const dependencies = project.azure ? `
    <dependencies>
      <dependency id="Az.Accounts" version="${project.accountsVersionMinimum}" />
    </dependencies>` : '';
    project.state.writeFile(project.nuspec, `<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
  <metadata>
    <id>${project.moduleName}</id>
    <version>${project.moduleVersion}</version>
    <authors>${project.metadata.authors}</authors>
    <owners>${project.metadata.owners}</owners>
    <requireLicenseAcceptance>${project.metadata.requireLicenseAcceptance}</requireLicenseAcceptance>
    <licenseUrl>${project.metadata.licenseUri}</licenseUrl>
    <projectUrl>${project.metadata.projectUri}</projectUrl>
    <description>${project.metadata.description}</description>
    <releaseNotes></releaseNotes>
    <copyright>${project.metadata.copyright}</copyright>
    <tags>${project.metadata.tags}</tags>${dependencies}
  </metadata>
  <files>
    <file src="${removeCd(project.formatPs1xml)}" />
    <file src="${removeCd(project.psd1)}" />
    <file src="${removeCd(project.psm1)}" />
    <!-- https://github.com/NuGet/Home/issues/3584 -->
    <file src="${removeCd(project.dll)}" target="${removeCd(project.binFolder)}" />
    <file src="${removeCd(project.binFolder)}\\${project.dllName}.deps.json" target="${removeCd(project.binFolder)}" />
    <file src="${removeCd(project.internalFolder)}\\**\\*.*" exclude="${removeCd(project.internalFolder)}\\README.md" target="${removeCd(project.internalFolder)}" />
    <file src="${removeCd(project.customFolder)}\\**\\*.*" exclude="${removeCd(project.customFolder)}\\README.md;${removeCd(project.customFolder)}\\**\\*.cs" target="${removeCd(project.customFolder)}" />
    <file src="${removeCd(project.docsFolder)}\\**\\*.md" exclude="${removeCd(project.docsFolder)}\\README.md" target="${removeCd(project.docsFolder)}" />
    <file src="${removeCd(project.exportsFolder)}\\**\\ProxyCmdletDefinitions.ps1" target="${removeCd(project.exportsFolder)}" />
    <file src="${removeCd(project.utilsFolder)}\\**\\*.*" target="${removeCd(project.utilsFolder)}" />
  </files>
</package>`, undefined, 'source-file-other');
}
exports.generateNuspec = generateNuspec;
//# sourceMappingURL=nuspec.js.map