This is an automated email from the ASF dual-hosted git repository. github-bot pushed a commit to branch asf-site in repository https://gitbox.apache.org/repos/asf/cordova-docs.git
The following commit(s) were added to refs/heads/asf-site by this push: new c044e72b02 Deploying to asf-site from @ apache/cordova-docs@6c7f4e24ebe63113123c4c4ad0f1aab5ba3cc1bc 🚀 c044e72b02 is described below commit c044e72b026ae5be852f270f247cebed550b95aa Author: erisu <er...@users.noreply.github.com> AuthorDate: Mon Jul 14 13:22:24 2025 +0000 Deploying to asf-site from @ apache/cordova-docs@6c7f4e24ebe63113123c4c4ad0f1aab5ba3cc1bc 🚀 --- docs/en/dev/guide/platforms/android/index.html | 32 +++++++++++++++++--------- feed.xml | 4 ++-- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/docs/en/dev/guide/platforms/android/index.html b/docs/en/dev/guide/platforms/android/index.html index 7fe40c121d..17969bbc37 100644 --- a/docs/en/dev/guide/platforms/android/index.html +++ b/docs/en/dev/guide/platforms/android/index.html @@ -2887,7 +2887,7 @@ C:\Users\[your user]\AppData\Local\Android\Sdk\emulator </code></pre></div> </div> </li> <li> - <p><a href="#extending-buildgradle">Extending <code>build.gradle</code></a> with the `build-extras.gradle file</p> + <p><a href="#extending-buildgradle">Extending <code>build.gradle</code></a> with the <code>build-extras.gradle</code> file</p> <p>Create a file named <code>build-extras.gradle</code> in the directory <code><project-root>/platforms/android/app</code> with the contents such as:</p> @@ -2898,14 +2898,29 @@ C:\Users\[your user]\AppData\Local\Android\Sdk\emulator <p>The latter two options both involve including an extra file in your Android platform folder. In general, it is discouraged to edit the contents of this folder because it is easy for those changes to be lost or overwritten. Instead, these files should be copied into the folder as part of the build command by using the <code>before_build</code> <a href="../../appdev/hooks/index.html">hook script</a>.</p> -<h4>Extending build.gradle</h4> +<h4>Extending <code>build.gradle</code></h4> -<p>If you need to customize the <code>build.gradle</code> file, rather than edit it directly, it is recommended to create a sibling file named <code>build-extras.gradle</code>. This file will be included by the main <code>build.gradle</code> script when present. This file must be placed in the <code>app</code> folder of the Android's platform directory (<code><your-project>/platforms/android/app</code>). It is recommended to use the <code>before_build</code> <a href="../../appd [...] +<p>To customize the <code>app/build.gradle</code> file without modifying it directly, create a sibling file named <code>build-extras.gradle</code>.</p> -<p>Here's an example:</p> +<p>If this file exists in the <code><your-project>/platforms/android/app</code> directory during the build process, it will be automatically applied by the app's <code>build.gradle</code> script.</p> -<div class="language-groovy highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// Example build-extras.gradle</span> -<span class="c1">// This file is included at the beginning of `build.gradle`</span> +<p>To automate placing <code>build-extras.gradle</code> in the correct location, use the <code><resource-file></code> element in <code>config.xml</code>.</p> + +<p>In the example below, the source <code>build-extras.gradle</code> is saved in a <code>res/</code> directory in the project root. It is then declared in <code>config.xml</code> to copy it to the appropriate target location:</p> + +<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><resource-file</span> <span class="na">src=</span><span class="s">"res/build-extras.gradle"</span> <span class="na">target=</span><span class="s">"app/build-extras.gradle"</span><span class="nt">/></span> +</code></pre></div></div> + +<p><strong>Note:</strong> The <code>res/</code> directory name is just an example. You can use any directory and file name you prefer. However, it's recommended not to place the file inside the <code>platforms</code>, <code>plugins</code>, or <code>www</code> directories. Also, make sure the <code>target</code> path matches exactly as shown in the example.</p> + +<p><strong>Note:</strong> Plugin developers can also include a <code>build-extras.gradle</code> file, but should use the <code><framework></code> element in <code>plugin.xml</code> instead of <code><resource-file></code>:</p> + +<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><framework</span> <span class="na">src=</span><span class="s">"build-extras.gradle"</span> <span class="na">custom=</span><span class="s">"true"</span> <span class="na">type=</span><span class="s">"gradleReference"</span> <span class="nt">/></span> +</code></pre></div></div> + +<p><strong>Example <code>build-extras.gradle</code>:</strong></p> + +<div class="language-groovy highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="c1">// This file is included at the beginning of `build.gradle`</span> <span class="c1">// special properties (see `build.gradle`) can be set and overwrite the defaults</span> <span class="n">ext</span><span class="o">.</span><span class="na">cdvDebugSigningPropertiesFile</span> <span class="o">=</span> <span class="s1">'../../android-debug-keys.properties'</span> @@ -2928,11 +2943,6 @@ C:\Users\[your user]\AppData\Local\Android\Sdk\emulator <span class="o">}</span> </code></pre></div></div> -<p>Note that plugins can also include <code>build-extras.gradle</code> files via:</p> - -<div class="language-xml highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><framework</span> <span class="na">src=</span><span class="s">"some.gradle"</span> <span class="na">custom=</span><span class="s">"true"</span> <span class="na">type=</span><span class="s">"gradleReference"</span> <span class="nt">/></span> -</code></pre></div></div> - <h4>Configuring Gradle JVM Args</h4> <p>To change the Gradle JVM args, the <code>--jvmargs</code> flag can be used with both Cordova's <code>build</code> and <code>run</code> commands. This is mostly useful for controlling how much memory gradle is allowed to use during the build process. It is recommended to allow at least 2048 MB.</p> diff --git a/feed.xml b/feed.xml index 94f44450ff..1482a1add2 100644 --- a/feed.xml +++ b/feed.xml @@ -6,8 +6,8 @@ </description> <link>https://cordova.apache.org/</link> <atom:link href="https://cordova.apache.org/feed.xml" rel="self" type="application/rss+xml"/> - <pubDate>Mon, 14 Jul 2025 02:30:48 +0000</pubDate> - <lastBuildDate>Mon, 14 Jul 2025 02:30:48 +0000</lastBuildDate> + <pubDate>Mon, 14 Jul 2025 13:21:21 +0000</pubDate> + <lastBuildDate>Mon, 14 Jul 2025 13:21:21 +0000</lastBuildDate> <generator>Jekyll v4.4.1</generator> <item> --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org For additional commands, e-mail: commits-h...@cordova.apache.org