From 505140ef2a480f9a25a0a2d458865347b26b11c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 2 Mar 2015 16:21:51 +0100 Subject: Use SDK and build tools versions from root project --- README.md | 39 +++++++++++++++++++++++++++------------ 1 file changed, 27 insertions(+), 12 deletions(-) (limited to 'README.md') 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? -- cgit v1.2.3 From 058f792566d0bacb327d32f0e59ffca2af7323bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 2 Mar 2015 16:34:56 +0100 Subject: Update readme for build system --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'README.md') diff --git a/README.md b/README.md index 7c2f50326..021a15acb 100644 --- a/README.md +++ b/README.md @@ -106,10 +106,7 @@ see * Mailinglist Archive at http://bouncy-castle.1462172.n4.nabble.com/Bouncy-Castle-Dev-f1462173.html * Commit changelog of pg subpackage: https://github.com/bcgit/bc-java/commits/master/pg - -## Notes - -### 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. @@ -141,17 +138,18 @@ android { buildToolsVersion rootProject.ext.buildToolsVersion } ``` +* You can check for wrong ``compileSdkVersion`` by ``find -name build.gradle | xargs grep compileSdkVersion`` -### Slow Gradle? +#### Slow Gradle? * https://www.timroes.de/2013/09/12/speed-up-gradle/ * Disable Lint checking if it is enabled in build.gradle -### Error:Configuration with name 'default' not found. +#### Error:Configuration with name 'default' not found. Gradle project dependencies are missing. Do a ``git submodule init && git submodule update`` -### Translations +## Translations Translations are hosted on Transifex, which is configured by ".tx/config". -- cgit v1.2.3 From 3c7c278ef3fd9a5dd3da9df5e969ee5fa94e35d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Sch=C3=BCrmann?= Date: Mon, 2 Mar 2015 17:23:06 +0100 Subject: Use gradle witness --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'README.md') diff --git a/README.md b/README.md index 021a15acb..83655ce01 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ ext { #### 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 Maven dependency, pin the library using [Gradle Witness](https://github.com/WhisperSystems/gradle-witness) (Do ``./gradlew -q calculateChecksums`` for Trust on First Use) * If added as a git submodule, change the ``compileSdkVersion`` and ``buildToolsVersion`` in build.gradle to use the variables from the root project: ``` android { -- cgit v1.2.3