Commit Graph

107 Commits

Author SHA1 Message Date
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
Daniel Martí 319e1faf3b Add zipsigner as a submodule 2014-05-20 18:22:24 +02:00
Daniel Martí 4d44f3fce8 Build support-v4 from source with gradle
v7-appcompat can be enabled/used in gradle by changing :support-v4 with
:support-appcompat-v7 in build.gradle and bumping minSdk from 5 to 7
2014-05-19 11:56:45 +02:00
Daniel Martí b3107eb6b2 Fix gradle support while keeping ant support
Most of this was done by pserwylo on his branch feature/gradle. The only thing
left is merging the fixes into nanohttpd.
2014-05-18 12:55:30 +02:00
Dominik Schürmann 732fb87944 Add libsuperuser as external git submodule and project dependency 2014-04-26 02:40:08 +02:00
Daniel Martí a6a133b885 Gradle: bump versions, cleanup 2014-03-22 13:10:46 +01:00
Daniel Martí 955c2f5f6c Bump build-tools to 19.0.2 2014-02-23 12:22:04 +01:00
Daniel Martí 93ea5ea9fb Try to get grade working again
Now it fails because it thinks that ":extern" is a subproject
2014-02-20 09:55:54 +01:00
Daniel Martí feec3b1c51 Make all the gradle libs use the same latest build-tools version
This makes it completely build from source properly on a standard setup
2014-02-15 12:31:15 +01:00
Daniel Martí 1e9c6ccf2e Finally give up on UIL and set up the gradle project ourselves 2014-02-14 12:17:07 +01:00
Daniel Martí fffae79c24 Add MemorizingTrustManager as gradle library too 2014-02-14 10:51:30 +01:00
Daniel Martí 967174b549 Finally get UIL working as a gradle library
The problem were the dashes in the path 'extern/Universal-Image-Loader'
2014-02-14 10:34:36 +01:00
Daniel Martí 97e3bac98e Bump gradle plugin to 0.8 (gradle 1.10) 2014-02-14 09:10:58 +01:00
Daniel Martí 6da00f84cb Fix proguard use in gradle 2014-02-10 09:30:08 +01:00
Daniel Martí 87c5ff56b8 Fix gradle test root 2014-02-09 16:34:36 +01:00
Daniel Martí 3ae9fd7b88 Try to support AndroidPinning via gradle (won't work as-is) 2014-01-10 22:37:26 +01:00
Daniel Martí dc5dd51462 Specify UTF-8 in build.gradle 2014-01-08 14:14:43 +01:00
Daniel Martí 7f09ff0c09 Bump gradle and build-tools versions 2013-12-22 14:15:17 +01:00
Daniel Martí 7dfe9eac24 Add basic gradle support 2013-11-27 15:47:13 +01:00