Skip to content

Can not generate Rules.mk using source orbit when there are multiple service programs #158

@rishabkaushik

Description

@rishabkaushik

I am trying to migrate my sources from source files to my local directory. The files are imported correctly but while generating rules I am running into below error.

Error running command vscode-ibmi-projectexplorer.projectExplorer.migrateSource: Request generateBuildFile failed with message: All service programs must be in the same directory.. This is likely caused by the extension that contributes vscode-ibmi-projectexplorer.projectExplorer.migrateSource.

This does not happen when there is only single service program.

I have tried many things and it appears that I am doing something wrong. I am attaching a sample project I have created and replicated the error. I tried to ask on the ibmi-bob repository as well but did not get any response yet and figured this is the correct place as the error is generated here.

if (this.targets.binderRequired()) {
const servicePrograms = this.targets.getResolvedObjects(`SRVPGM`);
const relativePaths = servicePrograms.map(sp => path.dirname(sp.relativePath));
if (relativePaths.length === 1) {
// We know the rules
bnddirRulesDir = relativePaths[0];
} else if (relativePaths.length > 1) {
throw new Error(`All service programs must be in the same directory.`);
}
}

I think the array relativePaths needs to be filtered on unique values before checking if(relativePaths.length === 1) as it will likely to have more than 1 path values. Appears to be a bug.

Sample source: EmpMgmt.zip

Do let me know if anything else is required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bigBig ideasenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions