Merge lp:~widelands-dev/widelands/move_website_binaries into lp:widelands

Proposed by kaputtnik
Status: Merged
Merged at revision: 8333
Proposed branch: lp:~widelands-dev/widelands/move_website_binaries
Merge into: lp:widelands
Diff against target: 279 lines (+62/-48)
2 files modified
compile.sh (+8/-0)
src/scripting/lua_map.cc (+54/-48)
To merge this branch: bzr merge lp:~widelands-dev/widelands/move_website_binaries
Reviewer Review Type Date Requested Status
SirVer Approve
GunChleoc Approve
Review via email: mp+319231@code.launchpad.net

Commit message

Move website related binaries to base dir in compile.sh; fixed some wrong indentation for the documentation in the website.

Description of the change

Modified the compile script to move also the website related binaries to the base dir. In conjunction with https://code.launchpad.net/~widelands-dev/widelands-website/widelands_trunk_binaries it should then be possible to use the website related binaries to upload a map in the local website.

Additionally fixed some errors in the documentation caused by using tabs (instead of spaces) for indentation and missing blank lines. E.g. https://wl.widelands.org/docs/wl/autogen_wl_map/#wl.map.ProductionSiteDescription

To post a comment you must log in.
Revision history for this message
bunnybot (widelandsofficial) wrote :

Continuous integration builds have changed state:

Travis build 2052. State: passed. Details: https://travis-ci.org/widelands/widelands/builds/208657429.
Appveyor build 1887. State: success. Details: https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_move_website_binaries-1887.

Revision history for this message
GunChleoc (gunchleoc) wrote :

Code LGTM, not tested.

review: Approve
Revision history for this message
kaputtnik (franku) wrote :

I would be pleased if SirVer could test it. I am not sure if this will work on OsX.

Revision history for this message
SirVer (sirver) wrote :

I missed this, sorry.

compile.sh basically never works for Mac OS, since there are no agreed upon search paths for libraries like they are on Linux. So for calling into cMake, the user usually has to provide a ton of extra information. This is the incantation that I am currently using:

cmake $SOURCE_DIR -G Ninja $* \
   -DCMAKE_C_COMPILER:FILEPATH="${CC}" \
   -DCMAKE_CXX_COMPILER:FILEPATH="${CXX}" \
   -DCMAKE_BUILD_TYPE:STRING="${BUILD_TYPE}" \
   -DGLEW_INCLUDE_DIR:PATH="$(brew --prefix glew)/include" \
   -DGLEW_LIBRARY:PATH="$(brew --prefix glew)/lib/libGLEW.dylib" \
   -DCMAKE_PREFIX_PATH:PATH="${PREFIX_PATH}" \
   -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=ON \
   -DOPTION_USE_GLBINDING:BOOL=ON

However, if compile.sh works for a user (it does not for me without patching), the rest of the logic changes you wrote *should* just work under Mac OS X as well.

What I did test is that copying the binaries into the root of the repository and running them there works as expected, as long as you are CDed there.

This works:
cp <BUILD>/src/website/wl_map_object_info <SOURCE>
cd <SOURCE> && ./wl_map_object_info /tmp

This does not:
cp <BUILD>/src/website/wl_map_object_info <SOURCE>
cd <SOURCE>/src && ../wl_map_object_info /tmp

review: Approve
Revision history for this message
GunChleoc (gunchleoc) wrote :

Maybe we should document those cmake options in the wiki?

https://wl.widelands.org/wiki/Building%20Widelands/#building-under-mac-os-x

Revision history for this message
GunChleoc (gunchleoc) wrote :

@bunnybot merge

Revision history for this message
kaputtnik (franku) wrote :

Thanks for looking into it and merging :-)

So i think the website related branch could also be merged then...

