BobStore/F-Droid/build.gradle

208 lines
7.1 KiB
Groovy
Raw Normal View History

apply plugin: 'com.android.application'
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
if ( !hasProperty( 'sourceDeps' ) ) {
logger.info "Setting up *binary* dependencies for F-Droid (if you'd prefer to build from source, pass the -PsourceDeps argument to gradle while building)."
repositories {
jcenter()
// 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.android.support:support-v4:22.2.1'
compile 'com.android.support:appcompat-v7:22.2.1'
compile 'com.android.support:support-annotations:22.2.1'
compile 'org.thoughtcrime.ssl.pinning:AndroidPinning:1.0.0'
compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.4'
compile 'com.google.zxing:core:3.2.0'
compile 'eu.chainfire:libsuperuser:1.0.0.201504231659'
// We use a slightly modified spongycastle, see
// openkeychain/spongycastle with some changes on top of 1.51.0.0
compile 'com.madgag.spongycastle:pkix:1.51.0.0'
compile 'com.madgag.spongycastle:prov:1.51.0.0'
compile 'com.madgag.spongycastle:core:1.51.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')
// Upstream doesn't have a binary on mavenCentral. Looks discontinued.
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')
// Project semi-abandoned, 3.4.1 is from 2011 and we use trunk from 2013
// TODO: active again and 3.4.2 now released, switch when available in jcenter:
// https://github.com/openhab/jmdns/issues/6
compile(name: 'jmdns')
androidTestCompile 'commons-io:commons-io:2.2'
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)."
repositories {
jcenter()
}
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 project(':extern:AndroidPinning')
compile project(':extern:UniversalImageLoader:library')
compile project(':extern:libsuperuser:libsuperuser')
compile project(':extern:nanohttpd:core')
compile project(':extern:jmdns')
compile project(':extern:zipsigner')
compile project(':extern:zxing-core')
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-07-24 10:35:51 -07:00
compile 'com.android.support:support-v4:22.2.1',
'com.android.support:appcompat-v7:22.2.1',
'com.android.support:support-annotations:22.2.1'
androidTestCompile 'commons-io:commons-io:2.2'
}
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 cleanBinaryDeps(type: Delete) {
enabled = project.hasProperty('sourceDeps')
description = "Removes all .jar and .aar files from F-Droid/libs/. Requires the sourceDeps property to be set (\"gradle -PsourceDeps cleanBinaryDeps\")"
delete fileTree('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
include '*.aar'
include '*.jar'
}
}
task binaryDeps(type: Copy, dependsOn: ':F-Droid:prepareReleaseDependencies') {
enabled = project.hasProperty('sourceDeps')
description = "Copies .jar and .aar files from subproject dependencies in extern/ to F-Droid/libs. Requires the sourceDeps property to be set (\"gradle -PsourceDeps binaryDeps\")"
from ('../extern/' ) {
include 'support-v4-preferencefragment/build/outputs/aar/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
'nanohttpd/core/build/libs/nanohttpd-2.1.0.jar',
'zipsigner/build/libs/zipsigner.jar',
'jmdns/build/libs/jmdns.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
}
into '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
includeEmptyDirs false
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.
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
details.path = details.name
}
}
android {
2015-07-24 10:35:47 -07:00
compileSdkVersion 22
2015-08-18 10:24:52 -07:00
buildToolsVersion '23.0.0'
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
androidTest.setRoot('test')
androidTest {
manifest.srcFile 'test/AndroidManifest.xml'
java.srcDirs = ['test/src']
resources.srcDirs = ['test/src']
aidl.srcDirs = ['test/src']
renderscript.srcDirs = ['test/src']
res.srcDirs = ['test/res']
assets.srcDirs = ['test/assets']
}
}
buildTypes {
all {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable 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
}
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-05-20 18:37:05 +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
// 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'
}
}