Skip to content

Commit e8c4980

Browse files
author
Federico Fissore
committed
Added BaseNoGui.VERSION_NAME_LONG: it includes "Hourly Build DATE" in case of a hourly build
1 parent 4688a7a commit e8c4980

File tree

5 files changed

+36
-13
lines changed

5 files changed

+36
-13
lines changed

app/src/processing/app/Base.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,7 @@ public void paint(Graphics g) {
17871787

17881788
g.setFont(new Font("SansSerif", Font.PLAIN, 11));
17891789
g.setColor(Color.white);
1790-
g.drawString(BaseNoGui.VERSION_NAME, 33, 20);
1790+
g.drawString(BaseNoGui.VERSION_NAME_LONG, 33, 20);
17911791
}
17921792
};
17931793
window.addMouseListener(new MouseAdapter() {

app/src/processing/app/Editor.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2297,9 +2297,7 @@ protected boolean handleOpenInternal(File sketchFile) {
22972297
return false;
22982298
}
22992299
header.rebuild();
2300-
// Set the title of the window to "sketch_070752a - Processing 0126"
2301-
setTitle(I18n.format(_("{0} | Arduino {1}"), sketch.getName(),
2302-
BaseNoGui.VERSION_NAME));
2300+
setTitle(I18n.format(_("{0} | Arduino {1}"), sketch.getName(), BaseNoGui.VERSION_NAME_LONG));
23032301
// Disable untitled setting from previous document, if any
23042302
untitled = false;
23052303

app/src/processing/app/EditorStatus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ public void keyTyped(KeyEvent event) {
464464
copyErrorButton.addActionListener(new ActionListener() {
465465
public void actionPerformed(ActionEvent e) {
466466
String message = "";
467-
message += _("Arduino: ") + BaseNoGui.VERSION_NAME + " (" + System.getProperty("os.name") + "), ";
467+
message += _("Arduino: ") + BaseNoGui.VERSION_NAME_LONG + " (" + System.getProperty("os.name") + "), ";
468468
message += _("Board: ") + "\"" + Base.getBoardPreferences().get("name") + "\"\n\n";
469469
message += editor.console.consoleTextPane.getText().trim();
470470
if ((PreferencesData.getBoolean("build.verbose")) == false) {

arduino-core/src/processing/app/BaseNoGui.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,22 @@ public class BaseNoGui {
3232
/** Version string to be used for build */
3333
public static final int REVISION = 10605;
3434
/** Extended version string displayed on GUI */
35-
static String VERSION_NAME = "1.6.5";
35+
public static final String VERSION_NAME = "1.6.5";
36+
public static final String VERSION_NAME_LONG;
37+
38+
static {
39+
String versionNameLong = VERSION_NAME;
40+
File hourlyBuildTxt = new File(getContentFile("lib"), "hourlyBuild.txt");
41+
if (hourlyBuildTxt.exists() && hourlyBuildTxt.canRead()) {
42+
versionNameLong += " Hourly Build";
43+
try {
44+
versionNameLong += " " + FileUtils.readFileToString(hourlyBuildTxt).trim();
45+
} catch (IOException e) {
46+
//noop
47+
}
48+
}
49+
VERSION_NAME_LONG = versionNameLong;
50+
}
3651

3752
static File buildFolder;
3853

build/build.xml

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
<!--echo message="os.arch = ${os.arch}" /-->
55
<!--echo message="os.version = ${os.version}" /-->
66

7+
<tstamp>
8+
<format property="BUILD_DATE" pattern="yyyy/MM/dd hh:mm"/>
9+
</tstamp>
10+
711
<!-- Sets properties for macosx/windows/linux depending on current system -->
812
<condition property="platform" value="macosx-old">
913
<and>
@@ -59,6 +63,8 @@
5963

6064
<target name="build" description="Build Arduino.">
6165
<antcall target="${platform}-build" />
66+
67+
<antcall target="generate-hourly-build-txt"/>
6268
</target>
6369

6470
<target name="run" description="Run Arduino.">
@@ -385,15 +391,15 @@
385391
<antcall target="macosx-run-common"/>
386392
</target>
387393

388-
<target name="macosx-run" depends="macosx-build" description="Run Mac OS X version">
394+
<target name="macosx-run" depends="build" description="Run Mac OS X version">
389395
<antcall target="macosx-run-common"/>
390396
</target>
391397

392398
<target name="macosx-old-debug" depends="macosx-old-build" description="Run Mac OS X version">
393399
<antcall target="macosx-debug-common"/>
394400
</target>
395401

396-
<target name="macosx-debug" depends="macosx-build" description="Run Mac OS X version">
402+
<target name="macosx-debug" depends="build" description="Run Mac OS X version">
397403
<antcall target="macosx-debug-common"/>
398404
</target>
399405

@@ -468,7 +474,7 @@
468474
<antcall target="macosx-dist-common"/>
469475
</target>
470476

471-
<target name="macosx-dist" if="macosx" depends="macosx-build" description="Create a downloadable .zip for the Mac OS X version">
477+
<target name="macosx-dist" if="macosx" depends="build" description="Create a downloadable .zip for the Mac OS X version">
472478
<antcall target="macosx-dist-common"/>
473479
</target>
474480

@@ -637,11 +643,11 @@
637643
<antcall target="package-library-index-json-bundle"/>
638644
</target>
639645

640-
<target name="linux32-run" depends="linux32-build" description="Run Linux (32-bit) version">
646+
<target name="linux32-run" depends="build" description="Run Linux (32-bit) version">
641647
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/>
642648
</target>
643649

644-
<target name="linux64-run" depends="linux64-build" description="Run Linux (64-bit) version">
650+
<target name="linux64-run" depends="build" description="Run Linux (64-bit) version">
645651
<exec executable="./linux/work/arduino" spawn="false" failonerror="true"/>
646652
</target>
647653

@@ -858,12 +864,12 @@
858864
<antcall target="package-library-index-json-bundle"/>
859865
</target>
860866

861-
<target name="windows-run" depends="windows-build"
867+
<target name="windows-run" depends="build"
862868
description="Run windows version">
863869
<exec executable="windows/work/arduino.exe" dir="windows/work" spawn="true" failonerror="true"/>
864870
</target>
865871

866-
<target name="windows-dist" depends="windows-build" description="Create .zip files of windows version">
872+
<target name="windows-dist" depends="build" description="Create .zip files of windows version">
867873

868874
<loadproperties srcfile="${WINDOWS_BUNDLED_JVM}/release" prefix="windows"/>
869875

@@ -989,4 +995,8 @@
989995
</exec>
990996
</target>
991997

998+
<target name="generate-hourly-build-txt" if="hourly">
999+
<echo file="${staging_folder}/work/${staging_hardware_folder}/../lib/hourlyBuild.txt">${BUILD_DATE}</echo>
1000+
</target>
1001+
9921002
</project>

0 commit comments

Comments
 (0)