mirror of
https://github.com/enso-org/enso.git
synced 2024-12-23 21:01:51 +03:00
Fix separate compilation for ConstantsGen (#5630)
A combination of commands triggered separate compilation that only recompiled part of builtins. A mechanism that workaround annotation processor's problems with separate compilation was updated to include changes from https://github.com/enso-org/enso/pull/4111. This was pretty tough to find given the rather unusual circumstances in CI. # Important Notes This eliminates the _random_ failures in CI related to separate compilation. To reproduce a specific set of steps has to be executed: ``` sbt> all buildEngineDistribution engine-runner/assembly runtime/Benchmark/compile language-server/Benchmark/compile searcher/Benchmark/compile (exit sbt) sbt> test ```
This commit is contained in:
parent
d1af25793a
commit
9ea9fd56e6
@ -115,19 +115,7 @@ public class TypeProcessor extends BuiltinsMetadataProcessor<TypeProcessor.TypeM
|
||||
for (Map.Entry<String, BuiltinTypeConstr> entry : builtinTypes.get(f).entrySet()) {
|
||||
BuiltinTypeConstr constr = entry.getValue();
|
||||
if (!constr.getFullName().isEmpty()) {
|
||||
out.println(
|
||||
" public static final String "
|
||||
+ entry.getKey().toUpperCase()
|
||||
+ " = \""
|
||||
+ constr.getFullName()
|
||||
+ "\";");
|
||||
|
||||
out.println(
|
||||
" public static final String "
|
||||
+ entry.getKey().toUpperCase() + "_BUILTIN"
|
||||
+ " = "
|
||||
+ toBuiltinName(constr.getFullName())
|
||||
+ ";");
|
||||
generateEntry(entry.getKey().toUpperCase(), constr.getFullName(), out);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -136,14 +124,7 @@ public class TypeProcessor extends BuiltinsMetadataProcessor<TypeProcessor.TypeM
|
||||
.values()
|
||||
.forEach(
|
||||
entry ->
|
||||
entry.stdlibName().ifPresent(n ->
|
||||
out.println(
|
||||
" public static final String "
|
||||
+ entry.ensoName().toUpperCase()
|
||||
+ " = \""
|
||||
+ n
|
||||
+ "\";")
|
||||
)
|
||||
entry.stdlibName().ifPresent(n -> generateEntry(entry.ensoName().toUpperCase(), n, out))
|
||||
);
|
||||
|
||||
out.println();
|
||||
@ -151,6 +132,21 @@ public class TypeProcessor extends BuiltinsMetadataProcessor<TypeProcessor.TypeM
|
||||
}
|
||||
}
|
||||
|
||||
public void generateEntry(String name, String value, PrintWriter out) {
|
||||
out.println(
|
||||
" public static final String "
|
||||
+ name
|
||||
+ " = \""
|
||||
+ value
|
||||
+ "\";");
|
||||
out.println(
|
||||
" public static final String "
|
||||
+ name + "_BUILTIN"
|
||||
+ " = "
|
||||
+ toBuiltinName(value)
|
||||
+ ";");
|
||||
}
|
||||
|
||||
private String toBuiltinName(String name) {
|
||||
return "Constants.BUILTIN_NAMESPACE + \"." + name.substring(name.lastIndexOf('.') + 1) + "\"";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user