Update sealDirectory calls to use new object api (#95)

This commit is contained in:
dannyvv 2019-04-08 16:09:12 -07:00 коммит произвёл GitHub
Родитель cc6732e7b7
Коммит a7b4f9ea92
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
16 изменённых файлов: 97 добавлений и 35 удалений

Просмотреть файл

@ -78,7 +78,10 @@ export const testSealedSourceDir = readFileFromDirectory(
@@public
export const testSealedDir = readFileFromDirectory(
"read-seal-dir",
Transformer.sealDirectory(d`src-dir`, globR(d`src-dir`, "*")),
Transformer.sealDirectory({
root: d`src-dir`,
files: globR(d`src-dir`, "*")
}),
"src-file1.txt");
@@public

Просмотреть файл

@ -46,7 +46,10 @@ function main(dropName : string) {
const producedOpaqueDir = executeResult.getOutputDirectory(opaqueDir);
const directoryToDrop = d`./DirectoryToDrop`;
const sealedDirectoryToDrop = Transformer.sealDirectory(directoryToDrop, glob(directoryToDrop, "*"));
const sealedDirectoryToDrop = Transformer.sealDirectory({
root: directoryToDrop,
files: glob(directoryToDrop, "*")
});
const dropOperationArgs = <Drop.DropOperationArguments>
{
name : dropConfig.name,

Просмотреть файл

@ -10,7 +10,10 @@ namespace Contents {
};
@@public
export const all: StaticDirectory = Transformer.sealDirectory(d`.`, []);
export const all: StaticDirectory = Transformer.sealDirectory({
root: d`.`,
files: []
});
}
@@public

Просмотреть файл

@ -10,7 +10,10 @@ namespace Contents {
};
@@public
export const all: StaticDirectory = Transformer.sealDirectory(d`.`, [
f`AriaTenantToken.cs`,
]);
export const all: StaticDirectory = Transformer.sealDirectory({
root: d`.`,
files: [
f`AriaTenantToken.cs`,
]
});
}

Просмотреть файл

@ -10,7 +10,10 @@ namespace Contents {
};
@@public
export const all: StaticDirectory = Transformer.sealDirectory(d`.`, []);
export const all: StaticDirectory = Transformer.sealDirectory({
root: d`.`,
files: []
});
}
@@public

Просмотреть файл

@ -220,10 +220,16 @@ export function compile(args: Arguments): Map<PathAtom, Result> {
]),
});
let binFiles = Transformer.sealDirectory(d`${rcOutFile.parent}`, binOutFiles.map(f => outputs.getOutputFile(f)));
let binFiles = Transformer.sealDirectory({
root: d`${rcOutFile.parent}`,
files: binOutFiles.map(f => outputs.getOutputFile(f))
});
let result = <Result>{
code: codeOutFile && outputs.getOutputFile(codeOutFile),
header: Transformer.sealDirectory(d`${headerOutFile.parent}`, [outputs.getOutputFile(headerOutFile)]),
header: Transformer.sealDirectory({
root: d`${headerOutFile.parent}`,
files: [outputs.getOutputFile(headerOutFile)]
}),
binaryResources: binFiles,
resourceCompilerScript: outputs.getOutputFile(rcOutFile),
mof: outputs.getOutputFile(mofOutFile),

Просмотреть файл

@ -181,7 +181,12 @@ export function evaluate(args: Arguments): Result {
});
let midlOutput = <Midl.Result>{
header: midlHeaderOutFiles.length > 0 ? Transformer.sealDirectory(d`${midlHeaderOutFiles[0].parent}`, midlHeaderOutFiles.map(File.fromPath)) : undefined,
header: midlHeaderOutFiles.length > 0
? Transformer.sealDirectory({
root: d`${midlHeaderOutFiles[0].parent}`,
files: midlHeaderOutFiles.map(File.fromPath)
})
: undefined,
proxy: result.getOutputFile(firstIfExists(midlProxyOutFiles)),
dllData: result.getOutputFile(firstIfExists(midlDllOutFiles)),
iid: result.getOutputFile(firstIfExists(midlIidOutFiles)),

Просмотреть файл

@ -308,6 +308,9 @@ export function evaluate(args: Arguments): Result {
});
return <Result>{
traceOutput: Transformer.sealDirectory(outputDirectory, transformerExecution.getOutputFiles())
traceOutput: Transformer.sealDirectory({
root: outputDirectory,
files: transformerExecution.getOutputFiles()
})
};
}

Просмотреть файл

@ -85,18 +85,26 @@ export const libDeployment: Transformer.ToolDefinition = visualCppDeploymentTemp
export namespace AtlMfc {
@@public
export const include: StaticDirectory = Transformer.sealDirectory(
d`${rootFolder}/atlmfc/include`,
globR(d`${rootFolder}/atlmfc/include`, "*"));
export const include: StaticDirectory = Transformer.sealDirectory({
root: d`${rootFolder}/atlmfc/include`,
files: globR(d`${rootFolder}/atlmfc/include`, "*")
});
@@public
export const lib: StaticDirectory = Transformer.sealDirectory(mfcLibFolder, globR(mfcLibFolder, "*"));
export const lib: StaticDirectory = Transformer.sealDirectory({
root: mfcLibFolder,
files: globR(mfcLibFolder, "*")
});
}
@@public
export const include: StaticDirectory = Transformer.sealDirectory(
d`${rootFolder}/include`,
globR(d`${rootFolder}/include`, "*"));
export const include: StaticDirectory = Transformer.sealDirectory({
root: d`${rootFolder}/include`,
files: globR(d`${rootFolder}/include`, "*")
});
@@public
export const lib: StaticDirectory = Transformer.sealDirectory(libFolder, globR(libFolder, "*"));
export const lib: StaticDirectory = Transformer.sealDirectory({
root: libFolder,
files: globR(libFolder, "*")
});

