68 Commits

Author SHA1 Message Date
Daniel Martí
6d579368af Start using gradle-witness
Fixes #429.
2015-09-25 22:00:24 -07:00
Daniel Martí
4f40160c40 A root build.gradle file is now common 2015-08-20 10:35:10 -07:00
Daniel Martí
ad8896b2e8 Bump gradle plugin version to 1.3.1 2015-08-13 11:23:28 -07:00
Daniel Martí
50ac03e97d Bump gradle plugin to 1.3.0 2015-07-31 17:13:42 -07:00
Daniel Martí
340cba3ebe Bump gradle plugin version 2015-07-25 21:01:39 -07:00
Daniel Martí
49b954e63d Bump gradle plugin to 1.2.2 2015-04-29 22:16:14 +02:00
Daniel Martí
d9590743d9 Get rid of root build.gradle hacks again
Now that we controll all lib build.gradle files, we can finally do it.

If we want to build support-v7 from source again with gradle, we'll import the
build.gradle and "fix" it like the rest.
2015-04-01 11:59:31 +02:00
Daniel Martí
48c3e1f747 Revert "Remove now unneeded hacks from root build.gradle"
This reverts commit c4f416396a3aa35fa81ccfb0415d9e01135ae8a8.
2015-03-31 21:25:02 +02:00
Daniel Martí
c4f416396a Remove now unneeded hacks from root build.gradle 2015-03-31 20:47:19 +02:00
Daniel Martí
3784e58fc4 Add gradle support to UniversalImageLoader 2015-03-31 20:19:04 +02:00
Daniel Martí
6deac28a8b libsuperuser: remove maven and bintray stuff 2015-03-31 19:38:25 +02:00
Daniel Martí
de3c224b02 Move zipsigner deps into its own build.gradle 2015-03-31 19:14:26 +02:00
Daniel Martí
76396f224f Bump gradle plugin to 1.1.3
We also no longer depend on the undocumented internal variable sdkFolder
2015-03-30 16:49:56 +02:00
Daniel Martí
ebacde9631 Bump build-tools to 22.0.1 2015-03-30 16:38:11 +02:00
Daniel Martí
bd6e2a3046 Bump gradle plugin to 1.0.1
I tried 1.1.3, but it failed. Needs further investigation.
2015-03-11 23:32:05 +01:00
Daniel Martí
6eff521459 Bump build-tools to 22.0.0 2015-03-11 23:09:42 +01:00
Peter Serwylo
aa38418c91 Bump support libraries to v20. Gradle doesn't build them by source for now.
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.
2015-03-03 00:46:43 +11:00
Peter Serwylo
eec57945c0 Default to binary dependencies, with option for source builds.
NOTE: This commit does not touch the ant build system at all,
only gradle.

There are currently 23 gradle projects which require configuration,
let alone building, in order to build F-Droid. This takes a non-trivial
amount of time/memory/cpu. Additionally, it also provides difficulties
when importing the project into Android Studio - which is the IDE that
many potential contributors will be using. Finally, I have over 100mb
of data in the extern/ folder, and the support libraries require almost
every single Android SDK to be installed, which is several GB. This is
not a friendly environment to encourage people to submit merge requests.

However, I'm very mindful of the need for an open source project such
as F-Droid to be able to be built from source. So to make sure we have
the best of both worlds, I've ensured that building all dependencies
from source is still possible.

The F-Droid/libs/README.md file explains in greater detail how to
do this (i.e. "gradle -PsourceDeps build").

As much as possible, I've tried to make the binary dependencies fetched
from jcenter. However there are still libraries which either haven't
integrated required changes for F-Droid back upstream, or don't have
mavenCentral/jcenter binaries available.

Android preference fragment has been changed to the original
upstream repository. The one we had before was because upstream
hadn't merged a MR for gradfle support yet. However, that has
now been merged. This version still doesn't exist in jcenter though.

In order for libsuperuser to build from upstream, using
`gradle -PsourceDeps`, we need to include a few gradle plugins
from jcenter which are never actually used (used by upstream to
release to jcenter).

