From 382a05fbedc71e5594c534db6ba08b655614212d Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 28 Jul 2025 09:51:28 -0400 Subject: [PATCH 1/7] Create test case to show problem Signed-off-by: worksofliam --- cli/test/cs_with_bnddir.test.ts | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/cli/test/cs_with_bnddir.test.ts b/cli/test/cs_with_bnddir.test.ts index 57208e2..e986b26 100644 --- a/cli/test/cs_with_bnddir.test.ts +++ b/cli/test/cs_with_bnddir.test.ts @@ -75,7 +75,7 @@ describe(`pseudo tests`, () => { expect(employees.deps.find(f => f.systemName === `EMPLOYEE` && f.type === `FILE`)).toBeDefined(); }); - test('makefile', async () => { + test('makefile', async () => { const makefile = new MakeProject(targets.getCwd(), targets, fs); await makefile.setupSettings(); @@ -96,6 +96,23 @@ describe(`pseudo tests`, () => { expect(steps.length).toBe(8); }); + test('makefile partial', async () => { + const makefile = new MakeProject(targets.getCwd(), targets, fs); + makefile.setPartialOptions({partial: true, parents: true}); + await makefile.setupSettings(); + + const resolvedObjects = targets.getResolvedObjects(); + + const nept = resolvedObjects.find(f => f.systemName === `NEMP` && f.type === `FILE`); + const targetsOut = makefile.generateTargets([nept]).join(`\n`); + + expect(targetsOut).toContain(`all: .logs .evfevent library $(PREPATH)/NEMP.FILE $(PREPATH)/NEWEMP.PGM $(PREPATH)/DEPTS.PGM`); + expect(targetsOut).not.toContain(`$(PREPATH)/NEWEMP.PGM:`); + + const rules = makefile.generateGenericRules([nept]).join(`\n`); + console.log(rules); + }); + test('ibmi-bob rules', () => { const bobProject = new BobProject(targets); From 0cff6444fa9dd11bd6216e955b04eab4e3e0561c Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 28 Jul 2025 10:13:05 -0400 Subject: [PATCH 2/7] Partial fix Signed-off-by: worksofliam --- cli/src/builders/make/index.ts | 10 +++++++--- cli/src/cli.ts | 1 + cli/src/index.ts | 8 +++++++- cli/test/cs_with_bnddir.test.ts | 5 +++++ 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/cli/src/builders/make/index.ts b/cli/src/builders/make/index.ts index 9d865aa..a2ab14d 100644 --- a/cli/src/builders/make/index.ts +++ b/cli/src/builders/make/index.ts @@ -24,7 +24,7 @@ interface Step { * parents: this property controls the all target. It will include all the parents of partial build objects. * partial: if this property is true, the makefile will only include targets for the partial build objects (and optionally their parents) */ -type PartialOptions = { partial: boolean, parents: boolean }; +type PartialOptions = { partial?: boolean, parents?: boolean, parentsChildren?: boolean }; interface PartialTargets { partial: ILEObject[]; @@ -32,7 +32,7 @@ interface PartialTargets { } export class MakeProject { - private partialOptions: PartialOptions = { partial: false, parents: false }; + private partialOptions: PartialOptions = { partial: false, parents: false, parentsChildren: false }; private settings: iProject = new iProject(); private projectActions: ProjectActions; private actionsEnabled: boolean = false; @@ -235,6 +235,8 @@ export class MakeProject { return; } + // Gets children of the partial build objects. + let allChildren: ILEObject[]|undefined = this.partialOptions.partial ? this.targets.getRequiredObjects(partialBuild) : undefined; let allParents: ILEObject[]|undefined; // we also want to build their parents too. We update `partialBuild` @@ -256,7 +258,9 @@ export class MakeProject { partialBuild = allParents; } - let allChildren: ILEObject[]|undefined = this.partialOptions.partial ? this.targets.getRequiredObjects(partialBuild) : undefined; + if (this.partialOptions.parentsChildren) { + allChildren = this.targets.getRequiredObjects(partialBuild); + } return { partial: partialBuild, diff --git a/cli/src/cli.ts b/cli/src/cli.ts index a057ec0..d659728 100644 --- a/cli/src/cli.ts +++ b/cli/src/cli.ts @@ -12,6 +12,7 @@ export let cliSettings = { userBranch: ``, makefileIsPartial: false, makefileWithParents: false, + makefileWithParentsChildren: false, assumeSourcesArePrograms: false, }; diff --git a/cli/src/index.ts b/cli/src/index.ts index d9a1ef7..a0c62e4 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -77,6 +77,11 @@ async function main() { cliSettings.makefileWithParents = true; break; + case `-wpc`: + case `--with-parents-children`: + cliSettings.makefileWithParentsChildren = true; + break; + case '-ap': case '--assume-programs': cliSettings.assumeSourcesArePrograms = true; @@ -248,7 +253,8 @@ async function main() { makeProj.setPartialOptions({ partial: cliSettings.makefileIsPartial, - parents: cliSettings.makefileWithParents + parents: cliSettings.makefileWithParents, + parentsChildren: cliSettings.makefileWithParentsChildren }) let specificObjects: ILEObject[] | undefined = cliSettings.lookupFiles ? cliSettings.lookupFiles.map(f => targets.getResolvedObject(path.join(cwd, f))).filter(o => o) : undefined; diff --git a/cli/test/cs_with_bnddir.test.ts b/cli/test/cs_with_bnddir.test.ts index e986b26..adb9016 100644 --- a/cli/test/cs_with_bnddir.test.ts +++ b/cli/test/cs_with_bnddir.test.ts @@ -105,12 +105,17 @@ describe(`pseudo tests`, () => { const nept = resolvedObjects.find(f => f.systemName === `NEMP` && f.type === `FILE`); const targetsOut = makefile.generateTargets([nept]).join(`\n`); + console.log(targetsOut); expect(targetsOut).toContain(`all: .logs .evfevent library $(PREPATH)/NEMP.FILE $(PREPATH)/NEWEMP.PGM $(PREPATH)/DEPTS.PGM`); expect(targetsOut).not.toContain(`$(PREPATH)/NEWEMP.PGM:`); const rules = makefile.generateGenericRules([nept]).join(`\n`); console.log(rules); + + expect(rules).toContain(`$(PREPATH)/NEMP.FILE:`); + expect(rules).toContain(`$(PREPATH)/NEWEMP.PGM:`); + expect(rules).toContain(`$(PREPATH)/DEPTS.PGM:`); }); test('ibmi-bob rules', () => { From 5aa4a91f8df4791658df1f35b96d2cae36e8b043 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 28 Jul 2025 15:36:12 -0400 Subject: [PATCH 3/7] Granular makefile options Signed-off-by: worksofliam --- cli/src/builders/make/index.ts | 73 ++++++++++++++++++++-------------- cli/src/targets/index.ts | 2 +- 2 files changed, 45 insertions(+), 30 deletions(-) diff --git a/cli/src/builders/make/index.ts b/cli/src/builders/make/index.ts index a2ab14d..13f1b9e 100644 --- a/cli/src/builders/make/index.ts +++ b/cli/src/builders/make/index.ts @@ -24,15 +24,19 @@ interface Step { * parents: this property controls the all target. It will include all the parents of partial build objects. * partial: if this property is true, the makefile will only include targets for the partial build objects (and optionally their parents) */ -type PartialOptions = { partial?: boolean, parents?: boolean, parentsChildren?: boolean }; +type PartialOptions = { + parents?: boolean, + withChildren?: boolean, + parentsChildren?: boolean +}; interface PartialTargets { - partial: ILEObject[]; - children?: ILEObject[]; + targets: ILEObject[]; + children: ILEObject[]; } export class MakeProject { - private partialOptions: PartialOptions = { partial: false, parents: false, parentsChildren: false }; + private partialOptions: PartialOptions|undefined private settings: iProject = new iProject(); private projectActions: ProjectActions; private actionsEnabled: boolean = false; @@ -235,36 +239,37 @@ export class MakeProject { return; } - // Gets children of the partial build objects. - let allChildren: ILEObject[]|undefined = this.partialOptions.partial ? this.targets.getRequiredObjects(partialBuild) : undefined; - let allParents: ILEObject[]|undefined; + let children: ILEObject[] = []; // we also want to build their parents too. We update `partialBuild` // to include all the parents of the specific objects. - if (this.partialOptions.parents) { - allParents = []; - const impacts = partialBuild.map(o => this.targets.getImpactFor(o)); - - const addImpact = (impactedObj: ImpactedObject) => { - if (!allParents.some(o => o.systemName === impactedObj.ileObject.systemName && o.type === impactedObj.ileObject.type)) { - allParents.push(impactedObj.ileObject); - } + + const allParents: ILEObject[] = []; + const impacts = partialBuild.map(o => this.targets.getImpactFor(o)); - impactedObj.children.forEach(child => addImpact(child)); + const addImpact = (impactedObj: ImpactedObject) => { + if (!allParents.some(o => o.systemName === impactedObj.ileObject.systemName && o.type === impactedObj.ileObject.type)) { + allParents.push(impactedObj.ileObject); } - impacts.forEach(impact => addImpact(impact)); - - partialBuild = allParents; + impactedObj.children.forEach(child => addImpact(child)); } + impacts.forEach(impact => addImpact(impact)); + if (this.partialOptions.parentsChildren) { - allChildren = this.targets.getRequiredObjects(partialBuild); + children = this.targets.getRequiredChildren(allParents); + } else if (this.partialOptions.withChildren) { + children = this.targets.getRequiredChildren(partialBuild); + } + + if (this.partialOptions.parents) { + partialBuild = allParents; } return { - partial: partialBuild, - children: allChildren + targets: partialBuild, + children: children } } @@ -275,7 +280,7 @@ export class MakeProject { const buildObjects = this.getPartialTargets(partialBuild); if (buildObjects) { - partialBuild = buildObjects.partial; + partialBuild = buildObjects.targets; } // If we are in partial mode, we only want to generate targets for the specific objects @@ -292,9 +297,19 @@ export class MakeProject { ) } - if (buildObjects && buildObjects.children) { + let allTargetObjects: ILEObject[]|undefined = undefined; + if (this.partialOptions && buildObjects) { + allTargetObjects = []; + if (this.partialOptions.parentsChildren) { + allTargetObjects = partialBuild.concat(buildObjects.children || []).filter((t, i, self) => self.indexOf(t) === i); + } else if (this.partialOptions.withChildren) { + allTargetObjects = buildObjects.children.filter((t, i, self) => self.indexOf(t) === i); + } + } + + if (allTargetObjects) { // If we don't want the children to get built, we only generate the targets for the specific objects - for (const obj of buildObjects.children) { + for (const obj of allTargetObjects) { if (obj.reference) continue; // Skip references const target = this.targets.getTarget(obj); @@ -328,13 +343,13 @@ export class MakeProject { return lines; } - public generateGenericRules(partialBuild?: ILEObject[]): string[] { + public generateGenericRules(buildFor?: ILEObject[]): string[] { let lines = []; - const buildObjects = this.getPartialTargets(partialBuild); + const buildObjects = this.getPartialTargets(buildFor); if (buildObjects) { - partialBuild = buildObjects.partial; + buildFor = buildObjects.children.concat(buildObjects.targets); } for (const entry of Object.entries(this.settings.compiles)) { @@ -380,7 +395,7 @@ export class MakeProject { for (const ileObject of objects) { if (ileObject.reference) continue; - if (buildObjects && buildObjects.children && !buildObjects.children.some(o => o.systemName === ileObject.systemName && o.type === ileObject.type)) { + if (buildFor && !buildFor.some(o => o.systemName === ileObject.systemName && o.type === ileObject.type)) { continue; // Skip this object } diff --git a/cli/src/targets/index.ts b/cli/src/targets/index.ts index ea16834..ef51095 100644 --- a/cli/src/targets/index.ts +++ b/cli/src/targets/index.ts @@ -762,7 +762,7 @@ export class Targets { /** * Returns a list of all the required objects to build this target */ - public getRequiredObjects(bases: (ILEObject|ILEObjectTarget)[]) { + public getRequiredChildren(bases: (ILEObject|ILEObjectTarget)[]) { let deps: ILEObject[] = []; const addDep = (dep: ILEObject|ILEObjectTarget) => { From 8a3b244e511dae2f558911019e8d7490549a87c6 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 28 Jul 2025 15:36:32 -0400 Subject: [PATCH 4/7] Test cases to prove granular makefiles Signed-off-by: worksofliam --- cli/test/cs_srvpgm.test.ts | 4 +- cli/test/cs_with_bnddir.test.ts | 89 ++++++++++++++++++++++++++++++++- cli/test/make.test.ts | 4 +- cli/test/project.test.ts | 6 +-- cli/test/project2.test.ts | 6 +-- 5 files changed, 97 insertions(+), 12 deletions(-) diff --git a/cli/test/cs_srvpgm.test.ts b/cli/test/cs_srvpgm.test.ts index 0f94020..6e2890b 100644 --- a/cli/test/cs_srvpgm.test.ts +++ b/cli/test/cs_srvpgm.test.ts @@ -54,7 +54,7 @@ describe(`pseudo tests`, () => { expect(empdet.deps.find(f => f.systemName === `EMPLOYEE`)).toBeDefined(); expect(empdet.deps.find(f => f.systemName === `DEPARTMENT`)).toBeDefined(); - const allRequirements = targets.getRequiredObjects([empdet]); + const allRequirements = targets.getRequiredChildren([empdet]); expect(allRequirements.length).toBe(3); expect(allRequirements.find(f => f.systemName === `EMPLOYEE` && f.type === `FILE`)).toBeDefined(); expect(allRequirements.find(f => f.systemName === `DEPARTMENT` && f.type === `FILE`)).toBeDefined(); @@ -69,7 +69,7 @@ describe(`pseudo tests`, () => { expect(employees.deps.find(f => f.systemName === `EMPS` && f.type === `FILE`)).toBeDefined(); expect(employees.deps.find(f => f.systemName === `EMPLOYEE` && f.type === `FILE`)).toBeDefined(); - const requiredForEmployees = targets.getRequiredObjects([employees]); + const requiredForEmployees = targets.getRequiredChildren([employees]); expect(requiredForEmployees.length).toBe(6); expect(requiredForEmployees.find(f => f.systemName === `EMPLOYEES` && f.type === `PGM`)).toBeDefined(); diff --git a/cli/test/cs_with_bnddir.test.ts b/cli/test/cs_with_bnddir.test.ts index adb9016..ce37ce8 100644 --- a/cli/test/cs_with_bnddir.test.ts +++ b/cli/test/cs_with_bnddir.test.ts @@ -96,9 +96,70 @@ describe(`pseudo tests`, () => { expect(steps.length).toBe(8); }); - test('makefile partial', async () => { + test('makefile partial (without parents, object has no children)', async () => { const makefile = new MakeProject(targets.getCwd(), targets, fs); - makefile.setPartialOptions({partial: true, parents: true}); + makefile.setPartialOptions({parents: false}); + await makefile.setupSettings(); + + const resolvedObjects = targets.getResolvedObjects(); + + const nept = resolvedObjects.find(f => f.systemName === `NEMP` && f.type === `FILE`); + const targetsOut = makefile.generateTargets([nept]).join(`\n`); + console.log(targetsOut); + + expect(targetsOut).toContain(`all: .logs .evfevent library $(PREPATH)/NEMP.FILE`); + expect(targetsOut).not.toContain(`$(PREPATH)/NEWEMP.PGM:`); + + const rules = makefile.generateGenericRules([nept]).join(`\n`); + console.log(rules); + + expect(rules).toContain(`$(PREPATH)/NEMP.FILE:`); + }); + + test('makefile partial (without parents, object with children)', async () => { + const makefile = new MakeProject(targets.getCwd(), targets, fs); + makefile.setPartialOptions({parents: false, withChildren: true}); + await makefile.setupSettings(); + + const resolvedObjects = targets.getResolvedObjects(); + + const nept = resolvedObjects.find(f => f.systemName === `NEWEMP` && f.type === `PGM`); + const targetsOut = makefile.generateTargets([nept]).join(`\n`); + console.log(targetsOut); + + expect(targetsOut).toContain(`all: .logs .evfevent library $(PREPATH)/NEWEMP.PGM`); + expect(targetsOut).toContain(`$(PREPATH)/NEWEMP.PGM:`); + + const rules = makefile.generateGenericRules([nept]).join(`\n`); + console.log(rules); + + expect(rules).toContain(`$(PREPATH)/NEMP.FILE:`); + }); + + test('makefile partial (without parents, object with children, but using withChildren false)', async () => { + const makefile = new MakeProject(targets.getCwd(), targets, fs); + makefile.setPartialOptions({parents: false, withChildren: false}); + await makefile.setupSettings(); + + const resolvedObjects = targets.getResolvedObjects(); + + const nept = resolvedObjects.find(f => f.systemName === `NEWEMP` && f.type === `PGM`); + const targetsOut = makefile.generateTargets([nept]).join(`\n`); + console.log(targetsOut); + + expect(targetsOut).toContain(`all: .logs .evfevent library $(PREPATH)/NEWEMP.PGM`); + expect(targetsOut).not.toContain(`$(PREPATH)/NEWEMP.PGM:`); + + const rules = makefile.generateGenericRules([nept]).join(`\n`); + console.log(rules); + + expect(rules).not.toContain(`$(PREPATH)/NEMP.FILE:`); + expect(rules).toContain(`$(PREPATH)/NEWEMP.PGM: qrpglesrc/newemp.pgm.sqlrpgle`); + }); + + test('makefile partial (with parents)', async () => { + const makefile = new MakeProject(targets.getCwd(), targets, fs); + makefile.setPartialOptions({parents: true}); await makefile.setupSettings(); const resolvedObjects = targets.getResolvedObjects(); @@ -116,6 +177,30 @@ describe(`pseudo tests`, () => { expect(rules).toContain(`$(PREPATH)/NEMP.FILE:`); expect(rules).toContain(`$(PREPATH)/NEWEMP.PGM:`); expect(rules).toContain(`$(PREPATH)/DEPTS.PGM:`); + expect(rules).not.toContain(`$(PREPATH)/EMPLOYEES.PGM:`); + }); + + test('makefile partial (with parents, and children parent)', async () => { + const makefile = new MakeProject(targets.getCwd(), targets, fs); + makefile.setPartialOptions({parents: true, parentsChildren: true}); + await makefile.setupSettings(); + + const resolvedObjects = targets.getResolvedObjects(); + + const nept = resolvedObjects.find(f => f.systemName === `NEMP` && f.type === `FILE`); + const targetsOut = makefile.generateTargets([nept]).join(`\n`); + console.log(targetsOut); + + expect(targetsOut).toContain(`all: .logs .evfevent library $(PREPATH)/NEMP.FILE $(PREPATH)/NEWEMP.PGM $(PREPATH)/DEPTS.PGM`); + expect(targetsOut).toContain(`$(PREPATH)/NEWEMP.PGM: $(PREPATH)/EMPLOYEE.FILE $(PREPATH)/NEMP.FILE`); + + const rules = makefile.generateGenericRules([nept]).join(`\n`); + console.log(rules); + + expect(rules).toContain(`$(PREPATH)/NEMP.FILE:`); + expect(rules).toContain(`$(PREPATH)/NEWEMP.PGM:`); + expect(rules).toContain(`$(PREPATH)/DEPTS.PGM:`); + expect(rules).toContain(`$(PREPATH)/EMPLOYEES.PGM:`); }); test('ibmi-bob rules', () => { diff --git a/cli/test/make.test.ts b/cli/test/make.test.ts index 83bda47..754e712 100644 --- a/cli/test/make.test.ts +++ b/cli/test/make.test.ts @@ -191,7 +191,7 @@ test('generateTargets (post-resolve)', async () => { const project = new MakeProject(cwd, targets, new ReadFileSystem()); const srvpgma = targets.getTarget({systemName: `SRVPGMA`, type: `SRVPGM`}); - const srvpgmaRequirements = targets.getRequiredObjects([srvpgma]); + const srvpgmaRequirements = targets.getRequiredChildren([srvpgma]); expect(srvpgmaRequirements.length).toBe(3); expect(srvpgmaRequirements.map(r => r.systemName)).toEqual([ `FILEB`, @@ -199,7 +199,7 @@ test('generateTargets (post-resolve)', async () => { `SRVPGMA` ]); - project.setPartialOptions({partial: true, parents: false}); + project.setPartialOptions({withChildren: true}); const targetContent = project.generateTargets([srvpgma]); diff --git a/cli/test/project.test.ts b/cli/test/project.test.ts index 67b7d7c..ad3258d 100644 --- a/cli/test/project.test.ts +++ b/cli/test/project.test.ts @@ -308,7 +308,7 @@ describe(`company_system tests`, () => { const makeProject = new MakeProject(project.cwd, targets, fs); await makeProject.setupSettings(); - makeProject.setPartialOptions({partial: true, parents: true}); + makeProject.setPartialOptions({withChildren: true, parents: true}); const deptsFile = targets.getTarget({systemName: `DEPTS`, type: `FILE`}); @@ -325,7 +325,7 @@ describe(`company_system tests`, () => { const makeProject = new MakeProject(project.cwd, targets, fs); await makeProject.setupSettings(); - makeProject.setPartialOptions({partial: false, parents: true}); + makeProject.setPartialOptions({withChildren: true, parents: true}); const empFile = targets.getTarget({systemName: `EMPLOYEE`, type: `FILE`}); @@ -351,7 +351,7 @@ describe(`company_system tests`, () => { const makeProject = new MakeProject(project.cwd, targets, fs); await makeProject.setupSettings(); - makeProject.setPartialOptions({partial: false, parents: true}); + makeProject.setPartialOptions({withChildren: true, parents: true}); const deptsFile = targets.getTarget({systemName: `EMPLOYEE`, type: `FILE`}); diff --git a/cli/test/project2.test.ts b/cli/test/project2.test.ts index 35a66f2..6874dcd 100644 --- a/cli/test/project2.test.ts +++ b/cli/test/project2.test.ts @@ -302,7 +302,7 @@ describe(`company_system tests`, () => { const makeProject = new MakeProject(project.cwd, targets, fs); await makeProject.setupSettings(); - makeProject.setPartialOptions({partial: false, parents: true}); + makeProject.setPartialOptions({withChildren: true, parents: true}); const deptsFile = targets.getTarget({systemName: `DEPTS`, type: `FILE`}); @@ -319,7 +319,7 @@ describe(`company_system tests`, () => { const makeProject = new MakeProject(project.cwd, targets, fs); await makeProject.setupSettings(); - makeProject.setPartialOptions({partial: false, parents: true}); + makeProject.setPartialOptions({withChildren: true, parents: true}); const employeeFile = targets.getTarget({systemName: `EMPLOYEE`, type: `FILE`}); @@ -347,7 +347,7 @@ describe(`company_system tests`, () => { const makeProject = new MakeProject(project.cwd, targets, fs); await makeProject.setupSettings(); - makeProject.setPartialOptions({partial: false, parents: true}); + makeProject.setPartialOptions({withChildren: true, parents: true}); const empFile = targets.getTarget({systemName: `EMPLOYEE`, type: `FILE`}); From 7513af065321cdd19afb4f7d8710883ba8cf1462 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 28 Jul 2025 15:42:21 -0400 Subject: [PATCH 5/7] Update CLI options for granular makefiles Signed-off-by: worksofliam --- cli/src/cli.ts | 2 +- cli/src/index.ts | 33 +++++++++++++++++---------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/cli/src/cli.ts b/cli/src/cli.ts index d659728..964850e 100644 --- a/cli/src/cli.ts +++ b/cli/src/cli.ts @@ -10,7 +10,7 @@ export let cliSettings = { autoRename: false, lookupFiles: undefined as string[]|undefined, userBranch: ``, - makefileIsPartial: false, + makefileWithChildren: true, makefileWithParents: false, makefileWithParentsChildren: false, assumeSourcesArePrograms: false, diff --git a/cli/src/index.ts b/cli/src/index.ts index a0c62e4..6ddeca9 100644 --- a/cli/src/index.ts +++ b/cli/src/index.ts @@ -64,12 +64,7 @@ async function main() { case '-nc': case '--no-children': - warningOut(`--no-children is deprecated and is default when doing partial builds.`); - break; - - case `-ip`: - case `--is-partial`: - cliSettings.makefileIsPartial = true; + cliSettings.makefileWithChildren = false; break; case `-wp`: @@ -142,12 +137,16 @@ async function main() { console.log(``); console.log(`Options specific to '-bf make':`); console.log(``); - console.log(`\t-ip`); - console.log(`\t--is-partial\tWill only generate targets that are needed for`); - console.log(`\t\t\tthe objects that are being built.`); - console.log(``); console.log(`\t-wp`); - console.log(`\t--with-parents\tUsed with '-bf make' and will add parents of`); + console.log(`\t--with-parents\tWill add parents of`); + console.log(`\t\t\tobjects being partially built to the makefile.`); + console.log(``); + console.log(`\t-wpc`); + console.log(`\t--with-parents-children\tWill add children of parents`); + console.log(`\t\t\t\tto makefile.`); + console.log(``); + console.log(`\t-nc`); + console.log(`\t--no-children\tWill not add children of`); console.log(`\t\t\tobjects being partially built to the makefile.`); console.log(``); process.exit(0); @@ -251,11 +250,13 @@ async function main() { await makeProj.setupSettings(); - makeProj.setPartialOptions({ - partial: cliSettings.makefileIsPartial, - parents: cliSettings.makefileWithParents, - parentsChildren: cliSettings.makefileWithParentsChildren - }) + if (cliSettings.lookupFiles) { + makeProj.setPartialOptions({ + withChildren: cliSettings.makefileWithChildren, + parents: cliSettings.makefileWithParents, + parentsChildren: cliSettings.makefileWithParentsChildren + }); + } let specificObjects: ILEObject[] | undefined = cliSettings.lookupFiles ? cliSettings.lookupFiles.map(f => targets.getResolvedObject(path.join(cwd, f))).filter(o => o) : undefined; writeFileSync(path.join(cwd, `makefile`), makeProj.getMakefile(specificObjects).join(`\n`)); From e418695dd31619cb5f064da979e1270e1fcd272d Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 28 Jul 2025 15:45:49 -0400 Subject: [PATCH 6/7] Update docs Signed-off-by: worksofliam --- docs/pages/cli/make.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pages/cli/make.md b/docs/pages/cli/make.md index 7a8c330..94d9d65 100644 --- a/docs/pages/cli/make.md +++ b/docs/pages/cli/make.md @@ -31,12 +31,12 @@ Usually, parents always need to be rebuilt to ensure level checking happens. If When you use `so -bf make`, you can specify the following parameters to control the incremental build: * `-f`/`-l` to specify the list of sources to build. This can be a single file or a list of files. - * `so -bf make -f qrpglesrc/employees.pgm.sqlrpgle` will build the `EMPLOYEES.PGM` object. -* With `-ip` (is-partial), then only the specified objects and its dependents will be put into the `makefile`. - * `so -bf make -f qrpglesrc/employees.pgm.sqlrpgle -ip` - * This will generate a makefile only for the specific objects. + * `so -bf make -f qrpglesrc/employees.pgm.sqlrpgle` will build the `EMPLOYEES.PGM` object and the children for that object. + * Use option `-nc` (no-children) to not include children in the build. * With `-wp` (with-parents), then the parents of the specified objects will also be included in the `makefile`. - * `so -bf make -f qrpglesrc/employees.pgm.sqlrpgle -ip -wp` + * `so -bf make -f qrpglesrc/employees.pgm.sqlrpgle -wp` +* With `-wpc` (with-parents-children), then the parents and children of the specified objects will also be included in the `makefile`. + * `so -bf make -f qrpglesrc/employees.pgm.sqlrpgle -wpc` ### General rule for builds From 04d36d474a54286212ef2b38e4bfa6f35ff3c0c1 Mon Sep 17 00:00:00 2001 From: worksofliam Date: Mon, 28 Jul 2025 15:52:18 -0400 Subject: [PATCH 7/7] Remove random log from include resolver Signed-off-by: worksofliam --- cli/src/targets/languages/rpgle.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/cli/src/targets/languages/rpgle.ts b/cli/src/targets/languages/rpgle.ts index 6f46cee..9dd6617 100644 --- a/cli/src/targets/languages/rpgle.ts +++ b/cli/src/targets/languages/rpgle.ts @@ -437,7 +437,6 @@ function setupParser(targets: Targets): Parser { } } else if (!includeFile.includes(`/`)) { const parent = path.basename(path.dirname(baseFile)); - console.log(parent); includeFile = `${parent}/${includeFile}`;