mirror of
https://github.com/microsoft/playwright.git
synced 2025-06-26 21:40:17 +00:00
chore: use .Core namespace for dotnet (#7103)
This commit is contained in:
parent
cff04abb5e
commit
66f9aeee17
@ -98,7 +98,7 @@ classNameMap.set('Readable', 'Stream');
|
||||
* @param {string} folder
|
||||
* @param {string} extendsName
|
||||
*/
|
||||
function writeFile(kind, name, spec, body, folder, extendsName = null) {
|
||||
function writeFile(kind, name, spec, body, folder, extendsName = null, namespace = "Microsoft.Playwright") {
|
||||
const out = [];
|
||||
// console.log(`Generating ${name}`);
|
||||
|
||||
@ -124,7 +124,7 @@ function writeFile(kind, name, spec, body, folder, extendsName = null) {
|
||||
out.push(...body);
|
||||
out.push('}');
|
||||
|
||||
let content = template.replace('[CONTENT]', out.join(EOL));
|
||||
let content = template.replace('[NAMESPACE]', namespace).replace('[CONTENT]', out.join(EOL));
|
||||
fs.writeFileSync(path.join(folder, name + '.cs'), content);
|
||||
}
|
||||
|
||||
@ -184,7 +184,8 @@ function renderBaseClass(clazz) {
|
||||
[],
|
||||
body,
|
||||
adaptersDir,
|
||||
null);
|
||||
null,
|
||||
'Microsoft.Playwright.Core');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -37,7 +37,7 @@ using System.Threading.Tasks;
|
||||
|
||||
#nullable enable
|
||||
|
||||
namespace Microsoft.Playwright
|
||||
namespace [NAMESPACE]
|
||||
{
|
||||
[CONTENT]
|
||||
}
|
||||
|
@ -150,6 +150,7 @@ for (const [name, item] of Object.entries(protocol)) {
|
||||
const initializerName = channelName + 'Initializer';
|
||||
const superName = inherits.get(name);
|
||||
channels_ts.push('using System.Collections.Generic;');
|
||||
channels_ts.push('using Microsoft.Playwright.Core;');
|
||||
channels_ts.push(``);
|
||||
channels_ts.push(`namespace Microsoft.Playwright.Transport.Protocol`);
|
||||
channels_ts.push(`{`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user