Skip to content

Commit

Permalink
Merge pull request sonic-pi-net#1002 from hzulla/revert-qmake
Browse files Browse the repository at this point in the history
Revert "Merge pull request sonic-pi-net#999 from hzulla/qmake"
  • Loading branch information
samaaron committed Feb 18, 2016
2 parents 62d7bc0 + 849752c commit c3583d6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 19 deletions.
12 changes: 0 additions & 12 deletions app/gui/qt/SonicPi.pro
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ unix:!macx {
LIBS += -lqt5scintilla2
}
QMAKE_CXXFLAGS += -Wall -Werror -Wextra
RUBY_PATH = /usr/bin/ruby
}

# Mac OS X only
Expand All @@ -49,31 +48,20 @@ macx {
QT += macextras
DEFINES += DONT_USE_OSX_KEYS
QMAKE_CXXFLAGS += -Wall -Werror -Wextra
RUBY_PATH = ../../server/native/osx/ruby/bin/ruby
}

# Windows only
win32 {
LIBS += -lqscintilla2
QMAKE_CXXFLAGS += /WX
DEFINES += _CRT_SECURE_NO_WARNINGS _WINSOCK_DEPRECATED_NO_WARNINGS
RUBY_PATH = ..\..\server\native\windows\ruby\bin\ruby
}

CODECFORSRC = UTF-8
CODECFORTR = UTF-8

TEMPLATE = app

sonicpidocs.name = Generate HTML files and ruby_help.h from markdown files
sonicpidocs.commands = $${RUBY_PATH} ../../server/bin/qt-doc.rb -o ruby_help.h
sonicpidocs.target = ruby_help.h
sonicpidocs.depends = FORCE

PRE_TARGETDEPS += ruby_help.h
QMAKE_CLEAN += ruby_help.h
QMAKE_EXTRA_TARGETS += sonicpidocs

SOURCES += main.cpp \
mainwindow.cpp \
sonicpilexer.cpp \
Expand Down
4 changes: 4 additions & 0 deletions app/gui/qt/mac-build-app
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ cd $(dirname $0)
rm -rf build
mkdir build

# Generate automated docs
cp -f ruby_help.tmpl ruby_help.h
../../server/native/osx/ruby/bin/ruby ../../server/bin/qt-doc.rb -o ruby_help.h

# Generate i18n files
$LREL SonicPi.pro

Expand Down
2 changes: 2 additions & 0 deletions app/gui/qt/rp-build-app
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ set -eux

cd $(dirname $0)

cp -f ruby_help.tmpl ruby_help.h
../../server/bin/qt-doc.rb -o ruby_help.h
lrelease SonicPi.pro
qmake -o Makefile SonicPi.pro || qmake-qt4 -o Makefile SonicPi.pro
set +x
Expand Down
16 changes: 16 additions & 0 deletions app/gui/qt/ruby_help.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//--
// This file is part of Sonic Pi: http://sonic-pi.net
// Full project source: https://github.com/samaaron/sonic-pi
// License: https://github.com/samaaron/sonic-pi/blob/master/LICENSE.md
//
// Copyright 2013, 2014 by Sam Aaron (http://sam.aaron.name).
// All rights reserved.
//
// Permission is granted for use, copying, modification, distribution,
// and distribution of modified versions of this work as long as this
// notice is included.
//++

// AUTO-GENERATED-DOCS
// Do not manually add any code below this comment
// otherwise it may be removed
5 changes: 5 additions & 0 deletions app/gui/qt/win-build-app.bat
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cd %~dp0

copy /Y ruby_help.tmpl ruby_help.h
..\..\server\native\windows\ruby\bin\ruby ../../server/bin/qt-doc.rb -o ruby_help.h
@IF ERRORLEVEL==9009 goto :noruby
@IF ERRORLEVEL==1 goto :docfail

lrelease SonicPi.pro
@IF ERRORLEVEL==9009 goto :noqt

Expand Down
13 changes: 6 additions & 7 deletions app/server/bin/qt-doc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -259,19 +259,18 @@
end


# update ruby_help.h
if options[:output_name] then
cpp = options[:output_name]
else
cpp = "#{qt_gui_path}/ruby_help.h"
end

new_content = [<<INCLUDEHEADER]
// AUTO-GENERATED-DOCS
// Do not manually add any code below this comment
// otherwise it may be removed
INCLUDEHEADER

content = File.readlines(cpp)
new_content = content.take_while { |line| !line.start_with?("// AUTO-GENERATED-DOCS")}
new_content << "// AUTO-GENERATED-DOCS\n"
new_content << "// Do not manually add any code below this comment\n"
new_content << "// otherwise it may be removed\n"
new_content << "\n"
new_content << "void MainWindow::initDocsWindow() {\n"
new_content += docs
Expand Down

0 comments on commit c3583d6

Please sign in to comment.