Skip to content

Commit 0388dd3

Browse files
committed
Fix for build failing when build dir is empty
1 parent d134a89 commit 0388dd3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* #72 Fix running javamaker with spaces in project path
55
* Load description.xml editor even when locale is missing
66
* Remove crashreport service (Service no longer exists)
7+
* Fix build with empty `build` directory
78

89
## 3.0.0
910
* Python support for extension development

java/source/org/libreoffice/ide/eclipse/java/JavaBuilder.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ public IFile createLibrary(IUnoidlProject pUnoProject) throws Exception {
128128

129129
IFolder buildDir = pUnoProject.getFolder(pUnoProject.getBuildPath());
130130
buildDir.accept(visitor);
131+
132+
// Adding the source directory is not strictly necessary
133+
// (and it has practically no impact on the generated jar).
134+
// But if the build path is empty, the build fails.
135+
// So the contract seems to be that setElements must be called with a non-empty list of files.
136+
IFolder sourceDir = pUnoProject.getFolder(pUnoProject.getSourcePath());
137+
sourceDir.accept(visitor);
131138
description.setElements(visitor.getFiles());
132139

133140
// Create the Jar file

0 commit comments

Comments
 (0)