Skip to content

Commit 0cff644

Browse files
committed
Partial fix
Signed-off-by: worksofliam <[email protected]>
1 parent 382a05f commit 0cff644

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

cli/src/builders/make/index.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ interface Step {
2424
* parents: this property controls the all target. It will include all the parents of partial build objects.
2525
* partial: if this property is true, the makefile will only include targets for the partial build objects (and optionally their parents)
2626
*/
27-
type PartialOptions = { partial: boolean, parents: boolean };
27+
type PartialOptions = { partial?: boolean, parents?: boolean, parentsChildren?: boolean };
2828

2929
interface PartialTargets {
3030
partial: ILEObject[];
3131
children?: ILEObject[];
3232
}
3333

3434
export class MakeProject {
35-
private partialOptions: PartialOptions = { partial: false, parents: false };
35+
private partialOptions: PartialOptions = { partial: false, parents: false, parentsChildren: false };
3636
private settings: iProject = new iProject();
3737
private projectActions: ProjectActions;
3838
private actionsEnabled: boolean = false;
@@ -235,6 +235,8 @@ export class MakeProject {
235235
return;
236236
}
237237

238+
// Gets children of the partial build objects.
239+
let allChildren: ILEObject[]|undefined = this.partialOptions.partial ? this.targets.getRequiredObjects(partialBuild) : undefined;
238240
let allParents: ILEObject[]|undefined;
239241

240242
// we also want to build their parents too. We update `partialBuild`
@@ -256,7 +258,9 @@ export class MakeProject {
256258
partialBuild = allParents;
257259
}
258260

259-
let allChildren: ILEObject[]|undefined = this.partialOptions.partial ? this.targets.getRequiredObjects(partialBuild) : undefined;
261+
if (this.partialOptions.parentsChildren) {
262+
allChildren = this.targets.getRequiredObjects(partialBuild);
263+
}
260264

261265
return {
262266
partial: partialBuild,

cli/src/cli.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export let cliSettings = {
1212
userBranch: ``,
1313
makefileIsPartial: false,
1414
makefileWithParents: false,
15+
makefileWithParentsChildren: false,
1516
assumeSourcesArePrograms: false,
1617
};
1718

cli/src/index.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ async function main() {
7777
cliSettings.makefileWithParents = true;
7878
break;
7979

80+
case `-wpc`:
81+
case `--with-parents-children`:
82+
cliSettings.makefileWithParentsChildren = true;
83+
break;
84+
8085
case '-ap':
8186
case '--assume-programs':
8287
cliSettings.assumeSourcesArePrograms = true;
@@ -248,7 +253,8 @@ async function main() {
248253

249254
makeProj.setPartialOptions({
250255
partial: cliSettings.makefileIsPartial,
251-
parents: cliSettings.makefileWithParents
256+
parents: cliSettings.makefileWithParents,
257+
parentsChildren: cliSettings.makefileWithParentsChildren
252258
})
253259

254260
let specificObjects: ILEObject[] | undefined = cliSettings.lookupFiles ? cliSettings.lookupFiles.map(f => targets.getResolvedObject(path.join(cwd, f))).filter(o => o) : undefined;

cli/test/cs_with_bnddir.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,17 @@ describe(`pseudo tests`, () => {
105105

106106
const nept = resolvedObjects.find(f => f.systemName === `NEMP` && f.type === `FILE`);
107107
const targetsOut = makefile.generateTargets([nept]).join(`\n`);
108+
console.log(targetsOut);
108109

109110
expect(targetsOut).toContain(`all: .logs .evfevent library $(PREPATH)/NEMP.FILE $(PREPATH)/NEWEMP.PGM $(PREPATH)/DEPTS.PGM`);
110111
expect(targetsOut).not.toContain(`$(PREPATH)/NEWEMP.PGM:`);
111112

112113
const rules = makefile.generateGenericRules([nept]).join(`\n`);
113114
console.log(rules);
115+
116+
expect(rules).toContain(`$(PREPATH)/NEMP.FILE:`);
117+
expect(rules).toContain(`$(PREPATH)/NEWEMP.PGM:`);
118+
expect(rules).toContain(`$(PREPATH)/DEPTS.PGM:`);
114119
});
115120

116121
test('ibmi-bob rules', () => {

0 commit comments

Comments
 (0)