Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MPS-37250: Single make task should respect generator options #75

Open
wants to merge 1 commit into
base: 2022.3
Choose a base branch
from
Open
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="-dd3y57i4k05x766t80dufdxpgdg3rtn">
<product version="3" modelHash="-bt39myhp2gn5rgcak9agdxrpifpum7o">
<files names="Generator.java" />
</product>

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<product version="3" modelHash="d957lm10wl4p2ianhkahzao786dq0pz">
<product version="3" modelHash="bx36ocr7vee59ir3jbmp3l6jzrmwcb2">
<files names="QueriesGenerated.java" />
</product>

Original file line number Diff line number Diff line change
Expand Up @@ -664,21 +664,24 @@ public static Object propertyMacro_GetValue_10_24(final PropertyMacroContext _co
return "-Xmx" + heapSize + "m";
}
public static Object propertyMacro_GetValue_10_25(final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
return ((String) _context.getVariable("var:generatorOptions"));
}
public static Object propertyMacro_GetValue_10_26(final PropertyMacroContext _context) {
return "${" + SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "}";
return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
}
public static Object propertyMacro_GetValue_10_27(final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), PROPS.path$oN2q);
return "${" + SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "}";
}
public static Object propertyMacro_GetValue_10_28(final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), PROPS.path$oN2q);
}
public static Object propertyMacro_GetValue_10_29(final PropertyMacroContext _context) {
return (String) BuildSourcePath__BehaviorDescriptor.getAntPath_id7ro1ZztyOh5.invoke(SLinkOperations.getTarget(_context.getNode(), LINKS.path$iYKB), Context.defaultContext(_context));
return SPropertyOperations.getString(_context.getNode(), PROPS.path$oN2q);
}
public static Object propertyMacro_GetValue_10_30(final PropertyMacroContext _context) {
return (String) BuildSourcePath__BehaviorDescriptor.getAntPath_id7ro1ZztyOh5.invoke(SLinkOperations.getTarget(_context.getNode(), LINKS.path$iYKB), Context.defaultContext(_context));
}
public static Object propertyMacro_GetValue_10_31(final PropertyMacroContext _context) {
SNode mpsAspect = Sequence.fromIterable(SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.aspects$6r0Q), CONCEPTS.BuildMpsAspect$Ey)).first();

