diff --git a/OpenKeychain/build.gradle b/OpenKeychain/build.gradle index 7fa139c06..026c12319 100644 --- a/OpenKeychain/build.gradle +++ b/OpenKeychain/build.gradle @@ -33,8 +33,8 @@ dependencies { } android { - compileSdkVersion 21 - buildToolsVersion '21.1.2' + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion defaultConfig { minSdkVersion 15 diff --git a/README.md b/README.md index 991757169..7c2f50326 100644 --- a/README.md +++ b/README.md @@ -109,23 +109,38 @@ see ## Notes -### Gradle Build System +### Build System We try to make our builds as [reproducible/deterministic](https://blog.torproject.org/blog/deterministic-builds-part-one-cyberwar-and-global-compromise) as possible. -When changing build files or dependencies, respect the following requirements: -* No precompiled libraries (you never know what pre-compiled jar files really contain!). All libraries should be forked into the open-keychain Github project and then provided as git submodules in the "extern" folder. -* No dependencies from Maven (also a soft requirement for inclusion in [F-Droid](https://f-droid.org)) + +#### Update Gradle version * Always use a fixed Android Gradle plugin version not a dynamic one, e.g. ``0.7.3`` instead of ``0.7.+`` (allows offline builds without lookups for new versions, also some minor Android plugin versions had serious issues, i.e. [0.7.2 and 0.8.1](http://tools.android.com/tech-docs/new-build-system)) -* Commit the corresponding [Gradle wrapper](http://www.gradle.org/docs/current/userguide/gradle_wrapper.html) to the repository (allows easy building for new contributors without the need to install the required Gradle version using a package manager) -* In order to update the build system to a newer gradle version you need to: - * Update every build.gradle file with the new gradle version and/or gradle plugin version +* Update every build.gradle file with the new gradle version and/or gradle plugin version * build.gradle * OpenKeychain/build.gradle - * OpenKeychain-API/build.gradle - * OpenKeychain-API/example-app/build.gradle - * OpenKeychain-API/libraries/keychain-api-library/build.gradle - * run ./gradlew wrapper twice to update gradle and download the new gradle jar file - * commit the new gradle jar and property files +* run ./gradlew wrapper twice to update gradle and download the new gradle jar file +* commit the corresponding [Gradle wrapper](http://www.gradle.org/docs/current/userguide/gradle_wrapper.html) to the repository (allows easy building for new contributors without the need to install the required Gradle version using a package manager) + +#### Update SDK and Build Tools +* Open build.gradle and change: +``` +ext { + compileSdkVersion = 21 + buildToolsVersion = '21.1.2' +} +``` +* Change SDK and Build Tools in git submodules "openkeychain-api-lib" and "openpgp-api-lib" manually. They should also build on their own without the ext variables. + +#### Add new library +* You can add the library as a Maven dependency or as a git submodule (if patches are required) in the "extern" folder. +* If added as a Maven dependency, pin the library using [Gradle Witness](https://github.com/WhisperSystems/gradle-witness) +* If added as a git submodule, change the ``compileSdkVersion`` and ``buildToolsVersion`` in build.gradle to use the variables from the root project: +``` +android { + compileSdkVersion rootProject.ext.compileSdkVersion + buildToolsVersion rootProject.ext.buildToolsVersion +} +``` ### Slow Gradle? diff --git a/build.gradle b/build.gradle index f8e6afc27..4076ddc6b 100644 --- a/build.gradle +++ b/build.gradle @@ -38,3 +38,10 @@ project(':extern:spongycastle') { test.enabled = false } } + +// SDK Version and Build Tools used by all subprojects +// See http://tools.android.com/tech-docs/new-build-system/tips#TOC-Controlling-Android-properties-of-all-your-modules-from-the-main-project. +ext { + compileSdkVersion = 21 + buildToolsVersion = '21.1.2' +} \ No newline at end of file diff --git a/extern/KeybaseLib b/extern/KeybaseLib index 2b26d163d..9615d90b1 160000 --- a/extern/KeybaseLib +++ b/extern/KeybaseLib @@ -1 +1 @@ -Subproject commit 2b26d163df84a3d26c1c8da088ed3811b5ca6ec7 +Subproject commit 9615d90b18d1aee4dad994aa45875adfdcfb3c34 diff --git a/extern/StickyListHeaders b/extern/StickyListHeaders index 62cc58c12..70a2ed806 160000 --- a/extern/StickyListHeaders +++ b/extern/StickyListHeaders @@ -1 +1 @@ -Subproject commit 62cc58c12d0c09b50984caf26e5afceda8873784 +Subproject commit 70a2ed80632938540bf07b81270384f4e5a96f9e diff --git a/extern/SuperToasts b/extern/SuperToasts index 77042d633..79fbaa4e3 160000 --- a/extern/SuperToasts +++ b/extern/SuperToasts @@ -1 +1 @@ -Subproject commit 77042d633f4dd430bcc86101e31dda52433db9c1 +Subproject commit 79fbaa4e3cf118a07ca4573b514c679b666fb214 diff --git a/extern/TokenAutoComplete b/extern/TokenAutoComplete index ca46b4261..1d6d3882e 160000 --- a/extern/TokenAutoComplete +++ b/extern/TokenAutoComplete @@ -1 +1 @@ -Subproject commit ca46b4261c97221ddd4db135e7838d6fa145adf4 +Subproject commit 1d6d3882e711c14c93abf73cbcbd28b9e0e2b498 diff --git a/extern/html-textview b/extern/html-textview index eedaa334e..9872a7315 160000 --- a/extern/html-textview +++ b/extern/html-textview @@ -1 +1 @@ -Subproject commit eedaa334e761273efbfc49ded2124df58c8a4d88 +Subproject commit 9872a73156518fd8df79dd2cd4d24750574b9ac7 diff --git a/extern/openkeychain-api-lib b/extern/openkeychain-api-lib index 88c004793..925907502 160000 --- a/extern/openkeychain-api-lib +++ b/extern/openkeychain-api-lib @@ -1 +1 @@ -Subproject commit 88c00479329c1aa892bef052f3f8830067c386d8 +Subproject commit 9259075028e0906d0cb085e0c4578e23829dc3c0 diff --git a/extern/safeslinger-exchange b/extern/safeslinger-exchange index 96f7c8935..7c84cb54d 160000 --- a/extern/safeslinger-exchange +++ b/extern/safeslinger-exchange @@ -1 +1 @@ -Subproject commit 96f7c893565e3a8badd740b2035beea87d8bffb3 +Subproject commit 7c84cb54df5b3d5c6780984e48f3e9e4cbc5128e