Skip to content

Commit b5c4d28

Browse files
committedMar 20, 2016
build context help and expression help in build directory and still include it in translations
1 parent 5769f3b commit b5c4d28

File tree

6 files changed

+38
-17
lines changed

6 files changed

+38
-17
lines changed
 

‎.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ scripts/astyle.exe
5151
scripts/Debug
5252
scripts/qgisstyle*
5353
scripts/RelWithDebInfo
54-
src/core/qgscontexthelp_texts.cpp
55-
src/core/qgsexpression_texts.cpp
5654
tests/testdata/checker360by180.asc.aux.xml
5755
tests/testdata/grass/wgs84/test/.gislock
5856
tests/testdata/grass/wgs84/test6/.gislock

‎debian/rules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -216,10 +216,6 @@ binary binary-arch binary-indep build build-arch build-indep clean install insta
216216
override_dh_clean: cleantemplates
217217
dh_clean qgis.bin.1 qbrowser.bin.1
218218

219-
# automatically generated files
220-
-$(RM) $(CURDIR)/src/core/qgscontexthelp_texts.cpp
221-
-$(RM) $(CURDIR)/src/core/qgsexpression_texts.cpp
222-
223219
-$(RM) -r $(CURDIR)/$(QGIS_BUILDDIR)/
224220

225221
override_dh_auto_configure:

‎scripts/astyle.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ for f in "$@"; do
8989

9090
*.py)
9191
#cmd="autopep8 --in-place --ignore=E111,E128,E201,E202,E203,E211,E221,E222,E225,E226,E227,E231,E241,E261,E265,E272,E302,E303,E501,E701"
92+
echo -ne "Formatting $f $elcr"
9293
cmd="autopep8 --in-place --ignore=E261,E265,E402,E501"
9394
;;
9495

‎scripts/update_ts.sh

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pull|push|update)
2121
;;
2222

2323
*)
24-
echo "usage: $(basename $0) {push|pull|update}"
24+
echo "usage: $(basename $0) {push|pull|update} builddirectory"
2525
exit 1
2626
esac
2727

@@ -87,6 +87,17 @@ elif [ $1 = pull ]; then
8787
tx pull -a -s --minimum-perc=35
8888
fi
8989

90+
builddir=$2
91+
if [ ! -d "$builddir" ]; then
92+
echo Build directory not found
93+
exit 1
94+
fi
95+
96+
if [ ! -f "$builddir/src/core/qgsexpression_texts.cpp" -o ! -f "$builddir/src/core/qgscontexthelp_texts.cpp" ]; then
97+
echo Generated help files not found
98+
exit 1
99+
fi
100+
90101
echo Updating python translations
91102
cd python
92103
pylupdate4 user.py utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts
@@ -108,11 +119,13 @@ echo Updating processing translations
108119
perl scripts/processing2cpp.pl python/plugins/processing/processing-i18n.cpp
109120

110121
echo Creating qmake project file
111-
$QMAKE -project -o qgis_ts.pro -nopwd src python i18n
122+
$QMAKE -project -o qgis_ts.pro -nopwd src python i18n "$builddir/src/core/qgsexpression_texts.cpp" "$builddir/src/core/qgscontexthelp_texts.cpp"
112123

113124
echo Updating translations
114125
$LUPDATE -locations absolute -verbose qgis_ts.pro
115126

127+
perl -i.bak -ne 'print unless /^\s+<location.*qgs(expression|contexthelp)_texts\.cpp.*$/;' i18n/qgis_*.ts
128+
116129
if [ $1 = push ]; then
117130
echo Pushing translation...
118131
tx push -s

