Giter VIP home page Giter VIP logo

android-buildconfig's Introduction

Shared Build Configuration for Android libraries

This repository contains common configuration to be used across our Android libraries. The advantage of sharing these configurations is mainly consistency of configuration among multiple libraries and reduction of boilerplate.

Kickstart

First add the submodule to your project:

$ cd my_project
$ git submodule add [email protected]:rakutentech/android-buildconfig.git config

Then modify your root build.gradle to apply the configuration:

buildscript {
  // This must be the first line of your buildscript closure
  apply from: "config/index.gradle"

  // …repositories, classpaths, etc…
}

From there, you can reference the global CONFIG object from any gradle file inside your project.

By default only versions is added to the project. You can apply configurations as desired.

Available configurations

Versioning Contract

This configuration's versions follow semantic versioning. We align all libraries that we bundle together on the same major version of this configuration. To clarify the semantics in the context of shared configurations here are a few examples of what are breaking changes (major version change), backwards compatible improvements (minor version change) and bug fixes (patch level):

Major Minor Patch
move gradle file to a different path add new configuration change minor or patch version of dependency
remove gradle file add new task in existing configuration refactor
change major version of dependencies add new dependency version
change of the versioning contract reduce boilerplate for consumer

To ensure usability we follow these rules:

  • Every version has a corresponding git tag of the format Major.Minor.Patch
  • Every version must describe the changes in versions section
  • Major version changes must also provide a migration guide from the previous major version

Versions

9.2.1 (2022-12-29)

  • Quality/Detekt: removed usage of obsolete fail-fast and test-pattern properties.

9.2.0 (2022-09-16)

  • Feature: Added Dangerfile that can be used for branch naming, commit, and other code rules.

9.1.0 (2022-05-23)

  • Updated Android Gradle plugin version to 7.2.0.
  • Updated Add parameter annotation to groovy tasks.

9.0.0 (2022-04-12)

  • Breaking Change: Renamed artifactory.gradle to repository.gradle, and project config keys for publishing.

8.0.0 (2022-04-07)

  • Breaking Change: Added Support for building with Java 11. You will need to set your JDK version to 11.
  • Updated Android Gradle plugin version to 7.1.0.
  • Updated Android Kotlin plugin version to 1.5.21.
  • Updated Detekt version to 1.19.0.

7.1.0 (2022-03-15)

7.0.0

  • Update versions:
    • AGP 4.0.2 (requires Gradle 6.1.1+).
    • Targets (and builds with) SDK 30.
  • Updated: Support for Dokka v1.6.10. This is a BREAKING change. You will need to update your Dokka version and change your dokka configuration as described in the documentation README

6.2.0 (2021-10-27)

  • Feature: Updated compile and target to API 31, and min to API 23 in versions.gradle

6.1.0 (2021-03-05)

  • Feature: Added publication configuration for Java libraries.

6.0.0 (2021-03-03)

  • Feature: Added Maven Central publishing script.
  • Removed: Bintray/JCenter publishing script was removed because these services are being shutdown.
  • Updated: Target and compile versions bumped to 30.
  • Updated: AGP bumped to 4.0.2. This now requires your project to use Gradle 6.1.1+.

5.0.0 (2020-11-16)

  • Quality: replaced deprecated FindBugs with SpotBugs.

4.3.2 (2020-10-05)

  • Fixed: GitHub pages publishing would sometimes upload the incomplete documentation.

4.3.1 (2020-09-03)

  • Fixed: Bintray publishing was failing due to an impcompatibility of the Bintray Gradle plugin with the Android Maven Publish plugin. The Bintray Gradle plugin has been removed so you no longer need to add com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4 as a plugin dependency.

4.3.0 (2020-08-06)

4.2.0 (2020-07-31)

4.1.0 (2020-07-22)

  • Added support for using Gradle Property for repository details to handle different settings for snapshot and release repo.

4.0.0 (2020-07-17)

  • Breaking Change: Remove digital.wup.android-maven-publish plugin as it is deprecated and AGP now has built-in support for the maven-publish plugin. Due to this change, you now must configure your publications within a the afterEvaluate phase. See the [publishing readme](publish/README.md] for more details. You should also remove digital.wup.android-maven-publish from your dependencies.
  • Added support for [KDoc generation](documentation/README.md] using dokka.
  • Update target/compile SDK to 29 and update Min SDK to 21.
  • Update Android Gradle Plugin to 3.6.2. You must now update your Gradle version to 5.6.4+.
  • Add support for publishing to Bintray or Artifactory.
  • Fixed an issue with documentation generation where images sometimes weren't copied to the documentation folder.
  • Add property closure to CONFIG. This can be used to return a value that has been set as either an environment variable or gradle property. Use like this: CONFIG.property('PROPERTY_NAME').