Просмотреть файл

@ -128,7 +128,10 @@ function runTest(args : TestRunArguments) : File[] {
testAssembly: args.testDeployment.primaryFile.path,
qTestType: Qtest.QTestType.msTest_latest,
qTestDirToDeploy: args.testDeployment.contents,
qTestAdapterPath: Transformer.sealDirectory(testAdapterPath, globR(testAdapterPath, "*")),
qTestAdapterPath: Transformer.sealDirectory({
root: testAdapterPath,
files: globR(testAdapterPath, "*")
}),
qTestDotNetFramework: Qtest.QTestDotNetFramework.framework45,
qTestPlatform: Qtest.QTestPlatform.x64,
qTestRetryOnFailure: true,

Просмотреть файл

@ -101,13 +101,11 @@ export function runQTest(args: QTestArguments): Result {
args.tags
)
);
qTestDirToDeploy = Transformer.sealDirectory(
qTestDirtoDeployCreated,
copiedFiles,
undefined,
undefined,
true
);
qTestDirToDeploy = Transformer.sealDirectory({
root: qTestDirtoDeployCreated,
files: copiedFiles,
scrub: true,
});
}
// If no qTestInputs is specified, use the qTestDirToDeploy

Просмотреть файл

@ -37,7 +37,10 @@ namespace Sdk.Tests {
Testing.expectFailure(
() =>
{
let sealed = Transformer.sealDirectory(d`src`, [f`src/file1`, f`src/file2`]);
let sealed = Transformer.sealDirectory({
root: d`src`,
files: [f`src/file1`, f`src/file2`]
});
Json.write(p`out.json`, {
s: sealed,
});

Просмотреть файл

@ -5,8 +5,14 @@ import {Assert, Testing} from "Sdk.Testing";
import {Transformer} from "Sdk.Transformers";
namespace Sdk.Tests {
const sealedDirectory1 = Transformer.sealDirectory(d`src/seal1`, [f`src/seal1/file1`]);
const sealedDirectory2 = Transformer.sealDirectory(d`src/seal2`, [f`src/seal2/file2`]);
const sealedDirectory1 = Transformer.sealDirectory({
root: d`src/seal1`,
files: [f`src/seal1/file1`]
});
const sealedDirectory2 = Transformer.sealDirectory({
root: d`src/seal2`,
files: [f`src/seal2/file2`]
});
const mostFields: Transformer.ToolDefinition = {
exe: f`src/tool/tool.exe`,

Просмотреть файл

@ -49,11 +49,17 @@ namespace Sdk.Tests {
// Allowing a loophool for cache inspection.
// We need to add a test-option to diable this validation when we close that loophole.
let full1 = Transformer.sealDirectory(d`Out/Dir1`, [f1a]);
let full1 = Transformer.sealDirectory({
root: d`Out/Dir1`,
files: [f1a]
});
getValueFromCache(full1, "full1");
// Each sealed directory is unique
let full2 = Transformer.sealDirectory(d`Out/Dir1`, [f1a]);
let full2 = Transformer.sealDirectory({
root: d`Out/Dir1`,
files: [f1a]
});
getValueFromCache(full2, "full2");
// Partial is different from full seal

Просмотреть файл

@ -100,7 +100,10 @@ namespace LanguageService.Server {
// This contains the actual extension source as well as the
// node_modules that it depends on.
Transformer.sealDirectory(d`pluginTemplate/extension`, globR(d`pluginTemplate/extension`)),
Transformer.sealDirectory({
root: d`pluginTemplate/extension`,
files: globR(d`pluginTemplate/extension`)
}),
]
},
f`pluginTemplate/[Content_Types].xml`,

Просмотреть файл

@ -59,8 +59,14 @@ namespace Sandbox {
const bundleInfoTestFile = f`BundleInfoTest.xcconfig`;
const isMacOs = Context.getCurrentHost().os === "macOS";
const interopXcodeproj = Transformer.sealDirectory(d`Interop/Interop.xcodeproj`, globR(d`Interop/Interop.xcodeproj`, "*"));
const sandboxXcodeproj = Transformer.sealDirectory(d`Sandbox/Sandbox.xcodeproj`, globR(d`Sandbox/Sandbox.xcodeproj`, "*"));
const interopXcodeproj = Transformer.sealDirectory({
root: d`Interop/Interop.xcodeproj`,
files: globR(d`Interop/Interop.xcodeproj`, "*")
});
const sandboxXcodeproj = Transformer.sealDirectory({
root: d`Sandbox/Sandbox.xcodeproj`,
files: globR(d`Sandbox/Sandbox.xcodeproj`, "*")
});
const ariaPkg = importFrom("Aria.Cpp.SDK.osx-x64");
const ariaXcconfig = Transformer.writeData(