
The support libraries expect to be using the gradle plugin version 0.10.0. We are currently on version 1.0.0. They use APIs in their build script which have moved or been removed, and so the build just breaks when we run it with the 1.0.0 plugin. I tried some magic to make it work in various ways, but kept failing. As such, I've reverted the `gradle -PsourceDeps` build to not build the support libraries from source. In the future, we should be able to change this if they change the plugin version to a more recent one. Note that the ant build script still hasn't been modified, and so will be using the binary support-v4 library, but should build appcompat-v7 from source. Was going to bump to Support v21, however there is some behaviour change which causes a crash. They have removed the progress view from the toolbar/actionbar. This breaks the AppDetails activity. As such, I'll leave that for the future. For now, there will be a slight difference between building with ant (which uses support v-almost-21) and gradle (which uses v20). This will stay the case until we get around to completely porting the app to v21, and fixing any bugs or UI sadness that arises.
2.9 KiB
Licenses
To see which license any one of these libraries is under, consult the extern/ directory.
If you have checked out the source for all dependencies (git submodule update --init
from the root directory),
then you should be able to find the relevant LICENSE file for each, or else you can consult upstream.
Building libraries from source
As a matter of principle, and also to comply with the GPLv3+, F-Droid should always be able to be built from source, including all of its dependencies.
For practical reasons, developers often don't want the overhead of having to fetch the source of each dependency though. Also, they may not want their build script to have to take the time to configure and check that each subproject is up-to-date. Building from binary dependencies is much faster, requires less downloading of external source, and should import into Android Studio and other IDE's more easily.
To deal with these two goals (building dependencies from source, and relying on prebuilt binaries), the build script can be run in two modes.
Gradle commands
gradle build
will build F-Droid from source, but not the depenencies from source. It will instead depend
on binaries from jcenter where possible, and .jar and .aar files in F-Droid/libs/binaryDeps elsewhere.
gradle -PsourceDeps build
will include all dependencies and build the entire F-Droid binary
and all of its dependencies from source.
gradle -PsourceDeps binaryDeps
will build all dependencies from source, and then copy the ones which
are not found in jcenter to F-Droid/libs/binaryDeps, making sure that the latest versions of the libraries are available
for developers wishing to build F-Droid from binary dependencies.
gradle -PsourceDeps cleanBinaryDeps
will remove all binary dependencies. It shouldn't be neccesary,
because the binaryDeps
will copy fresh .jar and .aar files to the F-Droid/libs/binaryDeps directory when they change.
It may be handy if you are updating the build script though, as a nice way to empty the F-Droid/libs/binaryDeps directory.
Adding new dependencies
When adding a new dependency, DON'T copy the .jar or .aar file into F-Droid/libs/binaryDeps. This will get deleted
when somebody runs gradle -PsourceDeps cleanBinaryDeps
. Also, the version of F-Droid built for distribution
on https://f-droid.org will be build from source depednencies, so adding a binary is not enough.
Instead, you should add the source repo as a submodule in the extern/ diretory. You will also need to modify
the F-Droid/build.gradle file, adding both the source dependency on the project in the extern/ directory, and
a dependency on its jcenter/mavenCentral artifact. If that artifact is not available, then you should add
the library to those to be copied using gradler -PsourceDeps binaryDeps
. Then, you can commit that binary so that
anyone who clones the F-Droid repo will have all of the dependencies ready in either jcetner or the
F-Droid/libs/binaryDeps directory.