Skip to content

Commit

Permalink
Fix for git hash not being updated, and addition of GIT_DATE for buil…
Browse files Browse the repository at this point in the history
…d date/time
  • Loading branch information
malcom2073 committed Nov 21, 2013
1 parent e8796c3 commit fcd7b25
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
3 changes: 3 additions & 0 deletions core/core.pro
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ win32-x-g++ { #Linux based crossplatform 32bit build
LIBS += -L/home/michael/QtWin32/lib
DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always)
DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H)
DEFINES += GIT_DATE=\""$$system(date)"\"
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
} else:win64-x-g++ { #Linux based crossplatform 64bit build
message("Building for win64-x-g++")
Expand All @@ -40,6 +41,7 @@ win32-x-g++ { #Linux based crossplatform 32bit build
LIBS += -L/home/michael/QtWin64/lib
DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always)
DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H)
DEFINES += GIT_DATE=\""$$system(date)"\"
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
} else:win32 { #Windows based mingw build
message("Building for win32")
Expand Down Expand Up @@ -68,6 +70,7 @@ unix {
INCLUDEPATH += /usr/include/qwt
DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always)
DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H)
DEFINES += GIT_DATE=\""$$system(date)"\"
}
mac {
QMAKE_CXXFLAGS += -Werror
Expand Down
6 changes: 4 additions & 2 deletions core/src/aboutview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,14 @@ void AboutView::setHash(QString hash)
m_hash = hash;
ui.commitHashLineEdit->setText(hash);
}

void AboutView::setDate(QString date)
{
ui.dateLineEdit->setText(date);
}
void AboutView::setCommit(QString commit)
{
m_commit = commit;
ui.commitIdLineEdit->setText(commit);

}
void AboutView::closeEvent(QCloseEvent *event)
{
Expand Down
1 change: 1 addition & 0 deletions core/src/aboutview.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class AboutView : public QWidget
void setHash(QString hash);
void setVersionLabel(QString version);
void setCommit(QString commit);
void setDate(QString date);
protected:
void closeEvent(QCloseEvent *event);
private:
Expand Down
26 changes: 22 additions & 4 deletions core/src/aboutview.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>536</width>
<height>503</height>
<width>513</width>
<height>546</height>
</rect>
</property>
<property name="windowTitle">
Expand Down Expand Up @@ -108,6 +108,24 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QLabel" name="label_24">
<property name="text">
<string>Build Date</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="dateLineEdit">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</item>
<item>
Expand All @@ -133,8 +151,8 @@ applicable license for these libraries.</string>
<rect>
<x>0</x>
<y>0</y>
<width>498</width>
<height>496</height>
<width>473</width>
<height>568</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
Expand Down
1 change: 1 addition & 0 deletions core/src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent)
aboutView = new AboutView();
aboutView->setHash(define2string(GIT_HASH));
aboutView->setCommit(define2string(GIT_COMMIT));
aboutView->setDate(define2string(GIT_DATE));
aboutMdiWindow = ui.mdiArea->addSubWindow(aboutView);
aboutMdiWindow->setGeometry(aboutView->geometry());
aboutMdiWindow->hide();
Expand Down
5 changes: 5 additions & 0 deletions plugins/freeems/freeems.pro
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ win32-x-g++ { #Linux based crossplatform 32bit build
LIBS += -L/home/michael/QtWin32/lib
DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always)
DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H)
DEFINES += GIT_DATE=\""$$system(date)"\"
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
} else:win64-x-g++ { #Linux based crossplatform 64bit build
TARGET = ../../../core/plugins/freeemsplugin
Expand All @@ -40,6 +41,7 @@ win32-x-g++ { #Linux based crossplatform 32bit build
LIBS += -L/home/michael/QtWin64/lib
DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always)
DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H)
DEFINES += GIT_DATE=\""$$system(date)"\"
QMAKE_LFLAGS += -static-libgcc -static-libstdc++
} else:win32 { #Windows based mingw build
TARGET = ../../../core/plugins/freeemsplugin
Expand All @@ -55,6 +57,9 @@ unix {
TARGET = ../../core/plugins/freeemsplugin
target.path = /usr/share/emstudio/plugins
INSTALLS += target
DEFINES += GIT_COMMIT=$$system(git describe --dirty=-DEV --always)
DEFINES += GIT_HASH=$$system(git log -n 1 --pretty=format:%H)
DEFINES += GIT_DATE=\""$$system(date)"\"
}
# Input
HEADERS += datapacketdecoder.h \
Expand Down

0 comments on commit fcd7b25

Please sign in to comment.