-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sh
executable file
·247 lines (247 loc) · 11.5 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
#!/bin/bash
set -eu
source config.sh # Configure the build with this file.
mkdir -p "build/tmp"
echo "Generating scanner..."
cat \
'extendj/java4/scanner/Header.flex' \
'extendj/java8/scanner/Preamble.flex' \
'extendj/java7/scanner/Macros.flex' \
'extendj/java4/scanner/RulesPreamble.flex' \
'extendj/java4/scanner/WhiteSpace.flex' \
'extendj/java4/scanner/Comments.flex' \
'extendj/java4/scanner/Keywords.flex' \
'extendj/java4/scanner/Operators.flex' \
'extendj/java4/scanner/Separators.flex' \
'extendj/java5/scanner/Operators.flex' \
'extendj/java5/scanner/Keywords.flex' \
'extendj/java7/scanner/Literals.flex' \
'extendj/java8/scanner/Separators.flex' \
'extendj/java8/scanner/Operators.flex' \
'src/scanner/FreeVariables.flex' \
'extendj/java5/scanner/Identifiers.flex' \
'extendj/java4/scanner/Postamble.flex' \
> "build/tmp/JavaScanner.flex"
mkdir -p "src/gen/java/scanner"
${JFLEX} -d "src/gen/java/scanner" --nobak "build/tmp/JavaScanner.flex"
echo "Generating parser..."
cat \
'extendj/java4/parser/Header.parser' \
'extendj/java4/parser/Preamble.parser' \
'extendj/java4/parser/Java1.4.parser' \
'extendj/java5/parser/Annotations.parser' \
'extendj/java5/parser/Generics.parser' \
'extendj/java5/parser/EnhancedFor.parser' \
'extendj/java5/parser/java14fix.parser' \
'extendj/java5/parser/Enums.parser' \
'extendj/java5/parser/StaticImports.parser' \
'extendj/java5/parser/GenericMethods.parser' \
'extendj/java5/parser/VariableArityParameters.parser' \
'extendj/java7/parser/MultiCatch.parser' \
'extendj/java7/parser/Diamond.parser' \
'extendj/java7/parser/Literals.parser' \
'extendj/java7/parser/TryWithResources.parser' \
'extendj/java8/parser/InterfaceMethods.parser' \
'extendj/java8/parser/NonGenericTypes.parser' \
'extendj/java8/parser/IntersectionCasts.parser' \
'extendj/java8/parser/Lambda.parser' \
'extendj/java8/parser/PackageModifier.parser' \
'extendj/java8/parser/ConstructorReference.parser' \
'extendj/java8/parser/MethodReference.parser' \
'src/parser/FreeVariables.parser' \
> "build/tmp/JavaParser.all"
${JASTADDPARSER} "build/tmp/JavaParser.all" "build/tmp/JavaParser.beaver"
mkdir -p "src/gen/java/parser"
${BEAVER} -d "src/gen/java/parser" -t -c -w "build/tmp/JavaParser.beaver"
echo "Generating node types and weaving aspects..."
mkdir -p "src/gen/java"
${JASTADD} \
--package="org.extendj.ast" \
--o="src/gen/java" \
--rewrite=cnta \
--safeLazy \
--beaver \
--visitCheck=false \
--cacheCycle=false \
'extendj/java4/grammar/Java.ast' \
'extendj/java4/grammar/NTAFinally.ast' \
'extendj/java4/grammar/BoundNames.ast' \
'extendj/java4/frontend/Options.jadd' \
'extendj/java4/frontend/LibCompilationUnits.jadd' \
'extendj/java4/frontend/StructuredPrettyPrint.jadd' \
'extendj/java4/frontend/DocumentationComments.jadd' \
'extendj/java4/frontend/PrettyPrint.jadd' \
'extendj/java4/frontend/DumpTree.jadd' \
'extendj/java4/frontend/PathPart.jadd' \
'extendj/java4/frontend/PositiveLiterals.jrag' \
'extendj/java4/frontend/NameCheck.jrag' \
'extendj/java4/frontend/QualifiedNames.jrag' \
'extendj/java4/frontend/LookupMethod.jrag' \
'extendj/java4/frontend/AccessControl.jrag' \
'extendj/java4/frontend/DataStructures.jrag' \
'extendj/java4/frontend/TypeHierarchyCheck.jrag' \
'extendj/java4/frontend/TypeAnalysis.jrag' \
'extendj/java4/frontend/ExceptionHandling.jrag' \
'extendj/java4/frontend/PrettyPrintUtil.jrag' \
'extendj/java4/frontend/DefiniteAssignment.jrag' \
'extendj/java4/frontend/NTAFinally.jrag' \
'extendj/java4/frontend/ResolveAmbiguousNames.jrag' \
'extendj/java4/frontend/BranchTarget.jrag' \
'extendj/java4/frontend/ConstantExpression.jrag' \
'extendj/java4/frontend/MonitorExit.jrag' \
'extendj/java4/frontend/ClassfileParser.jrag' \
'extendj/java4/frontend/BytecodeCONSTANT.jrag' \
'extendj/java4/frontend/VariableDeclaration.jrag' \
'extendj/java4/frontend/Modifiers.jrag' \
'extendj/java4/frontend/Arrays.jrag' \
'extendj/java4/frontend/DeclareBeforeUse.jrag' \
'extendj/java4/frontend/TypeCheck.jrag' \
'extendj/java4/frontend/SyntacticClassification.jrag' \
'extendj/java4/frontend/ErrorCheck.jrag' \
'extendj/java4/frontend/LookupConstructor.jrag' \
'extendj/java4/frontend/ClassPath.jrag' \
'extendj/java4/frontend/NodeConstructors.jrag' \
'extendj/java4/frontend/UnreachableStatements.jrag' \
'extendj/java4/frontend/FrontendMain.jrag' \
'extendj/java4/frontend/AnonymousClasses.jrag' \
'extendj/java4/frontend/LookupVariable.jrag' \
'extendj/java4/frontend/LookupType.jrag' \
'extendj/java4/frontend/PrimitiveTypes.jrag' \
'extendj/java4/frontend/BoundNames.jrag' \
'extendj/java5/grammar/VariableArityParameters.ast' \
'extendj/java5/grammar/StaticImports.ast' \
'extendj/java5/grammar/Enums.ast' \
'extendj/java5/grammar/GenericMethods.ast' \
'extendj/java5/grammar/Annotations.ast' \
'extendj/java5/grammar/EnhancedFor.ast' \
'extendj/java5/grammar/Generics.ast' \
'extendj/java5/frontend/GLBTypeFactory.jadd' \
'extendj/java5/frontend/PrettyPrint.jadd' \
'extendj/java5/frontend/GenericMethods.jrag' \
'extendj/java5/frontend/MethodSignature.jrag' \
'extendj/java5/frontend/GenericsArrays.jrag' \
'extendj/java5/frontend/Enums.jrag' \
'extendj/java5/frontend/GenericBoundCheck.jrag' \
'extendj/java5/frontend/GenericTypeVariables.jrag' \
'extendj/java5/frontend/AutoBoxing.jrag' \
'extendj/java5/frontend/BytecodeDescriptor.jrag' \
'extendj/java5/frontend/GenericsSubtype.jrag' \
'extendj/java5/frontend/EnhancedFor.jrag' \
'extendj/java5/frontend/StaticImports.jrag' \
'extendj/java5/frontend/GenericsParTypeDecl.jrag' \
'extendj/java5/frontend/Generics.jrag' \
'extendj/java5/frontend/BytecodeAttributes.jrag' \
'extendj/java5/frontend/ReifiableTypes.jrag' \
'extendj/java5/frontend/GenericMethodsInference.jrag' \
'extendj/java5/frontend/VariableArityParameters.jrag' \
'extendj/java5/frontend/BytecodeSignatures.jrag' \
'extendj/java5/frontend/Annotations.jrag' \
'extendj/java6/frontend/Override.jrag' \
'extendj/java7/grammar/MultiCatch.ast' \
'extendj/java7/grammar/Literals.ast' \
'extendj/java7/grammar/TryWithResources.ast' \
'extendj/java7/grammar/Diamond.ast' \
'extendj/java7/frontend/Constant.jadd' \
'extendj/java7/frontend/PrettyPrint.jadd' \
'extendj/java7/frontend/SuppressWarnings.jrag' \
'extendj/java7/frontend/MultiCatch.jrag' \
'extendj/java7/frontend/Diamond.jrag' \
'extendj/java7/frontend/StringsInSwitch.jrag' \
'extendj/java7/frontend/SafeVarargs.jrag' \
'extendj/java7/frontend/UncheckedConversion.jrag' \
'extendj/java7/frontend/TryWithResources.jrag' \
'extendj/java7/frontend/Literals.jrag' \
'extendj/java7/frontend/PreciseRethrow.jrag' \
'extendj/java8/grammar/LambdaAnonymousDecl.ast' \
'extendj/java8/grammar/MethodReference.ast' \
'extendj/java8/grammar/ConstructorReference.ast' \
'extendj/java8/grammar/Lambda.ast' \
'extendj/java8/grammar/IntersectionCasts.ast' \
'extendj/java8/frontend/Variable.jadd' \
'extendj/java8/frontend/PrettyPrint.jadd' \
'extendj/java8/frontend/NameCheck.jrag' \
'extendj/java8/frontend/QualifiedNames.jrag' \
'extendj/java8/frontend/PolyExpressions.jrag' \
'extendj/java8/frontend/EffectivelyFinal.jrag' \
'extendj/java8/frontend/DataStructures.jrag' \
'extendj/java8/frontend/TypeHierarchyCheck.jrag' \
'extendj/java8/frontend/MethodSignature.jrag' \
'extendj/java8/frontend/LambdaBody.jrag' \
'extendj/java8/frontend/MethodReference.jrag' \
'extendj/java8/frontend/GenericsSubtype.jrag' \
'extendj/java8/frontend/EnclosingLambda.jrag' \
'extendj/java8/frontend/ConstructorReference.jrag' \
'extendj/java8/frontend/VariableDeclaration.jrag' \
'extendj/java8/frontend/LambdaExpr.jrag' \
'extendj/java8/frontend/Modifiers.jrag' \
'extendj/java8/frontend/TypeVariablePositions.jrag' \
'extendj/java8/frontend/TypeCheck.jrag' \
'extendj/java8/frontend/ExtraInheritedEqs.jrag' \
'extendj/java8/frontend/BytecodeReader.jrag' \
'extendj/java8/frontend/UnreachableStatements.jrag' \
'extendj/java8/frontend/TargetType.jrag' \
'extendj/java8/frontend/LambdaAnonymousDecl.jrag' \
'extendj/java8/frontend/LookupVariable.jrag' \
'extendj/java8/frontend/FunctionalInterface.jrag' \
'extendj/java8/frontend/FunctionDescriptor.jrag' \
'extendj/java8/frontend/LookupType.jrag' \
'extendj/java8/frontend/VariableArityParameters.jrag' \
'extendj/java8/frontend/Annotations.jrag' \
'src/frontend/FreeDeclarators.ast' \
'src/frontend/MuliPrettyPrint.jadd' \
'src/frontend/ExtensionBase.jrag' \
'src/frontend/FreeDeclarators.jrag' \
'extendj/java4/backend/JVMBytecodes.jrag' \
'extendj/java4/backend/CreateBCode.jrag' \
'extendj/java4/backend/InnerClasses.jrag' \
'extendj/java4/backend/Java2Rewrites.jrag' \
'extendj/java4/backend/NTAFinally.jrag' \
'extendj/java4/backend/ConstantPoolNames.jrag' \
'extendj/java4/backend/GenerateClassfile.jrag' \
'extendj/java4/backend/Transformations.jrag' \
'extendj/java4/backend/CodeGeneration.jrag' \
'extendj/java4/backend/MonitorExit.jrag' \
'extendj/java4/backend/ConstantPool.jrag' \
'extendj/java4/backend/Attributes.jrag' \
'extendj/java4/backend/LocalNum.jrag' \
'extendj/java4/backend/JVMBytecodesDebug.jrag' \
'extendj/java4/backend/Flags.jrag' \
'extendj/java5/backend/EnhancedForCodegen.jrag' \
'extendj/java5/backend/EnclosingMethodAttribute.jrag' \
'extendj/java5/backend/StaticImportsCodegen.jrag' \
'extendj/java5/backend/GenericsCodegen.jrag' \
'extendj/java5/backend/AnnotationsCodegen.jrag' \
'extendj/java5/backend/AutoBoxingCodegen.jrag' \
'extendj/java5/backend/EnumsCodegen.jrag' \
'extendj/java5/backend/Version.jrag' \
'extendj/java5/backend/VariableArityParametersCodegen.jrag' \
'extendj/java7/grammar/BasicTWR.ast' \
'extendj/java7/backend/MultiCatch.jrag' \
'extendj/java7/backend/StringsInSwitch.jrag' \
'extendj/java7/backend/TryWithResources.jrag' \
'extendj/java7/backend/PreciseRethrow.jrag' \
'extendj/java8/backend/CreateBCode.jrag' \
'extendj/java8/backend/LambdaToClass.jrag' \
'extendj/java8/backend/MethodReferenceToClass.jrag' \
'extendj/java8/backend/ToClassInherited.jrag' \
'extendj/java8/backend/Transformations.jrag' \
'extendj/java8/backend/Tmp.jrag' \
'extendj/java8/backend/Version.jrag' \
'extendj/java8/backend/ConstructorReferenceToClass.jrag' \
'src/backend/FreeDeclaratorBCode.jadd' \
'src/backend/FreeFieldAttribute.jrag' \
'src/backend/FreeVariablesAttribute.jrag' ${EXTRA_JASTADD_SOURCES}
echo "Compiling Java code..."
mkdir -p build/classes/main
javac -d build/classes/main $(find src/java -name '*.java') \
$(find src/gen -name '*.java') \
$(find extendj/src/frontend -name '*.java') ${EXTRA_JAVA_SOURCES}
mkdir -p src/gen-res
echo "moduleName: Muli Lang Backend (based on Java SE 8)" > src/gen-res/BuildInfo.properties
echo "moduleVariant: backend" >> src/gen-res/BuildInfo.properties
echo "timestamp: 2016-08-17T11:02Z" >> src/gen-res/BuildInfo.properties
echo "build.date: 2016-08-17" >> src/gen-res/BuildInfo.properties
jar cef "de.wwu.muli.BackendMain" "muli-lang.jar" \
-C build/classes/main . \
-C src/gen-res BuildInfo.properties \
-C extendj/src/res Version.properties