/usr/share/doc/fdroidserver/html/html_node/Build.html is in fdroidserver 0.2.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- This manual is for the F-Droid repository server tools.
Copyright (C) 2010, 2011, 2012, 2013 Ciaran Gultnieks
Copyright (C) 2011 Henrik Tunedal, Michael Haas, John Sullivan
Copyright (C) 2013 David Black
Copyright (C) 2013, 2014 Daniel Martí
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled "GNU
Free Documentation License". -->
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>F-Droid Server Manual: Build</title>
<meta name="description" content="F-Droid Server Manual: Build">
<meta name="keywords" content="F-Droid Server Manual: Build">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Index.html#Index" rel="index" title="Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Metadata.html#Metadata" rel="up" title="Metadata">
<link href="AntiFeatures.html#AntiFeatures" rel="next" title="AntiFeatures">
<link href="Repo.html#Repo" rel="prev" title="Repo">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {margin-left: 3.2em}
kbd {font-style:oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>
</head>
<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="Build"></a>
<div class="header">
<p>
Next: <a href="AntiFeatures.html#AntiFeatures" accesskey="n" rel="next">AntiFeatures</a>, Previous: <a href="Repo.html#Repo" accesskey="p" rel="prev">Repo</a>, Up: <a href="Metadata.html#Metadata" accesskey="u" rel="up">Metadata</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="Build-1"></a>
<h3 class="section">7.18 Build</h3>
<a name="index-Build"></a>
<p>Any number of these fields can be present, each specifying a version to
automatically build from source. The value is a comma-separated list.
For example:
</p>
<p>‘<samp>Build:1.2,12</samp>’
</p>
<p>The above specifies to build version 1.2, which has a version code of 12.
The <code>commit=</code> parameter specifies the tag, commit or revision number from
which to build it in the source repository. It is the only mandatory flag,
which in this case could for example be <code>commit=v1.2</code>.
</p>
<p>In addition to the three, always required, parameters described above,
further parameters can be added (in name=value format) to apply further
configuration to the build. These are (roughly in order of application):
</p>
<dl compact="compact">
<dt><code>disable=<message></code></dt>
<dd><p>Disables this build, giving a reason why. (For backwards compatibility, this
can also be achieved by starting the commit ID with ’!’)
</p>
<p>The purpose of this feature is to allow non-buildable releases (e.g. the source
is not published) to be flagged, so the scripts don’t generate repeated
messages about them. (And also to record the information for review later).
If an apk has already been built, disabling causes it to be deleted once
<code>fdroid update</code> is run; this is the procedure if ever a version has to
be replaced.
</p>
</dd>
<dt><code>subdir=<path></code></dt>
<dd><p>Specifies to build from a subdirectory of the checked out source code.
Normally this directory is changed to before building,
</p>
</dd>
<dt><code>submodules=yes</code></dt>
<dd><p>Use if the project (git only) has submodules - causes <code>git submodule
update --init --recursive</code> to be executed after the source is cloned.
Submodules are reset and cleaned like the main app repository itself before
each build.
</p>
</dd>
<dt><code>init=xxxx</code></dt>
<dd><p>As for ’prebuild’, but runs on the source code BEFORE any other processing
takes place.
</p>
<p>You can use $$SDK$$, $$NDK$$ and $$MVN3$$ to substitute the paths to the
android SDK and NDK directories, and maven 3 executable respectively.
</p>
</dd>
<dt><code>oldsdkloc=yes</code></dt>
<dd><p>The sdk location in the repo is in an old format, or the build.xml is
expecting such. The ’new’ format is sdk.dir while the VERY OLD format
is sdk-location. Typically, if you get a message along the lines of:
"com.android.ant.SetupTask cannot be found" when trying to build, then
try enabling this option.
</p>
</dd>
<dt><code>target=<target></code></dt>
<dd><p>Specifies a particular SDK target for compilation, overriding the value
defined in the code by upstream. This has different effects depending on what
build system used — this flag currently affects Ant, Maven and Gradle projects
only. Note that this does not change the target SDK in the
AndroidManifest.xml, which determines the level of features that can be
included in the build.
</p>
<p>In the case of an Ant project, it modifies project.properties of the app and
possibly sub-projects. This is likely to cause the whole build.xml to be
rewritten, which is fine if it’s a ’standard’ android file or doesn’t already
exist, but not a good idea if it’s heavily customised.
</p>
</dd>
<dt><code>update=<auto/dirs></code></dt>
<dd><p>By default, ’android update’ is used in Ant builds to generate or update the
project and all its referenced projects. Specifying update=no bypasses that.
Note that this is useless in builds that don’t use Ant.
</p>
<p>Default value is ’<code>auto</code>’, which recursively uses the paths in
project.properties to find all the subprojects to update.
</p>
<p>Otherwise, the value can be a comma-separated list of directories in which to
run ’android update’ relative to the application directory.
</p>
</dd>
<dt><code>encoding=xxxx</code></dt>
<dd><p>Adds a java.encoding property to local.properties with the given
value. Generally the value will be ’utf-8’. This is picked up by the
SDK’s ant rules, and forces the Java compiler to interpret source
files with this encoding. If you receive warnings during the compile
about character encodings, you probably need this.
</p>
</dd>
<dt><code>forceversion=yes</code></dt>
<dd><p>If specified, the package version in AndroidManifest.xml is replaced
with the version name for the build as specified in the metadata.
</p>
<p>This is useful for cases when upstream repo failed to update it for
specific tag; to build an arbitrary revision; to make it apparent that
the version differs significantly from upstream; or to make it apparent
which architecture or platform the apk is designed to run on.
</p>
</dd>
<dt><code>forcevercode=yes</code></dt>
<dd><p>If specified, the package version code in the AndroidManifest.xml is
replaced with the version code for the build. See also forceversion.
</p>
</dd>
<dt><code>rm=relpath1,relpath2,...</code></dt>
<dd><p>Specifies the relative paths of files or directories to delete before
the build is done. The paths are relative to the base of the build
directory - i.e. the root of the directory structure checked out from
the source respository - not necessarily the directory that contains
AndroidManifest.xml.
</p>
<p>Multiple files/directories can be specified by separating them with ’,’.
Directories will be recursively deleted.
</p>
</dd>
<dt><code>extlibs=a,b,...</code></dt>
<dd><p>Comma-separated list of external libraries (jar files) from the
<code>build/extlib</code> library, which will be placed in the <code>libs</code> directory
of the project.
</p>
</dd>
<dt><code>srclibs=[n:]a@r,[n:]b@r1,...</code></dt>
<dd><p>Comma-separated list of source libraries or Android projects. Each item is of
the form name@rev where name is the predefined source library name and rev is
the revision or tag to use in the respective source control.
</p>
<p>For Ant projects, you can optionally append a number with a colon at the
beginning of a srclib item to automatically place it in project.properties as
a library under the specified number. For example, if you specify
<code>1:somelib@1.0</code>, f-droid will automatically do the equivalent of the
legacy practice <code>prebuild=echo "android.library.reference.1=$$somelib$$"
>> project.properties</code>.
</p>
<p>Each srclib has a metadata file under srclibs/ in the repository directory,
and the source code is stored in build/srclib/.
Repo Type: and Repo: are specified in the same way as for apps; Subdir: can be
a comma separated list, for when directories are renamed by upstream; Update
Project: updates the projects in the working directory and one level down;
Prepare: can be used for any kind of preparation: in particular if you need to
update the project with a particular target. You can then also use $$name$$ in
the init/prebuild/build command to substitute the relative path to the library
directory, but it could need tweaking if you’ve changed into another directory.
</p>
</dd>
<dt><code>patch=x</code></dt>
<dd><p>Apply patch(es). ’x’ names one (or more - comma-seperated) files within a
directory below the metadata, with the same name as the metadata file but
without the extension. Each of these patches is applied to the code in turn.
</p>
</dd>
<dt><code>prebuild=xxxx</code></dt>
<dd><p>Specifies a shell command (or commands - chain with &&) to run before the
build takes place. Backslash can be used as an escape character to insert
literal commas, or as the last character on a line to join that line with the
next. It has no special meaning in other contexts; in particular, literal
backslashes should not be escaped.
</p>
<p>The command runs using bash.
</p>
<p>Note that nothing should be built during this prebuild phase - scanning of the
code and building of the source tarball, for example, take place after this.
For custom actions that actually build things or produce binaries, use ’build’
instead.
</p>
<p>You can use $$name$$ to substitute the path to a referenced srclib - see
the <code>srclib</code> directory for details of this.
</p>
<p>You can use $$SDK$$, $$NDK$$ and $$MVN3$$ to substitute the paths to the
android SDK and NDK directories, and Maven 3 executable respectively e.g.
for when you need to run <code>android update project</code> explicitly.
</p>
</dd>
<dt><code>scanignore=path1,path2,...</code></dt>
<dd><p>Enables one or more files/paths to be excluded from the scan process.
This should only be used where there is a very good reason, and
probably accompanied by a comment explaining why it is necessary.
</p>
<p>When scanning the source tree for problems, matching files whose relative
paths start with any of the paths given here are ignored.
</p>
</dd>
<dt><code>scandelete=path1,path2,...</code></dt>
<dd><p>Similar to scanignore=, but instead of ignoring files under the given paths,
it tells f-droid to delete the matching files directly.
</p>
</dd>
<dt><code>build=xxxx</code></dt>
<dd><p>As for ’prebuild’, but runs during the actual build phase (but before the
main Ant/Maven build). Use this only for actions that do actual building.
Any prepartion of the source code should be done using ’init’ or ’prebuild’.
</p>
<p>Any building that takes place before build= will be ignored, as either Ant,
mvn or gradle will be executed to clean the build environment right before
build= (or the final build) is run.
</p>
<p>You can use $$SDK$$, $$NDK$$ and $$MVN3$$ to substitute the paths to the
android SDK and NDK directories, and Maven 3 executable respectively.
</p>
</dd>
<dt><code>buildjni=[yes|no|<dir list>]</code></dt>
<dd><p>Enables building of native code via the ndk-build script before doing
the main Ant build. The value may be a list of directories relative
to the main application directory in which to run ndk-build, or ’yes’
which corresponds to ’.’ . Using explicit list may be useful to build
multi-component projects.
</p>
<p>The build and scan processes will complain (refuse to build) if this
parameter is not defined, but there is a <code>jni</code> directory present.
If the native code is being built by other means like a Gradle task, you
can specify <code>no</code> here to avoid that. However, if the native code is
actually not required or used, remove the directory instead (using
<code>rm=jni</code> for example). Using <code>buildjni=no</code> when the jni code
isn’t used nor built will result in an error saying that native
libraries were expected in the resulting package.
</p>
</dd>
<dt><code>gradle=<flavour></code></dt>
<dd><p>Build with Gradle instead of Ant, specifying what flavour to assemble.
If <flavour> is ’yes’ or ’main’, no flavour will be used. Note
that this will not work on projects with flavours, since it will build
all flavours and there will be no ’main’ build.
</p>
</dd>
<dt><code>maven=yes[@<dir>]</code></dt>
<dd><p>Build with Maven instead of Ant. An extra @<dir> tells f-droid to run Maven
inside that relative subdirectory. Sometimes it is needed to use @.. so that
builds happen correctly.
</p>
</dd>
<dt><code>preassemble=<task1> <task2></code></dt>
<dd><p>Space-separated list of Gradle tasks to be run before the assemble task
in a Gradle project build.
</p>
</dd>
<dt><code>antcommand=xxx</code></dt>
<dd><p>Specify an alternate Ant command (target) instead of the default
’release’. It can’t be given any flags, such as the path to a build.xml.
</p>
</dd>
<dt><code>output=path/to/output.apk</code></dt>
<dd><p>To be used when app is built with a tool other than the ones natively
supported, like GNU Make. The given path will be where the build= set of
commands should produce the final unsigned release apk.
</p>
</dd>
<dt><code>novcheck=yes</code></dt>
<dd><p>Don’t check that the version name and code in the resulting apk are
correct by looking at the build output - assume the metadata is
correct. This takes away a useful level of sanity checking, and should
only be used if the values can’t be extracted.
</p>
</dd>
</dl>
<p>Another example, using extra parameters:
</p>
<p>‘<samp>Build Version:1.09.03,10903,45,subdir=Timeriffic,oldsdkloc=yes</samp>’
</p>
<hr>
<div class="header">
<p>
Next: <a href="AntiFeatures.html#AntiFeatures" accesskey="n" rel="next">AntiFeatures</a>, Previous: <a href="Repo.html#Repo" accesskey="p" rel="prev">Repo</a>, Up: <a href="Metadata.html#Metadata" accesskey="u" rel="up">Metadata</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html#Index" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|