Even though support-v4 is included through jcenter, it is kept in
the libs directory, so that ./ant-prepare.sh can use it.

Update support preference fragment to newer version. There has been
bugfixes commited, so lets include them in the version we are using.
2015-03-01 10:21:51 +11:00
Dominik Schürmann
bfc35691b6 Fix gradle build: dont abort on lint errors 2015-01-21 10:03:45 +01:00
Daniel Martí
27525122b8 Update to plugin version 1.0.0 2015-01-04 00:32:30 +01:00
Daniel Martí
5af7cac4b7 Remove all trailing whitespaces in source files 2014-12-30 23:48:36 +01:00
Peter Serwylo
d39ca46953 Clean up build scripts to make it harder to fail.
* Don't apply android plugin in root project

This results in the root project being treated like and Android project.
That is, gradle will expect an AndroidManifest, a targetSdk property, and
all sorts of stuff that is not relevant to the root project.

Perhaps more importantly, this breaks integration with Android Studio,
which is the tool that many potential contributors will be using.

Finally, it also allows runing gradle tasks in the root project, rather
than having to cd into the F-Droid directory, which is a minor nicety.

The reason it was there in the first place was to make it so that we could
find the location of the Android SDK using the same mechanism that the
plugin used. To deal with this, this commit adapts the SDK finding code
from the gradle plugin.

 * Make gradle error out when missing depenencies.

The support v4 library requires some obsolte SDKs that are likely
not installed. It caused non-intuitive errors to come up for me,
so I've made gradle tell the user when this occurs.

 * Documented the main build.gradle file

This is primarily to explain the hacks we use in order to build the
Android support libraries.
2014-12-29 01:38:51 +11:00
Peter Serwylo
405a31a415 Added support annotation library dependency.
The specific reason for this is that it provides @Null and @NotNull
annotations which should increase the safety of our code. Many of the
bugs which get filed are due to NullPointerExceptions, which could be
avoided by tooling using these annotations. The goal is to statically
catch this specific class of errors in as many situations as possible,
rather than waiting for them to occur at runtime.
2014-12-27 11:10:43 +11:00
Daniel Martí
7d1bfd9ae0 Bump toolVersion 2014-12-14 15:52:54 +01:00
Daniel Martí
e085bcd54c Use the newer plugin form 'com.android.application' 2014-12-10 10:53:37 +01:00
Daniel Martí
06dd4c8dcb Move F-Droid project into subdir, keeping a root gradle project
Also improved .gitignore a tad
2014-12-09 15:36:07 +01:00
Daniel Martí
9b108e36d8 Bump build.gradle tools and plugin versions 2014-11-14 12:10:56 +01:00
Daniel Martí
216ec24680 Bump target sdk to 21 2014-11-05 21:44:36 +01:00
Daniel Martí
a845f66099 Don't abort on lint errors 2014-11-05 21:36:35 +01:00
Daniel Martí
c6811d83b2 Bump gradle plugin version to 0.14.1, upgrade properties 2014-11-05 21:31:25 +01:00
Daniel Martí
e6bce05bd2 Bump toolVersion 2014-11-05 21:16:16 +01:00
Daniel Martí
acd61b7a68 Completely disable proguard 2014-10-03 22:31:01 +02:00
Daniel Martí
59f21c8561 Fix gradle build by bumping plugin version
Also add tools:replace since it's now needed as part of the manifest merger
2014-09-08 08:39:07 +02:00
Daniel Martí
9959becc09 Run proguard on debug builds to avoid future debug vs release issues 2014-09-08 08:25:47 +02:00
Daniel Martí
eb841a88ca Update build-tools version 2014-07-02 14:04:05 +02:00
Daniel Martí
2f9c3b8056 Switch to java 1.7
Taken from the gradle plugin user guide:

With Android KitKat (buildToolsVersion 19) you can use the diamond operator,
multi-catch, strings in switches, try with resources, etc.

Note that you can use minSdkVersion with a value earlier than 19, for all
language features except try with resources. If you want to use try with
resources, you will need to also use a minSdkVersion of 19.