This is quite convenient for me, because i didn't have to install and update the latest package from the arch-linux repo. A few steps less to do, since i update latest trunk regularly and use the compile script.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'compile.sh'
2--- compile.sh 2017-02-14 18:11:53 +0000
3+++ compile.sh 2017-03-07 16:43:27 +0000
4@@ -128,8 +128,16 @@
5 rm -f ../VERSION || true
6 rm -f ../widelands || true
7
8+ rm -f ../wl_map_object_info || true
9+ rm -f ../wl_map_info || true
10+
11 mv VERSION ../VERSION
12 mv src/widelands ../widelands
13+
14+ if [ $BUILD_WEBSITE = "ON" ]; then
15+ mv ../build/src/website/wl_map_object_info ../wl_map_object_info
16+ mv ../build/src/website/wl_map_info ../wl_map_info
17+ fi
18 return 0
19 }
20
21
22=== modified file 'src/scripting/lua_map.cc'
23--- src/scripting/lua_map.cc 2017-01-30 14:40:12 +0000
24+++ src/scripting/lua_map.cc 2017-03-07 16:43:27 +0000
25@@ -1688,9 +1688,9 @@
26 }
27
28 /* RST
29- .. attribute:: the name and descname of the editor category of this immovable
30+ .. attribute:: the name and descname of the editor category of this immovable
31
32- (RO) a table with "name" and "descname" entries for the editor category, or nil if it has none.
33+ (RO) a table with "name" and "descname" entries for the editor category, or nil if it has none.
34 */
35 int LuaImmovableDescription::get_editor_category(lua_State* L) {
36 const EditorCategory* editor_category = get()->editor_category();
37@@ -1709,11 +1709,11 @@
38 }
39
40 /* RST
41- .. attribute:: returns the terrain affinity values for this immovable
42+ .. attribute:: returns the terrain affinity values for this immovable
43
44- (RO) a table containing numbers labeled as pickiness (double), preferred_fertility (double),
45- preferred_humidity (double), and preferred_temperature (uint),
46- or nil if the immovable has no terrain affinity.
47+ (RO) a table containing numbers labeled as pickiness (double), preferred_fertility (double),
48+ preferred_humidity (double), and preferred_temperature (uint),
49+ or nil if the immovable has no terrain affinity.
50 */
51 int LuaImmovableDescription::get_terrain_affinity(lua_State* L) {
52 if (get()->has_terrain_affinity()) {
53@@ -2129,6 +2129,7 @@
54
55 /* RST
56 .. attribute:: inputs
57+
58 (RO) An array with :class:`LuaWareDescription` containing the wares that
59 the productionsite needs for its production.
60 */
61@@ -2146,6 +2147,7 @@
62
63 /* RST
64 .. attribute:: output_ware_types
65+
66 (RO) An array with :class:`LuaWareDescription` containing the wares that
67 the productionsite can produce.
68 */
69@@ -2164,6 +2166,7 @@
70
71 /* RST
72 .. attribute:: output_worker_types
73+
74 (RO) An array with :class:`LuaWorkerDescription` containing the workers that
75 the productionsite can produce.
76 */
77@@ -2198,6 +2201,7 @@
78
79 /* RST
80 .. attribute:: working_positions
81+
82 (RO) An array with :class:`WorkerDescription` containing the workers that
83 can work here with their multiplicity, i.e. for a atlantean mine this
84 would be { miner, miner, miner }.
85@@ -2219,13 +2223,13 @@
86 }
87
88 /* RST
89- .. attribute:: consumed_wares_workers
90-
91- :arg program_name: the name of the production program that we want to get the consumed wares for
92- :type tribename: :class:`string`
93-
94- (RO) Returns a table of {{ware name}, ware amount} for the wares consumed by this production program.
95- Multiple entries in {ware name} are alternatives (OR logic)).
96+ .. attribute:: consumed_wares_workers
97+
98+ :arg program_name: the name of the production program that we want to get the consumed wares for
99+ :type tribename: :class:`string`
100+
101+ (RO) Returns a table of {{ware name}, ware amount} for the wares consumed by this production program.
102+ Multiple entries in {ware name} are alternatives (OR logic)).
103 */
104 int LuaProductionSiteDescription::consumed_wares_workers(lua_State* L) {
105 std::string program_name = luaL_checkstring(L, -1);
106@@ -2253,12 +2257,12 @@
107 }
108
109 /* RST
110- .. attribute:: produced_wares
111-
112- :arg program_name: the name of the production program that we want to get the produced wares for
113- :type tribename: :class:`string`
114-
115- (RO) Returns a table of {ware name, ware amount} for the wares produced by this production program
116+ .. attribute:: produced_wares
117+
118+ :arg program_name: the name of the production program that we want to get the produced wares for
119+ :type tribename: :class:`string`
120+
121+ (RO) Returns a table of {ware name, ware amount} for the wares produced by this production program
122 */
123 int LuaProductionSiteDescription::produced_wares(lua_State* L) {
124 std::string program_name = luaL_checkstring(L, -1);
125@@ -2271,13 +2275,13 @@
126 }
127
128 /* RST
129- .. attribute:: recruited_workers
130-
131- :arg program_name: the name of the production program that we want to get the recruited workers for
132- :type tribename: :class:`string`
133-
134- (RO) Returns a table of {worker name, worker amount} for the workers recruited
135- by this production program
136+ .. attribute:: recruited_workers
137+
138+ :arg program_name: the name of the production program that we want to get the recruited workers for
139+ :type tribename: :class:`string`
140+
141+ (RO) Returns a table of {worker name, worker amount} for the workers recruited
142+ by this production program
143 */
144 int LuaProductionSiteDescription::recruited_workers(lua_State* L) {
145 std::string program_name = luaL_checkstring(L, -1);
146@@ -2344,10 +2348,10 @@
147
148 .. class:: TrainingSiteDescription
149
150- A static description of a tribe's trainingsite, so it can be used in help files
151- without having to access an actual building on the map.
152- A training site can train some or all of a soldier's properties (Attack, Defense, Evade and Health).
153- See also :class:`ProductionSiteDescription` and :class:`MapObjectDescription` for more properties.
154+ A static description of a tribe's trainingsite, so it can be used in help files
155+ without having to access an actual building on the map.
156+ A training site can train some or all of a soldier's properties (Attack, Defense, Evade and Health).
157+ See also :class:`ProductionSiteDescription` and :class:`MapObjectDescription` for more properties.
158 */
159 const char LuaTrainingSiteDescription::className[] = "TrainingSiteDescription";
160 const MethodType<LuaTrainingSiteDescription> LuaTrainingSiteDescription::Methods[] = {
161@@ -2686,6 +2690,7 @@
162
163 /* RST
164 .. attribute:: consumers
165+
166 (RO) An array with :class:`LuaBuildingDescription` with buildings that
167 need this ware for their production.
168 */
169@@ -2712,7 +2717,7 @@
170 }
171
172 /* RST
173- .. .. method:: is_construction_material
174+ .. method:: is_construction_material
175
176 :arg tribename: the name of the tribe that this ware gets checked for
177 :type tribename: :class:`string`
178@@ -2734,6 +2739,7 @@
179
180 /* RST
181 .. attribute:: producers
182+
183 (RO) An array with :class:`LuaBuildingDescription` with buildings that
184 can procude this ware.
185 */
186@@ -2828,6 +2834,7 @@
187
188 /* RST
189 .. attribute:: employers
190+
191 (RO) An array with :class:`LuaBuildingDescription` with buildings where
192 this worker can be employed.
193 */
194@@ -3140,11 +3147,11 @@
195 */
196
197 /* RST
198- .. method:: editor_image(amount)
199-
200- :arg amount: The amount of the resource what we want an overlay image for
201-
202- (RO) the :class:`string` path to the image representing the specified amount of this resource
203+ .. method:: editor_image(amount)
204+
205+ :arg amount: The amount of the resource what we want an overlay image for
206+
207+ (RO) the :class:`string` path to the image representing the specified amount of this resource
208 */
209 int LuaResourceDescription::editor_image(lua_State* L) {
210 if (lua_gettop(L) != 2) {
211@@ -3220,10 +3227,10 @@
212 }
213
214 /* RST
215- .. attribute:: get_default_resource
216+ .. attribute:: get_default_resource
217
218- (RO) the :class:`wl.map.ResourceDescription` for the default resource provided by this terrain, or
219- nil if the terrain has no default resource.
220+ (RO) the :class:`wl.map.ResourceDescription` for the default resource provided by this terrain, or
221+ nil if the terrain has no default resource.
222 */
223
224 int LuaTerrainDescription::get_default_resource(lua_State* L) {
225@@ -3241,7 +3248,7 @@
226 /* RST
227 .. attribute:: default_resource_amount
228
229- (RO) the int amount of the default resource provided by this terrain.
230+ (RO) the int amount of the default resource provided by this terrain.
231 */
232
233 int LuaTerrainDescription::get_default_resource_amount(lua_State* L) {
234@@ -3250,9 +3257,9 @@
235 }
236
237 /* RST
238- .. attribute:: the name and descname of the editor category of this terrain
239+ .. attribute:: the name and descname of the editor category of this terrain
240
241- (RO) a table with "name" and "descname" entries for the editor category, or nil if it has none.
242+ (RO) a table with "name" and "descname" entries for the editor category, or nil if it has none.
243 */
244 int LuaTerrainDescription::get_editor_category(lua_State* L) {
245 const EditorCategory* editor_category = get()->editor_category();
246@@ -3315,9 +3322,9 @@
247 }
248
249 /* RST
250- .. attribute:: valid_resources
251+ .. attribute:: valid_resources
252
253- (RO) a list of :class:`wl.map.ResourceDescription` with all valid resources for this terrain.
254+ (RO) a list of :class:`wl.map.ResourceDescription` with all valid resources for this terrain.
255 */
256
257 int LuaTerrainDescription::get_valid_resources(lua_State* L) {
258@@ -3400,8 +3407,7 @@
259 /* RST
260 .. attribute:: serial
261
262- (RO)
263- The serial number of this object. Note that this value does not stay
264+ (RO) The serial number of this object. Note that this value does not stay
265 constant after saving/loading.
266 */
267 int LuaMapObject::get_serial(lua_State* L) {
268@@ -3414,9 +3420,9 @@
269 to_lua<lua_klass>(L, new lua_klass(static_cast<const klass*>(desc)))
270
271 /* RST
272- .. attribute:: descr
273+ .. attribute:: descr
274
275- (RO) The description object for this immovable, e.g. BuildingDescription.
276+ (RO) The description object for this immovable, e.g. BuildingDescription.
277 */
278 int LuaMapObject::get_descr(lua_State* L) {
279 const MapObjectDescr* desc = &get(L, get_egbase(L))->descr();

Subscribers

People subscribed via source and target branches

to status/vote changes: