File tree 2 files changed +14
-1
lines changed
hutool-core/src/main/java/cn/hutool/core/compiler
2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 10
10
* 【core 】 build(pom): 添加 Automatic-Module-Name属性(pr#2926@Github)
11
11
* 【core 】 根据JDK-8080225修改了部分新建文件输入流和文件输出流的创建方式(pr#2930@Github)
12
12
* 【http 】 HttpRequest#body增加支持Resource重载(issue#2901@Github)
13
+ * 【core 】 JavaSourceCompiler#compile增加自定义options重载(issue#I6IVZK@Gitee)
13
14
14
15
### 🐞Bug修复
15
16
* 【db 】 修复识别JDBC驱动时重复问题(pr#940@Gitee)
Original file line number Diff line number Diff line change @@ -168,6 +168,16 @@ public JavaSourceCompiler addLibrary(File... files) {
168
168
* @return 类加载器
169
169
*/
170
170
public ClassLoader compile () {
171
+ return compile (null );
172
+ }
173
+
174
+ /**
175
+ * 编译所有文件并返回类加载器
176
+ *
177
+ * @param options 编译参数
178
+ * @return 类加载器
179
+ */
180
+ public ClassLoader compile (List <String > options ) {
171
181
// 获得classPath
172
182
final List <File > classPath = getClassPath ();
173
183
final URL [] urLs = URLUtil .getURLs (classPath .toArray (new File [0 ]));
@@ -181,7 +191,9 @@ public ClassLoader compile() {
181
191
final JavaClassFileManager javaFileManager = new JavaClassFileManager (ucl , CompilerUtil .getFileManager ());
182
192
183
193
// classpath
184
- final List <String > options = new ArrayList <>();
194
+ if (null == options ) {
195
+ options = new ArrayList <>();
196
+ }
185
197
if (false == classPath .isEmpty ()) {
186
198
final List <String > cp = CollUtil .map (classPath , File ::getAbsolutePath , true );
187
199
options .add ("-cp" );
You can’t perform that action at this time.
0 commit comments