1447
|
1 |
"
|
|
2 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
3 |
|
|
4 |
New code and modifications done at SWING Research Group [1]:
|
|
5 |
|
|
6 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
7 |
SWING Research Group, Czech Technical University in Prague
|
|
8 |
|
|
9 |
This software is furnished under a license and may be used
|
|
10 |
only in accordance with the terms of that license and with the
|
|
11 |
inclusion of the above copyright notice. This software may not
|
|
12 |
be provided or otherwise made available to, or used by, any
|
|
13 |
other person. No title to or ownership of the software is
|
|
14 |
hereby transferred.
|
|
15 |
|
|
16 |
[1] Code written at SWING Research Group contains a signature
|
|
17 |
of one of the above copright owners. For exact set of such code,
|
|
18 |
see the differences between this version and version stx:libjava
|
|
19 |
as of 1.9.2010
|
|
20 |
"
|
|
21 |
"{ Package: 'stx:libjava' }"
|
|
22 |
|
|
23 |
Object subclass:#JavaCompiler_Eclipse
|
|
24 |
instanceVariableNames:''
|
|
25 |
classVariableNames:'ECJCompilerClass'
|
|
26 |
poolDictionaries:''
|
|
27 |
category:'Languages-Java-Tools-Eclipse'
|
|
28 |
!
|
|
29 |
|
|
30 |
!JavaCompiler_Eclipse class methodsFor:'documentation'!
|
|
31 |
|
|
32 |
copyright
|
|
33 |
"
|
|
34 |
COPYRIGHT (c) 1996-2011 by Claus Gittinger
|
|
35 |
|
|
36 |
New code and modifications done at SWING Research Group [1]:
|
|
37 |
|
|
38 |
COPYRIGHT (c) 2010-2011 by Jan Vrany, Jan Kurs and Marcel Hlopko
|
|
39 |
SWING Research Group, Czech Technical University in Prague
|
|
40 |
|
|
41 |
This software is furnished under a license and may be used
|
|
42 |
only in accordance with the terms of that license and with the
|
|
43 |
inclusion of the above copyright notice. This software may not
|
|
44 |
be provided or otherwise made available to, or used by, any
|
|
45 |
other person. No title to or ownership of the software is
|
|
46 |
hereby transferred.
|
|
47 |
|
|
48 |
[1] Code written at SWING Research Group contains a signature
|
|
49 |
of one of the above copright owners. For exact set of such code,
|
|
50 |
see the differences between this version and version stx:libjava
|
|
51 |
as of 1.9.2010
|
|
52 |
|
|
53 |
"
|
|
54 |
!
|
|
55 |
|
|
56 |
history
|
|
57 |
|
|
58 |
"Created: / 02-04-2012 / 10:35:35 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
59 |
"Created: #initialize / 02-04-2012 / 10:46:41 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
60 |
"Created: #initCompiler: / 02-04-2012 / 13:16:37 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
61 |
"Created: #compilerEnvironment / 02-04-2012 / 13:18:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
62 |
"Created: #compile: / 02-04-2012 / 13:21:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
63 |
! !
|
|
64 |
|
|
65 |
!JavaCompiler_Eclipse class methodsFor:'compiling'!
|
|
66 |
|
|
67 |
compile: compilationUnit
|
|
68 |
^self new compile: compilationUnit.
|
|
69 |
|
|
70 |
"Created: / 02-04-2012 / 13:21:25 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
71 |
! !
|
|
72 |
|
|
73 |
!JavaCompiler_Eclipse methodsFor:'compiling'!
|
|
74 |
|
|
75 |
compilationResultFor: compilationUnit
|
1449
|
76 |
^ (Java classForName: 'org.eclipse.jdt.internal.compiler.CompilationResult')
|
|
77 |
new: compilationUnit
|
|
78 |
with: 0
|
|
79 |
with: 0
|
|
80 |
with: 0.
|
1447
|
81 |
|
1449
|
82 |
"Modified: / 03-04-2012 / 12:39:20 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
1447
|
83 |
!
|
|
84 |
|
|
85 |
compile: compilationUnit
|
|
86 |
| compiler compEnv policy options requestor problemFactory |
|
|
87 |
compEnv := self compilerEnvironment.
|
|
88 |
policy := self policy.
|
|
89 |
options := self compilerOptions.
|
|
90 |
requestor := self compilationResultFor: compilationUnit.
|
|
91 |
problemFactory := self problemFactory.
|
1449
|
92 |
"Do not use cached Java class - think about #flushAllJavaResources"
|
|
93 |
compiler := (JAVA org eclipse jdt internal compiler Compiler)
|
1447
|
94 |
new: compEnv
|
|
95 |
with: policy
|
|
96 |
with: options
|
|
97 |
with: requestor
|
|
98 |
with: problemFactory.
|
|
99 |
compiler compile: compilationUnit.
|
1449
|
100 |
self breakPoint: #mh.
|
|
101 |
^ requestor getClassFiles.
|
1447
|
102 |
|
|
103 |
"Created: / 02-04-2012 / 13:18:22 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
1448
|
104 |
"Modified: / 02-04-2012 / 18:42:14 / Jan Vrany <jan.vrany@fit.cvut.cz>"
|
1449
|
105 |
"Modified (format): / 03-04-2012 / 11:49:28 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
1447
|
106 |
!
|
|
107 |
|
|
108 |
compilerEnvironment
|
1449
|
109 |
^ (JAVA stx libjava tools LibjavaCompilerEnv) new.
|
1447
|
110 |
|
|
111 |
"Created: / 02-04-2012 / 13:18:53 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
|
112 |
!
|
|
113 |
|
|
114 |
compilerOptions
|
|
115 |
^ (Java classForName: 'org.eclipse.jdt.internal.compiler.impl.CompilerOptions') new.
|
|
116 |
|
1449
|
117 |
"Modified: / 03-04-2012 / 12:40:48 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
1447
|
118 |
!
|
|
119 |
|
|
120 |
policy
|
1449
|
121 |
^ (Java classForName: 'org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies')
|
|
122 |
exitOnFirstError.
|
1447
|
123 |
|
1449
|
124 |
"Modified: / 03-04-2012 / 12:39:54 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
1447
|
125 |
!
|
|
126 |
|
|
127 |
problemFactory
|
1449
|
128 |
^ (JAVA
|
|
129 |
org eclipse jdt internal compiler problem DefaultProblemFactory)
|
1447
|
130 |
new.
|
|
131 |
|
1449
|
132 |
"Modified: / 03-04-2012 / 12:27:21 / Marcel Hlopko <hlopkmar@fel.cvut.cz>"
|
1447
|
133 |
! !
|
|
134 |
|
|
135 |
!JavaCompiler_Eclipse class methodsFor:'documentation'!
|
|
136 |
|
|
137 |
version_SVN
|
|
138 |
^ '$Id:: $'
|
|
139 |
! !
|