‎scripts/update_ts_files.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ cleanup() {
3232
fi
3333

3434
echo Removing temporary files
35-
perl -i.bak -ne 'print unless /^\s+<location.*python-i18n\.cpp.*$/;' i18n/qgis_*.ts
35+
perl -i.bak -ne 'print unless /^\s+<location.*(python-i18n|_texts)\.cpp.*$/;' i18n/qgis_*.ts
3636
for i in \
3737
python/python-i18n.{ts,cpp} \
3838
python/plugins/*/python-i18n.{ts,cpp} \
@@ -105,6 +105,17 @@ if [ "$exclude" != "--exclude i18n/qgis_en.ts" -o -n "$add" ]; then
105105
tar $fast -cf i18n/qgis_ts.tar i18n/qgis_*.ts $exclude
106106
fi
107107

108+
builddir=$1
109+
if [ -d "$builddir" ]; then
110+
echo Build directory not found
111+
exit 1
112+
fi
113+
114+
if [ ! -f "$builddir/src/core/qgsexpression_texts.cpp" -o ! -f "$builddir/src/core/qgscontexthelp_texts.cpp" ]; then
115+
echo Generated help files not found
116+
exit 1
117+
fi
118+
108119
echo Updating python translations
109120
cd python
110121
pylupdate4 utils.py {console,pyplugin_installer}/*.{py,ui} -ts python-i18n.ts
@@ -128,7 +139,7 @@ for i in \
128139
do
129140
[ -f "$i" ] && mv "$i" "$i.save"
130141
done
131-
$QMAKE -project -o qgis_ts.pro -nopwd src python i18n
142+
$QMAKE -project -o qgis_ts.pro -nopwd src python i18n "$builddir/src/core/qgsexpression_texts.cpp" "$builddir/src/core/qgscontexthelp_texts.cpp"
132143
if [ -n "$add" ]; then
133144
for i in $add; do
134145
echo "Adding translation for $i"

‎src/core/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ SET(QGIS_CORE_SRCS
8585
qgscolorschemeregistry.cpp
8686
qgsconditionalstyle.cpp
8787
qgscontexthelp.cpp
88-
qgscontexthelp_texts.cpp
8988
qgscoordinatereferencesystem.cpp
9089
qgscoordinatetransform.cpp
9190
qgscoordinateutils.cpp
@@ -106,7 +105,6 @@ SET(QGIS_CORE_SRCS
106105
qgsexpression.cpp
107106
qgsexpressioncontext.cpp
108107
qgsexpressionfieldbuffer.cpp
109-
qgsexpression_texts.cpp
110108
qgsfeature.cpp
111109
qgsfeatureiterator.cpp
112110
qgsfeaturerequest.cpp
@@ -340,23 +338,27 @@ SET(QGIS_CORE_SRCS
340338
geometry/qgspolygonv2.cpp
341339
geometry/qgswkbptr.cpp
342340
geometry/qgswkbtypes.cpp
341+
342+
${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp
343+
${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp
343344
)
344345

346+
345347
FILE(GLOB JSON_HELP_FILES "${CMAKE_SOURCE_DIR}/resources/function_help/json/*")
346348
STRING(REPLACE "$" "$$" JSON_HELP_FILES "${JSON_HELP_FILES}")
347349
STRING(REPLACE "\(" "\\(" JSON_HELP_FILES "${JSON_HELP_FILES}")
348350
STRING(REPLACE "\)" "\\)" JSON_HELP_FILES "${JSON_HELP_FILES}")
349-
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp
351+
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp
350352
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/process_function_template.py ${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp
351-
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp -DDST=${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
353+
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp.temp -DDST=${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
352354
DEPENDS ${JSON_HELP_FILES}
353355
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
354356
)
355357

356358
FILE(GLOB CONTEXT_HELP_FILES "${CMAKE_SOURCE_DIR}/resources/context_help/*")
357-
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/qgscontexthelp_texts.cpp
359+
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp
358360
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/scripts/process_contexthelp.py ${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp.temp
359-
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp.temp -DDST=${CMAKE_CURRENT_SOURCE_DIR}/qgscontexthelp_texts.cpp -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
361+
COMMAND ${CMAKE_COMMAND} -DSRC=${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp.temp -DDST=${CMAKE_CURRENT_BINARY_DIR}/qgscontexthelp_texts.cpp -P ${CMAKE_SOURCE_DIR}/cmake/CopyIfChanged.cmake
360362
DEPENDS ${CONTEXT_HELP_FILES}
361363
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
362364
)
@@ -565,7 +567,7 @@ IF(MSVC)
565567
ELSE(MSVC)
566568
SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
567569
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" AND (CMAKE_BUILD_TYPE MATCHES Release OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo))
568-
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/qgsexpression_texts.cpp PROPERTIES COMPILE_FLAGS "-O1")
570+
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/qgsexpression_texts.cpp PROPERTIES COMPILE_FLAGS "-O1")
569571
ENDIF ()
570572
ENDIF(MSVC)
571573

0 commit comments

Comments
 (0)
Please sign in to comment.