BobStore/app/build.gradle

256 lines
9.7 KiB
Groovy
Raw Normal View History

apply plugin: 'com.android.application'
2015-09-25 22:00:24 -07:00
apply plugin: 'witness'
apply plugin: 'checkstyle'
apply plugin: 'pmd'
2015-10-13 22:24:54 +02:00
repositories {
jcenter()
}
dependencies {
compile project(':privileged-api-lib')
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-annotations:23.3.0'
2015-10-13 22:24:54 +02:00
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
2015-10-13 22:24:54 +02:00
compile 'com.google.zxing:core:3.2.1'
compile 'eu.chainfire:libsuperuser:1.0.0.201602271131'
compile 'cc.mvdan.accesspoint:library:0.2.0'
compile 'info.guardianproject.netcipher:netcipher:1.2.1'
compile 'commons-io:commons-io:2.4'
compile 'commons-net:commons-net:3.4'
2015-10-13 22:24:54 +02:00
compile 'org.openhab.jmdns:jmdns:3.4.2'
compile('ch.acra:acra:4.8.5') {
exclude module: 'support-v4'
2016-02-22 18:36:57 +01:00
exclude module: 'support-annotations'
}
compile 'io.reactivex:rxjava:1.1.0'
compile 'io.reactivex:rxandroid:0.23.0'
2016-03-23 16:18:53 +01:00
testCompile 'junit:junit:4.12'
androidTestCompile 'com.android.support:support-annotations:23.3.0'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
2015-10-13 22:24:54 +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
repositories {
// This is here until we sort out all dependencies from mavenCentral/jcenter. Once all of
// the dependencies below have been sorted out, this can be removed.
flatDir {
dirs 'libs/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
}
}
dependencies {
compile 'com.madgag.spongycastle:pkix:1.53.0.0'
compile 'com.madgag.spongycastle:prov:1.53.0.0'
compile 'com.madgag.spongycastle:core:1.53.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
compile(name: 'support-v4-preferencefragment-release', ext: '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.
compile(name: 'nanohttpd-2.1.0')
swap: close resources reported by StrictMode This required rebuilding the zipsigner.jar, since there was once issue to be fixed in kellingwood.security.zipsigner.ZipSigner. Here are the stacktraces: StrictMode E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. E java.lang.Throwable: Explicit termination method 'close' not called E at dalvik.system.CloseGuard.open(CloseGuard.java:184) E at java.io.FileOutputStream.<init>(FileOutputStream.java:90) E at java.io.FileOutputStream.<init>(FileOutputStream.java:73) E at java.io.FileWriter.<init>(FileWriter.java:42) E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:488) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645) E at android.os.AsyncTask$2.call(AsyncTask.java:288) E at java.util.concurrent.FutureTask.run(FutureTask.java:237) E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E at java.lang.Thread.run(Thread.java:841) E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. E java.lang.Throwable: Explicit termination method 'close' not called E at dalvik.system.CloseGuard.open(CloseGuard.java:184) E at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128) E at kellinwood.zipio.ZipInput.<init>(ZipInput.java:57) E at kellinwood.zipio.ZipInput.read(ZipInput.java:75) E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:646) E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218) E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645) E at android.os.AsyncTask$2.call(AsyncTask.java:288) E at java.util.concurrent.FutureTask.run(FutureTask.java:237) E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E at java.lang.Thread.run(Thread.java:841) E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. E java.lang.Throwable: Explicit termination method 'end' not called E at dalvik.system.CloseGuard.open(CloseGuard.java:184) E at java.util.zip.Inflater.<init>(Inflater.java:82) E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:475) E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:445) E at kellinwood.security.zipsigner.ZipSigner.addDigestsToManifest(ZipSigner.java:418) E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:713) E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:647) E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218) E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645) E at android.os.AsyncTask$2.call(AsyncTask.java:288) E at java.util.concurrent.FutureTask.run(FutureTask.java:237) E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E at java.lang.Thread.run(Thread.java:841) StrictMode E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. E java.lang.Throwable: Explicit termination method 'close' not called E at dalvik.system.CloseGuard.open(CloseGuard.java:184) E at java.io.FileOutputStream.<init>(FileOutputStream.java:90) E at java.io.FileOutputStream.<init>(FileOutputStream.java:73) E at java.io.FileWriter.<init>(FileWriter.java:42) E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:488) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645) E at android.os.AsyncTask$2.call(AsyncTask.java:288) E at java.util.concurrent.FutureTask.run(FutureTask.java:237) E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E at java.lang.Thread.run(Thread.java:841) E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. E java.lang.Throwable: Explicit termination method 'close' not called E at dalvik.system.CloseGuard.open(CloseGuard.java:184) E at java.io.RandomAccessFile.<init>(RandomAccessFile.java:128) E at kellinwood.zipio.ZipInput.<init>(ZipInput.java:57) E at kellinwood.zipio.ZipInput.read(ZipInput.java:75) E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:646) E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218) E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645) E at android.os.AsyncTask$2.call(AsyncTask.java:288) E at java.util.concurrent.FutureTask.run(FutureTask.java:237) E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E at java.lang.Thread.run(Thread.java:841) E A resource was acquired at attached stack trace but never released. See java.io.Closeable for information on avoiding resource leaks. E java.lang.Throwable: Explicit termination method 'end' not called E at dalvik.system.CloseGuard.open(CloseGuard.java:184) E at java.util.zip.Inflater.<init>(Inflater.java:82) E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:475) E at kellinwood.zipio.ZioEntry.getInputStream(ZioEntry.java:445) E at kellinwood.security.zipsigner.ZipSigner.addDigestsToManifest(ZipSigner.java:418) E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:713) E at kellinwood.security.zipsigner.ZipSigner.signZip(ZipSigner.java:647) E at org.fdroid.fdroid.localrepo.LocalRepoKeyStore.signZip(LocalRepoKeyStore.java:218) E at org.fdroid.fdroid.localrepo.LocalRepoManager.writeIndexJar(LocalRepoManager.java:515) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:698) E at org.fdroid.fdroid.views.swap.SwapWorkflowActivity$PrepareSwapRepo.doInBackground(SwapWorkflowActivity.java:645) E at android.os.AsyncTask$2.call(AsyncTask.java:288) E at java.util.concurrent.FutureTask.run(FutureTask.java:237) E at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) E at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) E at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) E at java.lang.Thread.run(Thread.java:841)
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.
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
compile(name: 'zipsigner')
}
// 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.
dependencyVerification {
verify = [
'com.android.support:support-v4:1e8b7cc1cb3d6f6a2fd913791a6313df6bbaa470be450384474e906bc234bd49',
'com.android.support:appcompat-v7:dce81c41f76d83fa315617f4bc8ef2f84c5aa54b686f37b559422b939f622490',
'com.android.support:support-annotations:e9e076f3ea4fb144387c6054a6f69a2f6150ad4b1907897aaf55d6e8f4b8b91e',
'com.nostra13.universalimageloader:universal-image-loader:dbd5197ffec3a8317533190870a7c00ff3750dd6a31241448c6a5522d51b65b4',
'com.google.zxing:core:b4d82452e7a6bf6ec2698904b332431717ed8f9a850224f295aec89de80f2259',
'eu.chainfire:libsuperuser:018344ff19ee94d252c14b4a503ee8b519184db473a5af83513f5837c413b128',
'cc.mvdan.accesspoint:library:0837b38adb48b66bb1385adb6ade8ecce7002ad815c55abf13517c82193458ea',
'commons-io:commons-io:cc6a41dc3eaacc9e440a6bd0d2890b20d36b4ee408fe2d67122f328bb6e01581',
'commons-net:commons-net:38cf2eca826b8bcdb236fc1f2e79e0c6dd8e7e0f5c44a3b8e839a1065b2fbe2e',
'info.guardianproject.netcipher:netcipher:611ec5bde9d799fd57e1efec5c375f9f460de2cdda98918541decc9a7d02f2ad',
'org.openhab.jmdns:jmdns:7a4b34b5606bbd2aff7fdfe629edcb0416fccd367fb59a099f210b9aba4f0bce',
'com.madgag.spongycastle:pkix:6aba9b2210907a3d46dd3dcac782bb3424185290468d102d5207ebdc9796a905',
'com.madgag.spongycastle:prov:029f26cd6b67c06ffa05702d426d472c141789001bcb15b7262ed86c868e5643',
'com.madgag.spongycastle:core:9b6b7ac856b91bcda2ede694eccd26cefb0bf0b09b89f13cda05b5da5ff68c6b',
'ch.acra:acra:afd5b28934d5166b55f261c85685ad59e8a4ebe9ca1960906afaa8c76d8dc9eb',
'io.reactivex:rxjava:2c162afd78eba217cdfee78b60e85d3bfb667db61e12bc95e3cf2ddc5beeadf6',
'io.reactivex:rxandroid:35c1a90f8c1f499db3c1f3d608e1f191ac8afddb10c02dd91ef04c03a0a4bcda',
]
}
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 {
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'
}
compile project(':extern:nanohttpd:core')
compile project(':extern:zipsigner')
}
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
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')
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
}
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
useLibrary 'org.apache.http.legacy'
buildTypes {
// use proguard on debug too since we have unknowingly broken
// release builds before.
all {
minifyEnabled true
useProguard true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
testProguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro', 'src/androidTest/proguard-rules.pro'
}
2016-02-29 17:06:50 +00:00
debug {
testCoverageEnabled = true
}
}
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
}
defaultConfig {
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
testOptions {
// prevent tests from dying on android.util.Log calls
unitTests.returnDefaultValues = true
}
2015-05-20 18:37:05 +02:00
lintOptions {
checkReleaseBuilds false
abortOnError false
2015-08-09 21:33:36 -07:00
htmlReport true
xmlReport false
textReport false
// Our translations are crowd-sourced
disable 'MissingTranslation'
2015-11-01 20:09:31 +01:00
2015-10-11 01:42:35 +02:00
// We have locale folders like "values-he" and "values-id" as symlinks
// since some devices ship deprecated locale codes
disable 'LocaleFolder'
2015-11-01 20:09:31 +01:00
// Like supportsRtl or parentActivityName. They are on purpose.
disable 'UnusedAttribute'
2015-05-20 18:37:05 +02: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'
}
}
checkstyle {
toolVersion = '6.17'
}
task checkstyle(type: Checkstyle) {
configFile file("${project.rootDir}/config/checkstyle/checkstyle.xml")
source 'src/main/java', 'src/test/java', 'src/androidTest/java'
include '**/*.java'
classpath = files()
}
pmd {
toolVersion = '5.4.1'
consoleOutput = true
}
task pmd(type: Pmd, dependsOn: assembleDebug) {
ruleSets = [
//'java-basic',
2016-04-17 11:39:00 +01:00
'java-unusedcode',
2016-03-01 17:31:41 +00:00
'java-android',
'java-clone',
'java-finalizers',
'java-imports',
'java-migrating',
//'java-unnecessary', // too nitpicky with parenthesis
]
source 'src/main/java', 'src/test/java', 'src/androidTest/java'
include '**/*.java'
}
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
// 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
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"
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'
}
}