mirror of
https://github.com/processing/processing4.git
synced 2026-02-04 06:09:17 +01:00
JavaBuild: fix output path when java tabs have package declaration
This commit is contained in:
@@ -523,11 +523,11 @@ public class JavaBuild {
|
||||
} else {
|
||||
if (packageMatch == null) {
|
||||
// use the default package name, since mixing with package-less code will break
|
||||
packageMatch = new String[] { packageName };
|
||||
packageMatch = new String[] { "", packageName };
|
||||
// add the package name to the source before writing it
|
||||
javaCode = "package " + packageName + ";" + javaCode;
|
||||
}
|
||||
File packageFolder = new File(srcFolder, packageMatch[0].replace('.', '/'));
|
||||
File packageFolder = new File(srcFolder, packageMatch[1].replace('.', File.separatorChar));
|
||||
packageFolder.mkdirs();
|
||||
Util.saveFile(javaCode, new File(packageFolder, filename));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user