From 11a5eee0e93c2eeab20d074fbb293af963242d1c Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 20 Nov 2014 09:00:31 -0800 Subject: [PATCH] Only write build number if incrementing, only increment if actually building --- tools/CommandLineTools.hx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tools/CommandLineTools.hx b/tools/CommandLineTools.hx index c1d5847d7..c68d669fc 100644 --- a/tools/CommandLineTools.hx +++ b/tools/CommandLineTools.hx @@ -941,13 +941,18 @@ class CommandLineTools { project.meta.buildNumber = Std.string (version); - try { + if (increment) { - var output = File.write (versionFile, false); - output.writeString (Std.string (version)); - output.close (); + try { + + var output = File.write (versionFile, false); + output.writeString (Std.string (version)); + output.close (); + + } catch (e:Dynamic) {} - } catch (e:Dynamic) {} + } + } @@ -1279,7 +1284,7 @@ class CommandLineTools { case ANDROID, IOS, BLACKBERRY: - getBuildNumber (project); + getBuildNumber (project, (project.command == "build" || project.command == "test")); default: