aboutsummaryrefslogtreecommitdiff
path: root/files/es/archive/b2g_os/platform/gaia/hacking/index.html
blob: 22599068e9ca29ed0961af905477d66a5048ce99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
---
title: Hackeando Gaia
slug: Archive/B2G_OS/Platform/Gaia/Hacking
translation_of: Firefox_OS/Developing_Gaia
---
<div class="warning">
<p><span id="result_box" lang="es"><span class="hps">Esta página</span> <span class="hps">está dirigida a</span> <span class="hps">desarrolladores de</span> <span class="hps">Gaia</span></span>. Si usted está buscando información acerca de cómo construir y ejecutar Firefox OS, debería consultar la página de <a href="/en-US/docs/Mozilla/Firefox_OS/Building_and_installing_Firefox_OS" title="/en-US/docs/Mozilla/Firefox_OS/Building_and_installing_Firefox_OS">Construyendo e Instalando Firefox OS</a> en su lugar.</p>
</div>

<p>Gaia es la colección de <a href="https://developer.mozilla.org/apps" rel="nofollow">aplicaciones web</a> que forman la interfaz de <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS">Firefox OS</a>. Cualquier cosa que usted vea en la pantalla del Firefox OS es creada usando tecnologías web abiertas. Esto incluye la pantalla de inicio y todas las aplicaciones predeterminadas.</p>

<h2 id="Obteniendo_el_código_fuente">Obteniendo el código fuente</h2>

<p>Para obtener el código fuente de Gaia, <a href="https://github.com/mozilla-b2g/gaia" title="https://github.com/mozilla-b2g/gaia">fork us on GitHub</a> and then clone your fork using <a href="http://git-scm.com/" title="http://git-scm.com/">git</a>.</p>

<pre>$ git clone https://github.com/mozilla-b2g/gaia.git</pre>

<h2 id="Ejecutando_Gaia">Ejecutando Gaia</h2>

<p>Usted puede ejecutar Gaia en el escritorio, en Firefox, o en un un dispositivo móvil compatible.</p>

<h3 id="B2G_desktop">B2G desktop</h3>

<p>B2G desktop es una versión de escritorio de la aplicación de ejecución utilizada en los dispositivos Firefox OS, la cual puedes utilizar para correr Gaia en tu computadora de escritorio.</p>

<p>Puedes descargar una versión nightly de B2G desktop desde <a href="http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/" title="http://ftp.mozilla.org/pub/mozilla.org/b2g/nightly/">aquí</a>.Dependiendo de qué versión estés utilizando, puede que quieres una versión específica de latest-mozilla-b2g18. Hay versiones para Linux (32 bits y 64 bits), Mac OS X y Windows.</p>

<p>Las versiones Nightly tienen empaquetadas con ellas una versión reciente de Gaia. Una vez que hayas descargado el archivo, todo lo que necesitas es extraerlo en una carpeta y correr el binario de b2g desde la carpeta extraída.</p>

<div class="note">
<p><strong>Nota:</strong> Las versiones de 64-bits de Linux no funcionan correctamente con algunas distribuciones, se trata del <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=812484" title="FIXED: [Desktop Build] Nightly 64-bit Linux build broken">error 812484</a>. Si tienes problemas trata con una versión de 32-bits en lugar de una de 64-bits</p>
</div>

<pre>$ cd b2g
$ ./b2g</pre>

<p>Para correr B2G con tu propia versión de Gaia para propósitos de desarrollo primero necesitas una construir una versión de tu copia:</p>

<pre>$ cd /path/to/gaia
$ DEBUG=1 make</pre>

<p>Esto generara un directorio en tu carpeta gaia llamada profile. La parte DEBUG correo Gaia como aplicaciones locales en servidor-web interno, en lugar las aplicaciones empaquetadas por defecto, estas tienen que ser re-empaquetadas después de cada cambio. Puedes encontrar la ruta del perfil de directorio tomando un vistazo a la última línea de salida después de ejecutar el comando de abajo, que debería verse así:</p>

<pre>Profile Ready: please run [b2g|firefox] -profile /path/to/gaia/profile</pre>

<p>Puedes entonces correr B2G Desktop con tu perfil generado como se indica abajo:</p>

<pre>$ ./b2g /path/to/gaia/profile</pre>

<p>Si quieres puedes compilar tu propio B2G desktop desde el código.</p>

<h3 id="Usando_Gaia_en_Firefox">Usando Gaia en Firefox</h3>

<p>It's also possible to run Gaia inside of Firefox. This gives you the advantages of having a rapid development cycle, as well as standard web development tools and debuggers. See <a href="/en-US/docs/Mozilla/Firefox_OS/Using_Gaia_in_Firefox" title="/en-US/docs/Mozilla/Firefox_OS/Using_Gaia_in_Firefox">Using Gaia in Firefox</a> for details on how to do this.</p>

<h3 id="Usando_Gaia_en_un_dispositivo">Usando Gaia en un dispositivo</h3>

<p>If you have a compatible mobile device you can also run Gaia by flashing it with Firefox OS. See <a href="/en-US/docs/Mozilla/Firefox_OS/Building_and_installing_Firefox_OS" title="Mozilla/Firefox_OS/Building_and_installing_Firefox_OS">Building and installing Firefox OS</a> for details on how to do this. We also have documentation for <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing" title="https://developer.mozilla.org/en-US/docs/Mozilla/Firefox_OS/Platform/Testing">how to test Firefox OS</a>.</p>

<h2 id="Unidad_de_pruebas">Unidad de pruebas</h2>

<p>See <a href="/en-US/docs/Mozilla/Firefox_OS/Platform/Testing/Gaia_unit_tests" title="Mozilla/Firefox_OS/Platform/Testing/Gaia_unit_tests">Gaia unit tests</a> for documentation about how to create and run unit tests for Gaia.</p>

<h2 id="Presentando_errores">Presentando errores</h2>

<p>Bugs are filed on Bugzilla under <a href="https://bugzilla.mozilla.org/buglist.cgi?product=Firefox OS&amp;component=Gaia&amp;resolution=---" rel="nofollow">Firefox OS &gt; Gaia</a>. File a new bug <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox OS" title="https://bugzilla.mozilla.org/enter_bug.cgi?product=Firefox OS">under the Gaia component</a> (or one of the sub-components).</p>

<h2 id="Contribuyendo_a_Gaia">Contribuyendo a Gaia</h2>

<p>Mozilla depends on contributions from the open source community to help develop Gaia apps and we'd love you to get involved.</p>

<p>Some great places to find some bugs to start hacking on:</p>

<ul>
 <li><a href="https://bugzilla.mozilla.org/buglist.cgi?quicksearch=component:gaia%20sw:polish%20@nobody;list_id=4566236" rel="nofollow">Unowned Gaia polish bugs on Bugzilla</a></li>
 <li><a href="http://www.joshmatthews.net/bugsahoy/?b2g=1" rel="nofollow">Mentored bugs</a></li>
</ul>

<h3 id="Estilos_de_codificación_básicos">Estilos de codificación básicos</h3>

<ul>
 <li>Background:
  <ul>
   <li><a href="/en-US/docs/Developer_Guide/Coding_Style#General_practices" title="Developer_Guide/Coding_Style#General_practices">Coding Style: General practices</a></li>
   <li><a href="/en-US/docs/Developer_Guide/Coding_Style#JavaScript_practices" title="Developer_Guide/Coding_Style#JavaScript_practices">Coding Style: JavaScript practices</a></li>
   <li><a href="/en-US/docs/Developer_Guide/Coding_Style#Naming_and_formatting_guide" title="Developer_Guide/Coding_Style#Naming_and_formatting_guide">Coding Style: Naming and formatting guide</a></li>
  </ul>
 </li>
 <li>Make sure HTML files are declared <code>&lt;!DOCTYPE html&gt;</code> (that is, as HTML5 documents). If you don't, Internet Explorer 9 and later will load them in compatibility mode.</li>
 <li>Include the <code>"use strict";</code> statement (just like that, including the quotes) to the top of your JavaScript files to put them into strict mode.</li>
 <li>Always use two spaces for indentation, rather than tabs.</li>
 <li>Please use line breaks to separate logical bits of code!</li>
 <li>Multi-word file names should use the "underscore" character to separate words, <code>like_this.js</code>.</li>
 <li>Use single quotes instead of double quotes for strings.</li>
</ul>

<h4 id="Reglas_Adicionales">Reglas Adicionales</h4>

<p>Mal:</p>

<pre>if (expression) doSomething();
</pre>

<p>Correcto:</p>

<pre>if (expression) {
  doSomething();
}
</pre>

<p>If you're working on the system app, check out the guidance listed <a href="https://groups.google.com/d/msg/mozilla.dev.gaia/rEhSrw6XmT4/UNvE7qW9pgYJ" title="See_here_for_some_rules._https://groups.google.com/d/msg/mozilla.dev.gaia/rEhSrw6XmT4/UNvE7qW9pgYJ">here</a>.</p>

<p>Before submitting a patch we recommend you run <a href="http://closure-linter.googlecode.com/svn/trunk/closure_linter/gjslint.py" title="http://closure-linter.googlecode.com/svn/trunk/closure_linter/gjslint.py">gjslint</a> on it to check for any style errors:</p>

<pre>gjslint --nojsdoc my_file.js</pre>

<h3 id="Enviando_un_parche">Enviando un parche</h3>

<p>First file or assign a bug to yourself on <a href="https://bugzilla.mozilla.org/buglist.cgi?product=Firefox OS&amp;component=Gaia&amp;resolution=---" title="https://bugzilla.mozilla.org/buglist.cgi?product=Firefox OS&amp;component=Gaia&amp;resolution=---">Bugzilla</a>, you'll need a Bugzilla account.</p>

<p>Then create a branch on your fork of Gaia:</p>

<pre>$ git branch branchname
$ git checkout branchname</pre>

<p>Commit your changes:</p>

