2014-12-10 10:53:37 +01:00
apply plugin: 'com.android.application'
2015-09-25 22:00:24 -07:00
apply plugin: 'witness'
2015-10-08 16:50:07 +02:00
apply plugin: 'checkstyle'
2016-03-01 17:30:48 +00:00
apply plugin: 'pmd'
2015-10-08 17:11:22 +02:00
2016-05-19 08:27:50 +02:00
/* gets the version name from the latest Git tag, stripping the leading v off */
def getVersionName = { - >
def stdout = new ByteArrayOutputStream ( )
exec {
commandLine 'git' , 'describe' , '--tags' , '--always'
standardOutput = stdout
}
2017-07-08 00:10:45 +02:00
return stdout . toString ( ) . trim ( )
2016-05-19 08:27:50 +02:00
}
2015-10-13 22:24:54 +02:00
dependencies {
2018-03-23 16:28:59 +01:00
compile "com.android.support:support-v4:25.3.1"
compile "com.android.support:appcompat-v7:25.3.1"
compile "com.android.support:gridlayout-v7:25.3.1"
compile "com.android.support:support-annotations:25.3.1"
compile "com.android.support:recyclerview-v7:25.3.1"
compile "com.android.support:cardview-v7:25.3.1"
compile "com.android.support:design:25.3.1"
compile "com.android.support:support-vector-drawable:25.3.1"
2017-04-17 17:28:50 +10:00
compile 'com.android.support.constraint:constraint-layout:1.0.2'
2018-03-23 16:28:59 +01:00
compile "com.android.support:palette-v7:25.3.1"
2015-10-13 22:24:54 +02:00
2015-12-13 19:40:20 +01:00
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
2018-02-09 10:41:30 +01:00
compile 'com.google.zxing:core:3.3.2'
2016-03-05 23:15:47 +00:00
compile 'eu.chainfire:libsuperuser:1.0.0.201602271131'
2016-04-13 13:31:53 +01:00
compile 'cc.mvdan.accesspoint:library:0.2.0'
2016-09-27 14:54:02 +02:00
compile 'info.guardianproject.netcipher:netcipher:2.0.0-alpha1'
2017-11-23 10:19:07 -02:00
compile "info.guardianproject.panic:panic:0.5"
2016-06-17 15:42:57 +01:00
compile 'commons-io:commons-io:2.5'
2016-06-17 15:44:48 +01:00
compile 'commons-net:commons-net:3.5'
2018-04-11 14:04:11 +02:00
compile 'org.jmdns:jmdns:3.5.3'
2017-03-22 08:49:12 +11:00
compile 'ch.acra:acra:4.9.1'
2016-01-26 16:16:01 +11:00
compile 'io.reactivex:rxjava:1.1.0'
compile 'io.reactivex:rxandroid:0.23.0'
2017-03-22 08:49:12 +11:00
compile 'com.hannesdorfmann:adapterdelegates3:3.0.1'
2017-03-21 15:50:12 +11:00
// Migrate this to upstream https://github.com/Ashok-Varma/BottomNavigation if PR #110 gets
// accepted to drop the minSdk to 10.
2018-03-23 16:28:59 +01:00
compile ( 'com.github.pserwylo:BottomNavigation:1.5.0' )
2016-03-23 16:18:53 +01:00
2017-03-22 21:38:33 +01:00
compile 'com.fasterxml.jackson.core:jackson-core:2.8.7'
compile 'com.fasterxml.jackson.core:jackson-annotations:2.8.7'
compile 'com.fasterxml.jackson.core:jackson-databind:2.8.7'
2016-03-25 12:25:25 +01:00
2018-03-23 16:23:35 +01:00
testCompile "org.robolectric:robolectric:3.3.2"
2017-03-22 21:38:33 +01:00
testCompile 'junit:junit:4.12'
2016-11-30 22:50:47 +11:00
// As per https://github.com/robolectric/robolectric/issues/1932#issuecomment-219796474
testCompile 'org.khronos:opengl-api:gl1.1-android-2.1_r1'
2016-06-06 08:02:53 +10:00
testCompile "org.mockito:mockito-core:1.10.19"
2018-03-23 16:28:59 +01:00
androidTestCompile "com.android.support:support-annotations:25.3.1"
2016-03-25 12:25:25 +01:00
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
2015-10-13 22:24:54 +02:00
}
2015-08-28 14:10:21 +02:00
if ( ! hasProperty ( 'sourceDeps' ) ) {
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:20:19 +11:00
dependencies {
2018-03-23 15:51:29 +01:00
compile 'com.madgag.spongycastle:pkix:1.54.0.0'
compile 'com.madgag.spongycastle:prov:1.54.0.0'
compile 'com.madgag.spongycastle:core:1.54.0.0'
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:20:19 +11:00
// Upstream doesn't have a binary on mavenCentral/jcenter yet:
// https://github.com/kolavar/android-support-v4-preferencefragment/issues/13
2018-04-19 12:15:37 +02:00
compile files ( 'libs/binaryDeps/support-v4-preferencefragment-release.aar' )
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:20:19 +11:00
// Fork for F-Droid, including support for https. Not merged into upstream
// yet (seems to be a little unsupported as of late), so not using mavenCentral/jcenter.
2018-04-19 12:15:37 +02:00
compile files ( 'libs/binaryDeps/nanohttpd-2.1.0.jar' )
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:20:19 +11:00
2015-09-08 21:08:27 +02:00
// Upstream doesn't have a binary on mavenCentral, and it is an SVN repo on
// Google Code. We include this code directly in this repo, and have made
// modifications that should be pushed to anyone who wants to maintain it.
2018-04-19 12:15:37 +02:00
compile files ( 'libs/binaryDeps/zipsigner.jar' )
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:20:19 +11:00
}
2015-10-08 19:22:15 +02:00
// Only do the libraries imported from maven repositories. Our own libraries
// (like privileged-api-lib) and the prebuilt jars already checked into the
// source code don't need to be here.
2016-08-25 23:23:38 +02:00
// generate using: `gradle -q calculateChecksums | sort -V`
2015-10-08 19:22:15 +02:00
dependencyVerification {
verify = [
2016-08-26 10:42:39 +02:00
'cc.mvdan.accesspoint:library:0837b38adb48b66bb1385adb6ade8ecce7002ad815c55abf13517c82193458ea' ,
2016-10-31 14:07:41 +00:00
'ch.acra:acra:d2762968c448757a7d6acc9f141881d9632f664988e9723ece33b5f7c79f3bc9' ,
2016-08-26 10:42:39 +02:00
'commons-io:commons-io:a10418348d234968600ccb1d988efcbbd08716e1d96936ccc1880e7d22513474' ,
'commons-net:commons-net:c25b0da668b3c5649f002d504def22d1b4cb30d206f05428d2fe168fa1a901c2' ,
2017-04-17 17:28:50 +10:00
'com.android.support.constraint:constraint-layout-solver:8c62525a9bc5cff5633a96cb9b32fffeccaf41b8841aa87fc22607070dea9b8d' ,
'com.android.support.constraint:constraint-layout:b0c688cc2b7172608f8153a689d746da40f71e52d7e2fe2bfd9df2f92db77085' ,
2018-03-23 16:28:59 +01:00
'com.android.support:animated-vector-drawable:4bc46edf1946b32d518b41416d1734e915e0cbb28021de3b340527419b070691' ,
'com.android.support:appcompat-v7:ac1ebbc46589195dda3e0b1becfe410bafd75bdf3edd1cd9acf04850f3895830' ,
'com.android.support:cardview-v7:defc17032ffa600a82e1c7d96bb574aa5ed64e2b57e28414a245da7d6db0c666' ,
'com.android.support:design:a3e83064fe99d0a4369f9b46d8bfbe77d0c3022fffdee4be3ac3857b87cc89e3' ,
'com.android.support:gridlayout-v7:de87a59472f19eb05429faf6b2683a09dd6995f5db562d3daf6033297c312388' ,
'com.android.support:palette-v7:956276da2ed8b6c087c431da807a496f4908061c9c64d4c9f7b42c626d633662' ,
'com.android.support:recyclerview-v7:375974a8724e359d97d77fa8522c614f813a3ac4583c1807f154a3f9a054b0a1' ,
'com.android.support:support-annotations:aedf76962584adfaed2bd3fcaa22406461c4310237fc27e301128edaa2dba2fa' ,
'com.android.support:support-compat:e02d781268dc60aab6638d8dc20156ea11ca20b962d294b85e6f1e8418cabfa7' ,
'com.android.support:support-core-ui:6182278a6653e6c111c888963626cbb16f2d0022571cb239760475119e0b92a8' ,
'com.android.support:support-core-utils:32fac02eb2c20a77fa3e3bc3ede62392a19613f72b8f8e10f5dfa84bb4c89ea1' ,
'com.android.support:support-fragment:541d6393c1e024453aca2a14f31bea0c7270ff4e2a02783f3528aa426367444d' ,
'com.android.support:support-media-compat:cbed07d07e0e84fdb4b75712f5fd946229a8af155933c9a92e41db64d00791e0' ,
'com.android.support:support-v4:07d389154bcf73b47e514964df1578136b26cba78257b8a577a3ccb54beff0ae' ,
'com.android.support:support-vector-drawable:13728f337f36d1c02d52198a6c20724edb447a0875454d829f95cb9eb4aa293b' ,
'com.android.support:transition:36c688825a8c0e6e879e18886de83dc90673322822d5b606ee302f70fb558e16' ,
2017-03-22 21:38:33 +01:00
'com.fasterxml.jackson.core:jackson-annotations:6b7802f6c22c09c4a92a2ebeb76e755c3c0a58dfbf419835fae470d89e469b86' ,
'com.fasterxml.jackson.core:jackson-core:256ff34118ab292d1b4f3ee4d2c3e5e5f0f609d8e07c57e8ad1f51c46d4fbb46' ,
'com.fasterxml.jackson.core:jackson-databind:4f74337b6d18664be0f5b15c6664b17aa3972c9c175092328b139b894ff66f19' ,
2017-03-21 15:50:12 +11:00
'com.github.pserwylo:BottomNavigation:83d7941a7a8d21ba1a8a708cd683b1bb07c6cf898044dc92eadf18a7a7d54f90' ,
2018-02-09 10:41:30 +01:00
'com.google.zxing:core:52dd6211bbaf4e600de693834d597e49707f3e6606e1f5d3740fbb8274466abe' ,
2017-03-11 08:38:02 +11:00
'com.hannesdorfmann:adapterdelegates3:1b20d099d6e7afe57aceca13b713b386959d94a247c3c06a7aeb65b866ece02f' ,
2018-03-23 15:51:29 +01:00
'com.madgag.spongycastle:core:1e7fa4b19ccccd1011364ab838d0b4702470c178bbbdd94c5c90b2d4d749ea1e' ,
'com.madgag.spongycastle:pkix:721a302f5ce18bf6fff89d514ef224c37b5dd9ca67a16b56fafaea4b24a51482' ,
'com.madgag.spongycastle:prov:cf89c550fda86c0f26858c3d851ac1d2ce49cd78dd144cd86f307b7ea3e6afd7' ,
2016-08-26 10:42:39 +02:00
'com.nostra13.universalimageloader:universal-image-loader:dbd5197ffec3a8317533190870a7c00ff3750dd6a31241448c6a5522d51b65b4' ,
'eu.chainfire:libsuperuser:018344ff19ee94d252c14b4a503ee8b519184db473a5af83513f5837c413b128' ,
2016-09-27 14:54:02 +02:00
'info.guardianproject.netcipher:netcipher:eeeb5d0d95ccfe176b4296cbd71a9a24c6efb0bab5c4025a8c6bc36abdddfc75' ,
2017-11-23 10:19:07 -02:00
'info.guardianproject.panic:panic:a7ed9439826db2e9901649892cf9afbe76f00991b768d8f4c26332d7c9406cb2' ,
2016-08-26 10:42:39 +02:00
'io.reactivex:rxandroid:35c1a90f8c1f499db3c1f3d608e1f191ac8afddb10c02dd91ef04c03a0a4bcda' ,
'io.reactivex:rxjava:2c162afd78eba217cdfee78b60e85d3bfb667db61e12bc95e3cf2ddc5beeadf6' ,
2018-04-11 14:04:11 +02:00
'org.jmdns:jmdns:24e7e3a50a579136400e8c9b0750399eb3c7558918bdf52c0ffa5e0fa5aad503' ,
'org.slf4j:slf4j-api:e56288031f5e60652c06e7bb6e9fa410a61231ab54890f7b708fc6adc4107c5b' ,
2015-10-08 19:22:15 +02:00
]
}
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:20:19 +11:00
} else {
logger . info "Setting up *source* dependencies for F-Droid (because you passed in the -PsourceDeps argument to gradle while building)."
dependencies {
2015-08-28 14:10:21 +02:00
compile ( project ( ':extern:support-v4-preferencefragment' ) ) {
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:20:19 +11:00
exclude module: 'support-v4'
}
2015-09-08 14:59:30 -07:00
compile project ( ':extern:nanohttpd:core' )
compile project ( ':extern:zipsigner' )
2014-11-15 22:14:14 +01:00
}
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:20:19 +11:00
2016-03-29 17:57:21 +01:00
task binaryDeps ( type: Copy , dependsOn: ':app:prepareReleaseDependencies' ) {
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:20:19 +11:00
2015-10-13 22:24:54 +02:00
enabled = project . hasProperty ( 'sourceDeps' )
2016-03-29 17:57:21 +01:00
description = "Copies .jar and .aar files from subproject dependencies in extern/ to app/libs. Requires the sourceDeps property to be set (\"gradle -PsourceDeps binaryDeps\")"
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:20:19 +11:00
2015-10-13 22:24:54 +02:00
from ( '../extern/' ) {
include 'support-v4-preferencefragment/build/outputs/aar/support-v4-preferencefragment-release.aar'
include 'nanohttpd/core/build/libs/nanohttpd-2.1.0.jar'
include 'zipsigner/build/libs/zipsigner.jar'
}
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:20:19 +11:00
2015-10-13 22:24:54 +02:00
into 'libs/binaryDeps'
includeEmptyDirs false
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:20:19 +11:00
2015-10-13 22:24:54 +02:00
eachFile { FileCopyDetails details - >
// Don't copy to a sub folder such as libs/binaryDeps/Project/build/outputs/aar/project.aar, but
// rather libs/binaryDeps/project.aar.
details . path = details . name
}
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:20:19 +11:00
}
2014-11-15 22:14:14 +01:00
}
2015-10-08 17:11:22 +02:00
2017-10-25 22:15:40 +02:00
def isCi = "true" . equals ( System . getenv ( "CI" ) )
def preDexEnabled = "true" . equals ( System . getProperty ( "pre-dex" , "true" ) )
2014-11-15 22:14:14 +01:00
android {
2016-07-10 01:00:04 +01:00
compileSdkVersion 24
2018-03-29 20:47:38 +02:00
buildToolsVersion '25.0.3'
2014-11-15 22:14:14 +01:00
buildTypes {
2015-11-14 14:05:15 +01:00
// use proguard on debug too since we have unknowingly broken
// release builds before.
2015-08-09 19:09:02 -07:00
all {
2015-08-15 13:18:40 -07:00
minifyEnabled true
2016-04-13 13:25:53 +01:00
useProguard true
2015-08-15 13:18:40 -07:00
shrinkResources true
proguardFiles getDefaultProguardFile ( 'proguard-android.txt' ) , 'proguard-rules.pro'
2016-04-04 11:59:35 +02:00
testProguardFiles getDefaultProguardFile ( 'proguard-android.txt' ) , 'proguard-rules.pro' , 'src/androidTest/proguard-rules.pro'
2014-11-15 22:14:14 +01:00
}
}
2015-05-20 18:37:05 +02:00
compileOptions {
compileOptions . encoding = "UTF-8"
// Use Java 1.7, requires minSdk 8
sourceCompatibility JavaVersion . VERSION_1_7
targetCompatibility JavaVersion . VERSION_1_7
}
2017-09-02 23:01:09 +02:00
aaptOptions {
cruncherEnabled = false
}
2017-10-25 22:15:40 +02:00
dexOptions {
// Improve build server performance by allowing disabling of pre-dexing
// see http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance
// Skip pre-dexing when running on CI or when disabled via -Dpre-dex=false.
preDexLibraries = preDexEnabled & & ! isCi
}
2016-03-25 12:25:25 +01:00
defaultConfig {
2018-04-18 20:21:23 +02:00
versionCode 1002051
2016-05-19 08:27:50 +02:00
versionName getVersionName ( )
2017-11-22 13:21:06 -02:00
applicationId 'org.fdroid.fdroid'
resValue "string" , "applicationId" , applicationId
2016-03-25 12:25:25 +01:00
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
2017-11-09 22:54:29 +01:00
buildTypes {
debug {
applicationIdSuffix ".debug"
resValue "string" , "applicationId" , defaultConfig . applicationId + applicationIdSuffix
versionNameSuffix "-debug"
}
}
2017-11-09 22:56:14 +01:00
/* set the debug versionCode based on DB verson and how many commits in the repo */
applicationVariants . all { variant - >
if ( variant . buildType . isDebuggable ( ) ) {
// default to a timestamp, in case anything fails later
variant . mergedFlavor . versionCode = new Date ( ) . getTime ( ) / 1000
try {
def stdout = new ByteArrayOutputStream ( )
exec {
commandLine 'git' , 'rev-list' , '--first-parent' , '--count' , 'HEAD'
standardOutput = stdout
}
def commitCount = Integer . parseInt ( stdout . toString ( ) . trim ( ) )
stdout = new ByteArrayOutputStream ( )
exec {
commandLine 'sed' , '-n' , 's,.*DB_VERSION *= *\\([0-9][0-9]*\\).*,\\1,p' , 'src/main/java/org/fdroid/fdroid/data/DBHelper.java'
standardOutput = stdout
}
def dbVersion = Integer . parseInt ( stdout . toString ( ) . trim ( ) )
println 'Setting debug versionCode: ' + sprintf ( "%d%05d" , [ dbVersion , commitCount ] )
variant . mergedFlavor . versionCode = Integer . parseInt ( sprintf ( "%d%05d" , [ dbVersion , commitCount ] ) )
}
catch ( ignored ) {
}
}
}
2016-03-22 16:08:17 +01:00
testOptions {
2016-05-10 14:34:15 +02:00
unitTests {
// prevent tests from dying on android.util.Log calls
returnDefaultValues = true
all {
// All the usual Gradle options.
testLogging {
events "skipped" , "failed" , "standardOut" , "standardError"
showStandardStreams = true
}
}
}
2016-03-22 16:08:17 +01:00
}
2016-10-07 12:15:15 +02:00
sourceSets {
test {
java . srcDirs + = "$projectDir/src/testShared/java"
}
androidTest {
java . srcDirs + = "$projectDir/src/testShared/java"
}
}
2015-05-20 18:37:05 +02:00
lintOptions {
checkReleaseBuilds false
2016-06-17 09:10:35 +02:00
abortOnError true
2015-07-28 21:39:33 -07:00
2015-08-09 21:33:36 -07:00
htmlReport true
xmlReport false
textReport false
2017-05-10 13:45:50 +02:00
lintConfig file ( "lint.xml" )
2015-05-20 18:37:05 +02:00
}
2015-11-01 14:25:58 +01:00
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/INDEX.LIST'
exclude '.readme'
}
2014-11-15 22:14:14 +01:00
}
2015-10-08 17:11:22 +02:00
2015-11-30 10:35:19 +01:00
checkstyle {
2016-10-31 14:19:30 +00:00
toolVersion = '7.2'
2015-11-30 10:35:19 +01:00
}
2015-10-08 16:50:07 +02:00
task checkstyle ( type: Checkstyle ) {
configFile file ( "${project.rootDir}/config/checkstyle/checkstyle.xml" )
2016-03-31 12:21:57 +01:00
source 'src/main/java' , 'src/test/java' , 'src/androidTest/java'
2015-10-08 16:50:07 +02:00
include '**/*.java'
classpath = files ( )
}
2015-10-08 17:11:22 +02:00
2016-03-01 17:30:48 +00:00
pmd {
2016-07-31 16:41:25 +02:00
toolVersion = '5.5.1'
2016-03-01 17:30:48 +00:00
consoleOutput = true
}
2016-09-28 21:58:27 +01:00
task pmdMain ( type: Pmd ) {
dependsOn 'assembleDebug'
2016-06-09 09:55:12 +10:00
ruleSetFiles = files ( "${project.rootDir}/config/pmd/rules.xml" , "${project.rootDir}/config/pmd/rules-main.xml" )
2016-04-23 15:59:04 +01:00
ruleSets = [ ] // otherwise defaults clash with the list in rules.xml
2016-06-09 09:55:12 +10:00
source 'src/main/java'
include '**/*.java'
}
2016-09-28 21:58:27 +01:00
task pmdTest ( type: Pmd ) {
dependsOn 'assembleDebug'
2016-06-09 09:55:12 +10:00
ruleSetFiles = files ( "${project.rootDir}/config/pmd/rules.xml" , "${project.rootDir}/config/pmd/rules-test.xml" )
ruleSets = [ ] // otherwise defaults clash with the list in rules.xml
source 'src/test/java' , 'src/androidTest/java'
2016-04-13 13:18:20 +01:00
include '**/*.java'
2016-03-01 17:30:48 +00:00
}
2016-06-09 09:55:12 +10:00
task pmd ( dependsOn: [ pmdMain , pmdTest ] ) { }
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:20:19 +11:00
// This person took the example code below from another blogpost online, however
2014-11-15 22:14:14 +01:00
// I lost the reference to it:
// http://stackoverflow.com/questions/23297562/gradle-javadoc-and-android-documentation
android . applicationVariants . all { variant - >
task ( "generate${variant.name}Javadoc" , type: Javadoc ) {
title = "$name $version API"
description "Generates Javadoc for F-Droid."
source = variant . javaCompile . source
2015-03-30 16:49:56 +02:00
def sdkDir
Properties properties = new Properties ( )
File localProps = project . rootProject . file ( 'local.properties' )
if ( localProps . exists ( ) ) {
properties . load ( localProps . newDataInputStream ( ) )
sdkDir = properties . getProperty ( 'sdk.dir' )
} else {
sdkDir = System . getenv ( 'ANDROID_HOME' )
}
if ( ! sdkDir ) {
throw new ProjectConfigurationException ( "Cannot find android sdk. Make sure sdk.dir is defined in local.properties or the environment variable ANDROID_HOME is set." , null )
}
ext . androidJar = "${sdkDir}/platforms/${android.compileSdkVersion}/android.jar"
2014-11-15 22:14:14 +01:00
classpath = files ( variant . javaCompile . classpath . files ) + files ( ext . androidJar )
options . links ( "http://docs.oracle.com/javase/7/docs/api/" ) ;
options . links ( "http://d.android.com/reference/" ) ;
exclude '**/BuildConfig.java'
exclude '**/R.java'
}
2018-02-13 20:19:45 +01:00
}