Skip to content

Commit 22738d1

Browse files
committed
Fix bug when updating versions.
1 parent ac488e7 commit 22738d1

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

adventure-editor/src/main/java/com/bladecoder/engineeditor/model/Project.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ public void updateEngineVersion(File projectPath) throws FileNotFoundException,
445445
prop.setProperty("androidGradlePluginVersion", Versions.getAndroidGradlePluginVersion());
446446
prop.setProperty("bladeInkVersion", Versions.getBladeInkVersion());
447447

448-
saveGradleProperties(prop);
448+
saveGradleProperties(prop, projectPath);
449449
}
450450

451451
/**
@@ -544,9 +544,9 @@ public Properties getGradleProperties(File projectPath) throws FileNotFoundExcep
544544
return prop;
545545
}
546546

547-
public void saveGradleProperties(Properties prop) throws IOException {
547+
public void saveGradleProperties(Properties prop, File projectPath) throws IOException {
548548
FileOutputStream os = new FileOutputStream(
549-
getProjectDir().getAbsolutePath() + "/gradle.properties");
549+
projectPath.getAbsolutePath() + "/gradle.properties");
550550

551551
prop.store(os, null);
552552
}

adventure-editor/src/main/java/com/bladecoder/engineeditor/ui/PackageDialog.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -655,7 +655,7 @@ private void setCurrentVersion(String version) {
655655
try {
656656
Properties prop = Ctx.project.getGradleProperties(Ctx.project.getProjectDir());
657657
prop.setProperty("version", version);
658-
Ctx.project.saveGradleProperties(prop);
658+
Ctx.project.saveGradleProperties(prop, Ctx.project.getProjectDir());
659659
} catch (IOException e) {
660660
Message.showMsg(getStage(), "Error reading file 'gradle.properties' from the game.", 3);
661661
}

0 commit comments

Comments
 (0)