You also need to make sure that Gradle is using version 1.7 or later of the
JDK. (And version 0.6.1 or later of the Android Gradle plugin.)
2014-06-05 10:32:57 +02:00
Daniel Martí
5dac28f882 Make it explicit that we're using 1.6
Can be bumped to 1.7 if minsdk is bumped to 8
2014-06-05 10:23:55 +02:00
Daniel Martí
67b608e4e5 Set the gradle project name to F-Droid like ant 2014-06-05 10:20:06 +02:00
Hans-Christoph Steiner
81cbef82b4 finish ant/gradle build for appcompat-v7
Both preferencefragment and appcompat-v7 submodules need the
android-support-v4.jar to be included in their respective libs/ dirs in
order for ant to build those projects.
2014-06-04 23:19:54 -04:00
Peter Serwylo
659b46fd4e Fix to sdkLoc in build. Added light (without dark action bar) theme.
NOTE: I don't know how android will go with adding a new property
to a string-array resource, but not having it translated everywhere.
Will it struggle because the EN version has three values for "theme",
but other translations only have two?
2014-06-04 23:19:54 -04:00
Peter Serwylo
59b9fd6a8c add PreferenceFragment lib since appcompat lacks such a thing
Although Google is encouraging people to make old devices run apps
with the action bar (via appcompat-v7), they haven't provided a way
for people to create preference/setting screens with an action bar.

There are plenty of issues in the Android issue tracker relating
to this, but it doesn't yet seem to be on the radar of the Android
devs.

Until there is a native implementation of PreferenceFragment in
the appcompat-v7 support library, this submodule provides is a 3rd
party solution. It is actually a fork of the first repo in github,
though that was a bit of an upload and dump, without accepting MR's.
This fork includes gradle support.
2014-06-04 23:16:26 -04:00
Peter Serwylo
58ff02a3f4 Build with dependency on support-appcompat-v7.
Thanks to the awesome work of mvdan, this was mostly ready to roll.
However, I had to wrestle for a while for two reasons:

 1) I forgot to add the dependency in the build.gradle file (it was
    already present in settings.gradle)
 2) My IDE was unable to read the ANDROID_HOME env variable, and
    despite my internet-search-fu, I couldn't figure out how to
    make IntelliJ specify env variables for a gradle build. It took
    a while to figure out, because it was failing silently in weird
    ways.

After slaving away on a nice method to parse both the ANDROID_HOME
and the local.properties file (looking for sdk.dir), and then emmiting
nice error messages if neither were found or pointed to an invalid
location, I discovered it had already be done:

android.plugin.sdkDirectory ends up here:

https://android.googlesource.com/platform/tools/build/+/master/gradle/src/main/groovy/com/android/build/gradle/internal/Sdk.groovy#161

Which does exactly all that and more. So now sdkLoc is initialized to
the value of android.plugin.sdkDirectory.
2014-06-03 08:11:59 +09:30
Daniel Martí
a085515b3d Add the rest of the srcDirs to UIL 2014-05-28 09:07:15 +02:00
Daniel Martí
9ea7959dc1 Fix typo in UIL config 2014-05-27 23:14:01 +02:00
Daniel Martí
414c4e0c67 Use zxing-core from source in both ant and gradle
Also, temporarily remove zipsigner from ant until spongycastle is added to it
so that ant builds work
2014-05-25 13:39:56 +02:00
Daniel Martí
8b0f45f878 Fix gradle build by compiling spongycastle as a zipsigner dependency 2014-05-23 11:06:32 +02:00
Daniel Martí
f841a179d1 spongycastle pgp is not used by kerplapp 2014-05-21 11:43:07 +02:00
Daniel Martí
cbc28ea53a Bump gradle to 1.12 (plugin 0.10)
Also, android.plugin.sdkDirectory is gone, so use sdkLoc
2014-05-21 11:42:46 +02:00
Daniel Martí
8c75c3694b Forgot to re-add jmdns as a dep 2014-05-21 08:48:13 +02:00
Daniel Martí
29048a0c60 Include spongycastle 2014-05-20 19:12:29 +02:00