Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions buildtask/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,19 +141,23 @@ async function run() {

// Update output directory
removeProperty("Bld_localDestDirType", buildSpecification);
console.log("Get local destination directory property named 'Bld_localDestDir'...")
var localDestDirProp = (<IProperty[]>buildSpecification.Property).filter(prop => prop.attr_Name == "Bld_localDestDir")[0];
var oldDestDir = localDestDirProp.text;
console.log("Old output folder: ", oldDestDir);
var newDestPath = "/" + outputDirectory.replace(/\\/g, "/").replace(":", "");
console.log("New output folder:", newDestPath);

// Update all Destination paths
var count =parseInt((<IProperty[]>buildSpecification.Property).filter(prop => prop.attr_Name == "DestinationCount")[0].text);
console.log("Get property 'DestinationCount'...")
var count = parseInt((<IProperty[]>buildSpecification.Property).filter(prop => prop.attr_Name == "DestinationCount")[0].text);
for (let index = 0; index < count; index++) {
setOrAdd(new Property("Destination["+ index +"].path.type", "Str", "&lt;none&gt;"), buildSpecification);
}
console.log('Destination paths updated');

// Write back
console.log("Writing XML...");
var toXml = new parserToXml(options);
var xml = <string>toXml.parse(obj);

Expand Down Expand Up @@ -203,8 +207,10 @@ function setOrAdd(newProperty: IProperty, item: Item) {
}
}

function removeProperty(propertyName:string, item:Item){
function removeProperty(propertyName:string, item:Item){
console.log("Removing property... "+propertyName)
item.Property = (<Property[]>item.Property).filter(prop => prop.attr_Name != propertyName);
console.log(" ...Removed!");
}

function getTarget(name: string, lvFile: LvFile): Item {
Expand Down