3.0.0 (2018-04-13)

  • Remove Kotlin check style tool, Ktlint, to replace it by Detekt.

2.1.0 (2018-04-13)

  • Quality/jacoco: get rid of dependency of old unmaintained gradle plugin.

2.0.0 (2018-03-26)

  • Documentation/doclava: make image assets project local, i.e. not shared among subprojects.

1.2.0 (2018-03-23)

  • Documentation/doclava: add customization of javadoc source
  • Documentation/doclava: add customization of javadoc classpath
  • Documentation/doclava: simplified javadoc classpath setup
  • buildSrc/SnapshotCheck: only apply to projcets in release version (according to semver)
  • Quality/Pmd: Exclude AvoidFieldNameMatchingMethodName, JUnitTestContainsTooManyAsserts, CommentDefaultAccessModifier, MethodArgumentCouldBeFinal rules
  • Quality/Checkstyle: Add support for @SuppressWarnings("checkstyle:RuleName) suppression of checkstyle rules
  • Quality/Findbugs: Setup complete classpath for findbugs task, relying on android.libraryVariants. Note that this does not work on android applications, but can be adapted to that usecase if it becomes necessary

1.1.0 (2018-01-16)

  • Documantation: Add doclava javadoc generation
  • Quality/Checkstyl: Change checkstyle severity from warning to error so that non-compliant code fails the build (can still be disabled with ignoreFailues flag in quality task extensions)
  • Quality/jacocco: automatically make check depend on jacacoTestReport

1.0.0 (2017-12-26)

  • Add semantic versioning & documentation guidelines
  • Move all configurations into folders
  • Split up README into sub-READMEs and move to respective folders
  • Merge Kotlin into master

android-buildconfig's People

Contributors

climbatize avatar corycaywood avatar donnie-jp avatar jcayzac avatar leila-gu avatar loic-dumas avatar maureenorea-clores avatar munir-rakuten avatar nemooudeis avatar rr-paul-wang avatar superbgv avatar the-pear avatar vincentdelmundo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

android-buildconfig's Issues

Findbugs classpath misses runtime dependencies

Running findbugs with default config warns that:

the following classes needed for analysis were missing:
  jp.co.rakuten.api.core.BaseRequest
  com.android.volley.Response$Listener
  jp.co.rakuten.sdtd.deviceinformation.DeviceInformation
  com.android.volley.Response$ErrorListener
  com.android.volley.VolleyError
  com.android.volley.RequestQueue
  com.android.volley.RetryPolicy
  com.android.volley.DefaultRetryPolicy
  com.android.volley.toolbox.Volley
  com.android.volley.NetworkResponse
  com.google.gson.Gson
  com.android.volley.Request
  com.android.volley.toolbox.RequestFuture
  com.android.volley.Response
  java.rmi.Remote
  com.google.gson.JsonSyntaxException
  com.google.gson.JsonParseException
  com.android.volley.Request$Method

Which are the compile/implementation dependencies, that are lacking on the classpath.
This makes total sense considering the configuration of the task:

task findbugs(type: FindBugs) {
  classpath = files(android.bootClasspath)
}

I'm not quite sure how to collect the runtime classpath of an app/lib at gradle configuration time - one approach would be to add a findbugs task for every variant and then collect the compile configuration dependencies - but then still we don't know the path to the jar on the file system...

Ideas or advice are very welcome.

[Quality/Findbugs] Relying on `libraryVariants` breaks findbugs config for android application plugin

Problem

* Where:
Script '/config/quality/findbugs/android.gradle' line: 20

* What went wrong:
A problem occurred configuring project ':sample'.
> Could not get unknown property 'libraryVariants' for object of type com.android.build.gradle.AppExtension.

Solution

Try something like (android.libraryVariant || android.variants) to pass the classpath to findbugs (not sure whether that syntax works in groovy, else we'll have to do it by hand).

With the new android gradle plugin 3.x it's no longer needed to specify buildToolsVersion

have you planed to remove buildToolsVersion settings soon or find a way to apply different android config for recent projects?

Just for information:
Warning:The specified Android SDK Build Tools version (26.0.1) is ignored, as it is below the minimum supported version (26.0.2) for Android Gradle Plugin 3.0.1.
Android SDK Build Tools 26.0.2 will be used.
To suppress this warning, remove "buildToolsVersion '26.0.1'" from your build.gradle file, as each version of the Android Gradle Plugin now has a default version of the build tools.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.