diff --git a/F-Droid/build.gradle b/F-Droid/build.gradle index 1be738406..8ddb0fe89 100644 --- a/F-Droid/build.gradle +++ b/F-Droid/build.gradle @@ -1,8 +1,6 @@ apply plugin: 'com.android.application' 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() @@ -25,9 +23,6 @@ if (!hasProperty('sourceDeps')) { compile 'eu.chainfire:libsuperuser:1.0.0.201504231659' compile 'cc.mvdan.accesspoint:library:0.1.1' compile 'info.guardianproject.netcipher:netcipher:1.2' - - // 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' @@ -60,49 +55,41 @@ if (!hasProperty('sourceDeps')) { } 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 'com.android.support:support-v4:22.2.1' + compile 'com.android.support:appcompat-v7:22.1.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.1' + compile 'eu.chainfire:libsuperuser:1.0.0.201504231659' + compile 'cc.mvdan.accesspoint:library:0.1.1' + compile 'info.guardianproject.netcipher:netcipher:1.2' + compile(project(':extern:support-v4-preferencefragment')) { exclude module: 'support-v4' } - - compile 'com.android.support:support-v4:22.2.1', - 'com.android.support:appcompat-v7:22.1.1', - 'com.android.support:support-annotations:22.2.1' + compile project(':extern:nanohttpd:core') + compile project(':extern:zipsigner') + compile project(':extern:jmdns') androidTestCompile 'commons-io:commons-io:2.2' } } -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') { - 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', - 'nanohttpd/core/build/libs/nanohttpd-2.1.0.jar', - 'zipsigner/build/libs/zipsigner.jar', - 'jmdns/build/libs/jmdns.jar' + 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' + include 'jmdns/build/libs/jmdns.jar' } into 'libs/binaryDeps' - includeEmptyDirs false eachFile { FileCopyDetails details -> diff --git a/F-Droid/libs/README.md b/F-Droid/libs/README.md deleted file mode 100644 index 430057598..000000000 --- a/F-Droid/libs/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# Licenses - -To see which license any one of these libraries is under, consult the extern/ -directory. If you have checked out the source for all dependencies (`git -submodule update --init` from the root directory if there are any submodules), -then you should be able to find the relevant LICENSE file for each, or else -you can consult upstream. - - -# Building libraries from source - -As a matter of principle, and also to comply with the GPLv3+, F-Droid should always be able to be built -from source, _including all of its dependencies_. - -For practical reasons, developers often don't want the overhead of having to fetch the source of each -dependency though. Also, they may not want their build script to have to take the time to configure and -check that each subproject is up-to-date. Building from binary dependencies is _much_ faster, requires -less downloading of external source, and should import into Android Studio and other IDE's more easily. - -To deal with these two goals (building dependencies from source, and relying on prebuilt binaries), the -build script can be run in two modes. - - -## Gradle commands - -`gradle build` will build _F-Droid_ from source, but _not the depenencies_ from source. It will instead depend -on binaries from jcenter where possible, and .jar and .aar files in F-Droid/libs/binaryDeps elsewhere. - -`gradle -PsourceDeps build` will include all dependencies and build the entire F-Droid binary -and all of its dependencies from source. - -`gradle -PsourceDeps binaryDeps` will build all dependencies from source, and then copy the ones which -are not found in jcenter to F-Droid/libs/binaryDeps, making sure that the latest versions of the libraries are available -for developers wishing to build F-Droid from binary dependencies. - -`gradle -PsourceDeps cleanBinaryDeps` will remove all binary dependencies. It shouldn't be neccesary, -because the `binaryDeps` will copy fresh .jar and .aar files to the F-Droid/libs/binaryDeps directory when they change. -It may be handy if you are updating the build script though, as a nice way to empty the F-Droid/libs/binaryDeps directory. - - -# Adding new dependencies - -When adding a new dependency, *DON'T* copy the .jar or .aar file into F-Droid/libs/binaryDeps. This will get deleted -when somebody runs `gradle -PsourceDeps cleanBinaryDeps`. Also, the version of F-Droid built for distribution -on https://f-droid.org will be build from source depednencies, so adding a binary is not enough. - -Instead, you should add the source repo as a submodule in the extern/ diretory. You will also need to modify -the F-Droid/build.gradle file, adding both the source dependency on the project in the extern/ directory, and -a dependency on its jcenter/mavenCentral artifact. If that artifact is not available, then you should add -the library to those to be copied using `gradler -PsourceDeps binaryDeps`. Then, you can commit that binary so that -anyone who clones the F-Droid repo will have all of the dependencies ready in either jcetner or the -F-Droid/libs/binaryDeps directory. diff --git a/README.md b/README.md index fd786cb42..368c91167 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,6 @@ Once you have checked out the version you wish to build, run: cd F-Droid gradle assembleRelease -If you would like to build from source, add `-PsourceDeps`: - - cd F-Droid - gradle assembleRelease -PsourceDeps - The resulting apk will be in `build/outputs/apk/`. Android Studio @@ -140,4 +135,4 @@ Some icons are made by [Picol](http://www.flaticon.com/authors/picol), Other icons are from the [Material Design Icon set](https://github.com/google/material-design-icons) released under an -[Attribution 4.0 International license](http://creativecommons.org/licenses/by/4.0/). \ No newline at end of file +[Attribution 4.0 International license](http://creativecommons.org/licenses/by/4.0/). diff --git a/extern/AndroidPinning/build.gradle b/extern/AndroidPinning/build.gradle index 661bccc46..53fb1ab49 100644 --- a/extern/AndroidPinning/build.gradle +++ b/extern/AndroidPinning/build.gradle @@ -12,7 +12,7 @@ apply plugin: 'android-library' android { compileSdkVersion 17 - buildToolsVersion '22.0.1' + buildToolsVersion '23.0.1' android { sourceSets { diff --git a/extern/UniversalImageLoader/library/build.gradle b/extern/UniversalImageLoader/library/build.gradle index b7c42bd72..3114daad0 100644 --- a/extern/UniversalImageLoader/library/build.gradle +++ b/extern/UniversalImageLoader/library/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion 22 - buildToolsVersion "22.0.1" + buildToolsVersion "23.0.1" defaultConfig { minSdkVersion 5 diff --git a/extern/libsuperuser/libsuperuser/build.gradle b/extern/libsuperuser/libsuperuser/build.gradle index 2ed478442..8987b1ebe 100644 --- a/extern/libsuperuser/libsuperuser/build.gradle +++ b/extern/libsuperuser/libsuperuser/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' android { compileSdkVersion 21 - buildToolsVersion "22.0.1" + buildToolsVersion "23.0.1" defaultConfig { minSdkVersion 4 diff --git a/extern/support-v4-preferencefragment/build.gradle b/extern/support-v4-preferencefragment/build.gradle index a989b8b56..1b211ebd9 100644 --- a/extern/support-v4-preferencefragment/build.gradle +++ b/extern/support-v4-preferencefragment/build.gradle @@ -19,7 +19,7 @@ dependencies { android { compileSdkVersion 19 - buildToolsVersion '22.0.1' + buildToolsVersion '23.0.1' defaultConfig { minSdkVersion 7 diff --git a/settings.gradle b/settings.gradle index 263753759..b037990b4 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,15 +1,12 @@ include ':F-Droid' - -if ( hasProperty( 'sourceDeps' ) ) { - include ':extern:AndroidPinning' - include ':extern:UniversalImageLoader:library' - include ':extern:libsuperuser:libsuperuser' +if (hasProperty('sourceDeps')) { + include ':extern:support-v4-preferencefragment' include ':extern:nanohttpd:core' - include ':extern:jmdns' include ':extern:zipsigner' + include ':extern:jmdns' + + // Needed for zipsigner include ':extern:spongycastle:core' include ':extern:spongycastle:pkix' include ':extern:spongycastle:prov' - include ':extern:zxing-core' - include ':extern:support-v4-preferencefragment' }