<pre>$ git add /file/to/add
$ git commit -m "Bug XXXXX - Fix the broken Gaia and save the world"</pre>

<p>Push your branch:</p>

<pre>$ git push origin branchname</pre>

<p>Send a pull request by navigating to the branch in your fork on GitHub and finding the pull request button.</p>

<p>To request a review of your patch, add an attachment to the bug in Bugzilla referencing the URL of the pull request and set the review ("r") flag to "?" and enter the bugzilla ID of one of the <a href="https://wiki.mozilla.org/Modules/FirefoxOS" title="https://wiki.mozilla.org/Modules/FirefoxOS">module owners and peers</a>. The <a href="https://addons.mozilla.org/en-US/firefox/addon/github-tweaks-for-bugzilla/" title="https://addons.mozilla.org/en-US/firefox/addon/github-tweaks-for-bugzilla/">Github tweaks for bugzilla extension on AMO</a> can help automate this process by automatically creating the attachment and adding it to the bug; you will still need to set the review flag on Bugzilla.</p>

<p>The reviewer may ask you to make some changes. Once they're is happy with your patch, they will merge it into the master branch for you. Before they do this they would prefer it if you could squash all your changes into a single commit, so your contribution can be tracked easily.</p>

<p>The person who merge the commit (usually the reviewer) would add a <code>r=</code> flag in the comment of the merge commit.</p>

<h2 id="Opciones_de_Make">Opciones de Make</h2>

<p>There are many undocumented nor unsupported environment variable presists in the Makefile. Do not depend on them as they may be removed in the future.</p>

<h3 id="Default">Default</h3>

<pre>make</pre>

<p>Make a profile with packaged apps, lunachable by B2G Desktop and can be pushed to device.</p>

<h3 id="Debug_make">Debug make</h3>

<pre>DEBUG=1 make</pre>

<p>The <code>DEBUG</code> part runs Gaia as hosted apps on a built-in web server, rather than the default packaged apps which have to be re-packaged after every change. Launch the profile with the latest Firefox Nightly will also give you nice B2G specific panels on the Firefox Developer Tools.</p>

<h3 id="Push_to_device">Push to device</h3>

<pre>make install-gaia

make reset-gaia</pre>

<p>With <code>adb</code> (Android Debug Bridge) setup, these make targets will push Gaia to the device. <code>reset-gaia</code> will purge the profile and all other webapps before pushing the new Gaia copy.</p>

<h3 id="Selective_build">Selective build</h3>

<pre>APP=system make

APP=system make install-gaia</pre>

<p>With a profile already exists, <code>APP</code> allow you to specify which app to re-package, instead of re-pack and re-push all the Gaia apps.</p>

<h3 id="High_resolution_image_assets">High resolution image assets</h3>

<pre>GAIA_DEV_PIXELS_PER_PX=1.5 make</pre>

<p>When packaging the app, replace images with their <code>*@1.5x.(gif|jpg|png)</code> ones if such image exists.</p>

<p>Gaia is currently targetting HBGA (320x240), qHD (540×960) and WVGA (480×800) only; use GAIA_DEV_PIXELS_PER_PX to make sure the images looks sharp on qHD and WVGA devices. see <a href="https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag#A_pixel_is_not_a_pixel" title="https://developer.mozilla.org/en-US/docs/Mozilla/Mobile/Viewport_meta_tag#A_pixel_is_not_a_pixel">A pixel is not a pixel</a> for more information about device pixels per css pixels.</p>

<h3 id="Script_compression_and_optimization">Script compression and optimization</h3>

<pre>GAIA_OPTIMIZE=1 make</pre>

<p>(TBA)</p>

<h3 id="App_selection">App selection</h3>

<pre>GAIA_APP_SRCDIRS=apps test_apps showcase_apps</pre>

<p>(TBA)</p>

<h3 id="App_selection_shortcuts">App selection shortcuts</h3>

<pre>PRODUCTION=1
DOGFOOD=1</pre>

<p>(TBA)</p>

<h3 id="Preference_shortcuts">Preference shortcuts</h3>

<pre>NOFTU=1
REMOTE_DEBUGGER=1</pre>

<p>(TBA)</p>

<h3 id="Device_webapp_installation_partation_selection">Device webapp installation partation selection</h3>

<pre>B2G_SYSTEM_APPS=1</pre>

<p>(TBA)</p>

<h3 id="Distribution_and_market_customization_build">Distribution and market customization build</h3>

<pre>GAIA_DISTRIBUTION_DIR=./dir</pre>

<p>Read <a href="https://wiki.mozilla.org/B2G/MarketCustomizations" title="https://wiki.mozilla.org/B2G/MarketCustomizations">Customization Overview</a> for detail.</p>

<h2 id="Contacting_the_Team">Contacting the Team</h2>

<ul>
 <li><a href="https://lists.mozilla.org/listinfo/dev-gaia" rel="nofollow">Gaia Mailing List</a></li>
 <li>#gaia IRC channel on irc.mozilla.org</li>
</ul>