Skip to content

Commit

Permalink
(multi-os-engine/multi-os-engine#169) Fix empty input file error when…
Browse files Browse the repository at this point in the history
… build project again
  • Loading branch information
Noisyfox committed Jun 12, 2022
1 parent a486c8c commit 968c32e
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/main/java/org/moe/gradle/tasks/Dex.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,10 @@ public void setDestDir(@Nullable Object destDir) {
this.destDir = destDir;
}

private HashSet<File> destJars = new HashSet<>();

@Internal
@NotNull
public HashSet<File> getDestJars() {
return new HashSet<>(destJars);
public Set<File> getDestJars() {
return getProject().fileTree(getDestDir()).filter(it->it.isFile() && it.getName().endsWith(".jar")).getFiles();
}

@Override
Expand All @@ -127,13 +125,10 @@ protected void run() {
throw new GradleException("an IOException occurred", e);
}
getDestDir().mkdirs();
destJars.clear();

int index = 0;
for (File f : getInputFiles()) {
File out = new File(getDestDir(), "classes-" + index + ".jar");
destJars.add(out);

LOG.info("Dxing {} to {}...", f, out);

javaexec(spec -> {
Expand Down

0 comments on commit 968c32e

Please sign in to comment.