int heapSize;
Expand All @@ -692,23 +695,23 @@ public static Object propertyMacro_GetValue_10_30(final PropertyMacroContext _co

return "-Xmx" + heapSize + "m";
}
public static Object propertyMacro_GetValue_10_31(final PropertyMacroContext _context) {
public static Object propertyMacro_GetValue_10_32(final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL);
}
public static Object propertyMacro_GetValue_10_32(final PropertyMacroContext _context) {
public static Object propertyMacro_GetValue_10_33(final PropertyMacroContext _context) {
return "${" + SPropertyOperations.getString(_context.getNode(), PROPS.name$MnvL) + "}";
}
public static Object propertyMacro_GetValue_10_33(final PropertyMacroContext _context) {
public static Object propertyMacro_GetValue_10_34(final PropertyMacroContext _context) {
return SPropertyOperations.getString(SNodeOperations.cast(ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.aspects$6r0Q)).findFirst(new IWhereFilter<SNode>() {
public boolean accept(SNode it) {
return SNodeOperations.isInstanceOf(it, CONCEPTS.BuildMpsAspect$Ey);
}
}), CONCEPTS.BuildMpsAspect$Ey), PROPS.excludes$mj5k);
}
public static Object propertyMacro_GetValue_10_34(final PropertyMacroContext _context) {
public static Object propertyMacro_GetValue_10_35(final PropertyMacroContext _context) {
return (String) BuildSourcePath__BehaviorDescriptor.getAntPath_id7ro1ZztyOh5.invoke(SLinkOperations.getTarget(_context.getNode(), LINKS.path$zL7z), Context.defaultContext(_context));
}
public static Object propertyMacro_GetValue_10_35(final PropertyMacroContext _context) {
public static Object propertyMacro_GetValue_10_36(final PropertyMacroContext _context) {
return SPropertyOperations.getString(_context.getNode(), PROPS.path$URGX);
}
public static Object propertyMacro_GetValue_12_0(final PropertyMacroContext _context) {
Expand Down Expand Up @@ -1087,19 +1090,22 @@ public static boolean ifMacro_Condition_10_5(final IfMacroContext _context) {
return ((SNode) _context.getVariable("var:compilerOptions")) != null && isNotEmptyString(SPropertyOperations.getString(((SNode) _context.getVariable("var:compilerOptions")), PROPS.javaLevel$8zbK));
}
public static boolean ifMacro_Condition_10_6(final IfMacroContext _context) {
return ((String) _context.getVariable("var:generatorOptions")) != null;
}
public static boolean ifMacro_Condition_10_7(final IfMacroContext _context) {
// XXX the reason I decided to put <mps.make> as alternative to <generate> as a start is
// to avoid deep dive into common/java/mps task dependencies and how to switch to a different set.
// Instead, just stick to present workflow
return SPropertyOperations.getBoolean(Sequence.fromIterable(SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.plugins$AsCR), CONCEPTS.BuildMPSPlugin$YW)).first(), PROPS.useMakeTask$aRFt);
}
public static boolean ifMacro_Condition_10_7(final IfMacroContext _context) {
public static boolean ifMacro_Condition_10_8(final IfMacroContext _context) {
return Sequence.fromIterable(((MPSModulesPartitioner) _context.getVariable("var:closure")).getExternal()).isNotEmpty();
}
public static boolean ifMacro_Condition_10_8(final IfMacroContext _context) {
public static boolean ifMacro_Condition_10_9(final IfMacroContext _context) {
SNode mpsAspect = Sequence.fromIterable(SNodeOperations.ofConcept(SLinkOperations.getChildren(_context.getNode(), LINKS.aspects$6r0Q), CONCEPTS.BuildMpsAspect$Ey)).first();
return (mpsAspect != null) && SPropertyOperations.getBoolean(mpsAspect, PROPS.testGeneration$xdoj);
}
public static boolean ifMacro_Condition_10_9(final IfMacroContext _context) {
public static boolean ifMacro_Condition_10_10(final IfMacroContext _context) {
SNode ba = ListSequence.fromList(SLinkOperations.getChildren(_context.getNode(), LINKS.aspects$6r0Q)).findFirst(new IWhereFilter<SNode>() {
public boolean accept(SNode it) {
return SNodeOperations.isInstanceOf(it, CONCEPTS.BuildMpsAspect$Ey);
Expand All @@ -1110,16 +1116,16 @@ public boolean accept(SNode it) {
}
return isNotEmptyString(SPropertyOperations.getString(SNodeOperations.cast(ba, CONCEPTS.BuildMpsAspect$Ey), PROPS.excludes$mj5k));
}
public static boolean ifMacro_Condition_10_10(final IfMacroContext _context) {
public static boolean ifMacro_Condition_10_11(final IfMacroContext _context) {
return Sequence.fromIterable(((MPSModulesPartitioner) _context.getVariable("var:closure")).getExternal()).isNotEmpty();
}
public static boolean ifMacro_Condition_10_11(final IfMacroContext _context) {
public static boolean ifMacro_Condition_10_12(final IfMacroContext _context) {
// sort of stupid way to find out if project has 'generate' task;
// although the previous one, hardcoded check for presence of specific task library node,
// was not better.
return Sequence.fromIterable(SNodeOperations.ofConcept(SLinkOperations.getChildren(SLinkOperations.getTarget(_context.getNode(), LINKS.project$ciHu), LINKS.plugins$AsCR), CONCEPTS.BuildMPSPlugin$YW)).isNotEmpty();
}
public static boolean ifMacro_Condition_10_12(final IfMacroContext _context) {
public static boolean ifMacro_Condition_10_13(final IfMacroContext _context) {
return ListSequence.fromList(((List<SNode>) _context.getVariable("var:dependency"))).isNotEmpty();
}
public static boolean ifMacro_Condition_17_0(final IfMacroContext _context) {
Expand Down Expand Up @@ -1540,7 +1546,7 @@ public static Iterable<SNode> sourceNodesQuery_10_1(final SourceSubstituteMacroN
// which is to be reduced to path value later.
return Sequence.fromIterable(Sequence.fromArray(((ModulePlugins) _context.getVariable("var:requiredPlugins")).getPluginPaths(_context))).select(new ISelector<String, SNode>() {
public SNode select(String it) {
return createGeneratorInternal_String_x583g4_a0a0a0e0jn(it);
return createGeneratorInternal_String_x583g4_a0a0a0e0ln(it);
}
});
}
Expand Down Expand Up @@ -1614,7 +1620,7 @@ public static Iterable<SNode> sourceNodesQuery_10_9(final SourceSubstituteMacroN
public static Iterable<SNode> sourceNodesQuery_10_10(final SourceSubstituteMacroNodesContext _context) {
return Sequence.fromIterable(Sequence.fromArray(((String[]) _context.getVariable("var:requiredPlugins")))).select(new ISelector<String, SNode>() {
public SNode select(String it) {
return createGeneratorInternal_String_x583g4_a0a0a0a0sn(it);
return createGeneratorInternal_String_x583g4_a0a0a0a0un(it);
}
});
}
Expand Down Expand Up @@ -1976,7 +1982,7 @@ public static Object varMacro_Value_10_8(final TemplateVarContext _context) {
List<Tuples._2<SNode, String>> dependencies = new ProjectDependency(_context, _context.getNode()).collectDependencies().getDependencies();
return ListSequence.fromList(dependencies).select(new ISelector<Tuples._2<SNode, String>, SNode>() {
public SNode select(Tuples._2<SNode, String> it) {
return createGeneratorInternal_ProjectDependency_x583g4_a0a0a0a1a593(it._1(), it._0());
return createGeneratorInternal_ProjectDependency_x583g4_a0a0a0a1a793(it._1(), it._0());
}
}).toListSequence();
}
Expand Down Expand Up @@ -2557,6 +2563,7 @@ public Collection<SNode> evaluate(@NotNull SourceSubstituteMacroNodesContext ctx
pvqMethods.put("4035665851936450300", new PVQ(i++, MetaAdapterFactory.getProperty(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54cfd1fL, 0x5c842a42c54cfd20L, "text"), "aaa"));
pvqMethods.put("4035665851936951126", new PVQ(i++, MetaAdapterFactory.getProperty(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54cfd1fL, 0x5c842a42c54cfd20L, "text"), "module.msd"));
pvqMethods.put("4035665851936219812", new PVQ(i++, MetaAdapterFactory.getProperty(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54cfd1fL, 0x5c842a42c54cfd20L, "text"), "-Xmx512m"));
pvqMethods.put("7780584650041397805", new PVQ(i++, MetaAdapterFactory.getProperty(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54cfd1fL, 0x5c842a42c54cfd20L, "text"), "--options"));
pvqMethods.put("4035665851936216040", new PVQ(i++, MetaAdapterFactory.getProperty(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54cfd1fL, 0x5c842a42c54cfd20L, "text"), "name"));
pvqMethods.put("4035665851936216049", new PVQ(i++, MetaAdapterFactory.getProperty(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54cfd1fL, 0x5c842a42c54cfd20L, "text"), "${propertyName}"));
pvqMethods.put("3239569521490197761", new PVQ(i++, MetaAdapterFactory.getProperty(0x479c7a8c02f943b5L, 0x9139d910cb22f298L, 0x5c842a42c54cfd1fL, 0x5c842a42c54cfd20L, "text"), "plugins.path"));
Expand Down Expand Up @@ -2860,70 +2867,72 @@ public Object evaluate(@NotNull PropertyMacroContext ctx) throws GenerationFailu
case 120:
return QueriesGenerated.propertyMacro_GetValue_10_35(ctx);
case 121:
return QueriesGenerated.propertyMacro_GetValue_12_0(ctx);
return QueriesGenerated.propertyMacro_GetValue_10_36(ctx);
case 122:
return QueriesGenerated.propertyMacro_GetValue_12_1(ctx);
return QueriesGenerated.propertyMacro_GetValue_12_0(ctx);
case 123:
return QueriesGenerated.propertyMacro_GetValue_12_2(ctx);
return QueriesGenerated.propertyMacro_GetValue_12_1(ctx);
case 124:
return QueriesGenerated.propertyMacro_GetValue_13_0(ctx);
return QueriesGenerated.propertyMacro_GetValue_12_2(ctx);
case 125:
return QueriesGenerated.propertyMacro_GetValue_13_1(ctx);
return QueriesGenerated.propertyMacro_GetValue_13_0(ctx);
case 126:
return QueriesGenerated.propertyMacro_GetValue_13_2(ctx);
return QueriesGenerated.propertyMacro_GetValue_13_1(ctx);
case 127:
return QueriesGenerated.propertyMacro_GetValue_13_3(ctx);
return QueriesGenerated.propertyMacro_GetValue_13_2(ctx);
case 128:
return QueriesGenerated.propertyMacro_GetValue_14_0(ctx);
return QueriesGenerated.propertyMacro_GetValue_13_3(ctx);
case 129:
return QueriesGenerated.propertyMacro_GetValue_14_1(ctx);
return QueriesGenerated.propertyMacro_GetValue_14_0(ctx);
case 130:
return QueriesGenerated.propertyMacro_GetValue_17_0(ctx);
return QueriesGenerated.propertyMacro_GetValue_14_1(ctx);
case 131:
return QueriesGenerated.propertyMacro_GetValue_17_1(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_0(ctx);
case 132:
return QueriesGenerated.propertyMacro_GetValue_17_2(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_1(ctx);
case 133:
return QueriesGenerated.propertyMacro_GetValue_17_3(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_2(ctx);
case 134:
return QueriesGenerated.propertyMacro_GetValue_17_4(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_3(ctx);
case 135:
return QueriesGenerated.propertyMacro_GetValue_17_5(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_4(ctx);
case 136:
return QueriesGenerated.propertyMacro_GetValue_17_6(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_5(ctx);
case 137:
return QueriesGenerated.propertyMacro_GetValue_17_7(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_6(ctx);
case 138:
return QueriesGenerated.propertyMacro_GetValue_17_8(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_7(ctx);
case 139:
return QueriesGenerated.propertyMacro_GetValue_17_9(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_8(ctx);
case 140:
return QueriesGenerated.propertyMacro_GetValue_17_10(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_9(ctx);
case 141:
return QueriesGenerated.propertyMacro_GetValue_17_11(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_10(ctx);
case 142:
return QueriesGenerated.propertyMacro_GetValue_17_12(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_11(ctx);
case 143:
return QueriesGenerated.propertyMacro_GetValue_17_13(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_12(ctx);
case 144:
return QueriesGenerated.propertyMacro_GetValue_17_14(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_13(ctx);
case 145:
return QueriesGenerated.propertyMacro_GetValue_17_15(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_14(ctx);
case 146:
return QueriesGenerated.propertyMacro_GetValue_17_16(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_15(ctx);
case 147:
return QueriesGenerated.propertyMacro_GetValue_17_17(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_16(ctx);
case 148:
return QueriesGenerated.propertyMacro_GetValue_17_18(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_17(ctx);
case 149:
return QueriesGenerated.propertyMacro_GetValue_18_0(ctx);
return QueriesGenerated.propertyMacro_GetValue_17_18(ctx);
case 150:
return QueriesGenerated.propertyMacro_GetValue_18_1(ctx);
return QueriesGenerated.propertyMacro_GetValue_18_0(ctx);
case 151:
return QueriesGenerated.propertyMacro_GetValue_18_2(ctx);
return QueriesGenerated.propertyMacro_GetValue_18_1(ctx);
case 152:
return QueriesGenerated.propertyMacro_GetValue_19_0(ctx);
return QueriesGenerated.propertyMacro_GetValue_18_2(ctx);
case 153:
return QueriesGenerated.propertyMacro_GetValue_19_0(ctx);
case 154:
return QueriesGenerated.propertyMacro_GetValue_19_1(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no method for query %s (key: #%d)", ctx.getTemplateReference(), methodKey));
Expand Down Expand Up @@ -3001,6 +3010,7 @@ public Object evaluate(@NotNull PropertyMacroContext ctx) throws GenerationFailu
imcMethods.put("1933226676407114454", new IfMC(i++));
imcMethods.put("4035665851936438514", new IfMC(i++));
imcMethods.put("4035665851935707502", new IfMC(i++));
imcMethods.put("7780584650041397812", new IfMC(i++));
imcMethods.put("4035665851935770399", new IfMC(i++));
imcMethods.put("398731435601112750", new IfMC(i++));
imcMethods.put("1787667533297084980", new IfMC(i++));
Expand Down Expand Up @@ -3177,10 +3187,12 @@ public boolean check(@NotNull IfMacroContext ctx) throws GenerationFailureExcept
case 74:
return QueriesGenerated.ifMacro_Condition_10_12(ctx);
case 75:
return QueriesGenerated.ifMacro_Condition_17_0(ctx);
return QueriesGenerated.ifMacro_Condition_10_13(ctx);
case 76:
return QueriesGenerated.ifMacro_Condition_17_1(ctx);
return QueriesGenerated.ifMacro_Condition_17_0(ctx);
case 77:
return QueriesGenerated.ifMacro_Condition_17_1(ctx);
case 78:
return QueriesGenerated.ifMacro_Condition_19_0(ctx);
default:
throw new GenerationFailureException(String.format("Inconsistent QueriesGenerated: there's no condition method for if macro %s (key: #%d)", ctx.getTemplateReference(), methodKey));
Expand Down Expand Up @@ -3512,17 +3524,17 @@ public void invoke(@NotNull MapSrcMacroPostProcContext ctx) throws GenerationFai
}
}
}
private static SNode createGeneratorInternal_String_x583g4_a0a0a0e0jn(String p0) {
private static SNode createGeneratorInternal_String_x583g4_a0a0a0e0ln(String p0) {
SNodeBuilder n0 = new SNodeBuilder().init(CONCEPTS.GeneratorInternal_String$CC);
n0.setProperty(PROPS.path$oN2q, p0);
return n0.getResult();
}
private static SNode createGeneratorInternal_String_x583g4_a0a0a0a0sn(String p0) {
private static SNode createGeneratorInternal_String_x583g4_a0a0a0a0un(String p0) {
SNodeBuilder n0 = new SNodeBuilder().init(CONCEPTS.GeneratorInternal_String$CC);
n0.setProperty(PROPS.path$oN2q, p0);
return n0.getResult();
}
private static SNode createGeneratorInternal_ProjectDependency_x583g4_a0a0a0a1a593(String p0, SNode p1) {
private static SNode createGeneratorInternal_ProjectDependency_x583g4_a0a0a0a1a793(String p0, SNode p1) {
SNodeBuilder n0 = new SNodeBuilder().init(CONCEPTS.GeneratorInternal_ProjectDependency$bb);
n0.setProperty(PROPS.path$URGX, p0);
n0.setReferenceTarget(LINKS.project$ciHu, p1);
Expand Down
Loading