A gradle plugin generates resConfig & languages array from project res folder.

Overview

AutoResConfig

For Android application projects that accept user-submitted translations, the number of supported languages may be large and growing. When new languages are added, developers need to manually update resConfig (1) and language array xml/class (2). Manual means there could be human error.

(1) resConfig limits the final packaged resources. Libraries may carry languages resources which the language is not supported by the application itself. Set resConfig could reduce apk size.

(2) If the application has a "choose language" feature, there must be an array of supported languages (could be as an Android resource XML or a Java class).

This plugin collect locales from values- folders, set resConfig, generate language array xml/class.

Usage

gradle-plugin

Replace all the below with the version shows here.

  1. Add gradle plugin

    ' } }">
    // "old way"
    buildscript {
        repositories {
            mavenCentral()
        }
        dependencies {
            classpath 'dev.rikka.tools.autoresconfig:dev.rikka.tools.autoresconfig.gradle.plugin:
         
          '
         
        }
    }
    ' }">
    // "new way"
    plugins {
        id 'dev.rikka.tools.autoresconfig' version '
         
          '
         
    }
  2. Use the plugin in Android application module

    plugins {
        id('dev.rikka.tools.autoresconfig')
    }
    
  3. Config in Android application module

    autoResConfig {
        generateClass = true
        generatedClassFullName = "rikka.autoresconfig.Locales"
        generateRes = true
        generatedResPrefix = null
        generatedArrayFirstItem = "SYSTEM"
    }
You might also like...

:package: Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.

JavaPackager JavaPackager is a hybrid plugin for Maven and Gradle which provides an easy way to package Java applications in native Windows, Mac OS X

Jan 8, 2023

Maven port of the Netflix Gradle code generation plugin for graphql. https://github.com/Netflix/dgs-codegen

This is port of the netflix codegen plugin for Gradle. Found here. COPIED FROM NETFLIX DOCUMENTATION. The DGS Code Generation plugin generates code fo

Dec 24, 2022

A gradle plugin based on ANTLR to generate UML diagrams from kotlin source code.

A gradle plugin based on ANTLR to generate UML diagrams from kotlin source code.

A gradle plugin based on ANTLR to generate UML diagrams from kotlin source code.

Oct 26, 2022

A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs.

HiddenApiRefinePlugin A Gradle plugin that improves the experience when developing Android apps, especially system tools, that use hidden APIs. Backgr

Jan 5, 2023

A gradle plugin for developing javaagent applications.

Javaagent Packing A gradle plugin for developing javaagent applications. Why this plugin Fast packing all dependencies Used many dependencies? Javaage

May 13, 2022

Houston Asset Server Gradle plugin

Houston Asset Server Gradle plugin It is a helper that helps achieve synchronization automation through the build script of the schema serialized in p

Jan 28, 2022

Java Ecosystem Capabilities Gradle Plugin

Java Ecosystem Capabilities Gradle Plugin

Java Ecosystem Capabilities Gradle Plugin This plugin adds Capabilities to the metadata of well-known components hosted on Maven Central that are used

Dec 6, 2022

Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml

manifest-guard Gradle plugin for Android applications for detecting unexpected changes in AndroidManifest.xml The problem being solved Every third-par

Dec 24, 2022

A simple hierarchical state machine compiler that generates C.

Makina is a hierarchical state machine source-to-source translator. It takes state machine descriptions as input and produces C language implementations of those state machines.

Oct 17, 2022

It generates a circular Image from users display names with animation support

DisplayNameView generates an avatar from users name. Setup allprojects { repositories { ... maven { url 'https://jitpack.io' }

Sep 24, 2021

Generates and keeps up-to-date your Spring Boot applications' Let's Encrypt or other ACME compliant SSL certificates.

Generates and keeps up-to-date your Spring Boot applications' Let's Encrypt or other ACME compliant SSL certificates.

Generates and keeps up-to-date your Spring Boot applications' Let's Encrypt or other ACME compliant SSL certificates. Pure Java in a single file of library code. An automated embedded alternative to Certbot and docker-sidecars. No JVM restart is needed on certificate update.

Nov 18, 2022

Restler is a library that automatically generates a client for a web service at run time, by analyzing the respective annotated Spring controller interface

Restler Overview Restler is a library that automatically generates a client for a web service at run time, by analyzing the respective annotated Sprin

Oct 24, 2022

Buried Barrels is a simple vanilla+ mod that generates hidden barrels throughout the world.

Buried Barrels is a simple vanilla+ mod that generates hidden barrels throughout the world. Special maps leading to these treasures can be found on mo

Apr 7, 2022

Generates a Proguard mapping file for use in obfuscating your Java projects.

Reaper Generates a Proguard mapping file for use in obfuscating your Java projects. Features Automatically checks for duplicate names. Interactive, in

Dec 29, 2022

A Parser That parses OpenAPI definitions in JSON or YAML format and Generates Pact files That contain HTTP request/response interactions by parsing Given Open API specifications

This is a Parser That parses OpenAPI definitions in JSON or YAML format and Generates Pact files That contain HTTP request/response interactions by parsing Given Open API specifications.

Mar 19, 2022

jextract is a tool which mechanically generates Java bindings from a native library headers.

Jextract jextract is a tool which mechanically generates Java bindings from a native library headers. This tools leverages the clang C API in order to

Dec 30, 2022

A library that automatically generates and manages configuration files based on classes.

sc-cfg SC-CFG is a simple, yet powerful library that automatically generate configuration files based on your classes. Compatible with Java 8+ and Kot

Nov 28, 2022

Auto-Unit-Test-Case-Generator automatically generates high-level code-coverage JUnit test suites for Java, widely used within the ANT Group.

中文README传送门 What is Auto-Unit-Test-Case-Generator Auto-Unit-Test-Case-Generator generates JUnit test suites for Java class just as its name. During te

Dec 22, 2022

The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts

The open-source Java obfuscation tool working with Ant and Gradle by yWorks - the diagramming experts

yGuard yGuard is an open-source Java obfuscation tool. With yGuard it is easy as pie ( 🍰 ) to configure obfuscation through an extensive ant task. yG

Jan 2, 2023
Owner
Rikka apps
Rikka apps
configuration library for JVM languages using HOCON files

Configuration library for JVM languages. If you have questions or are working on a pull request or just curious, please feel welcome to join the chat

Lightbend 5.8k Jan 4, 2023
Spotless-intellij-gradle - An IntelliJ plugin to allow running the Spotless gradle task from within the IDE.

Spotless Intellij Gradle An IntelliJ plugin to allow running the spotless gradle task from within the IDE on the current file selected in the editor.

Ryan Gurney 30 Dec 17, 2022
A simple plugin to load behavior packs from the 'behavior_packs' folder.

Behaviour Pack Loader for Nukkit A simple plugin to load behavior packs from the behavior_packs folder. If you found any bugs or have any suggestions,

Woder 14 Dec 7, 2022
A React Native project starter with Typescript, a theme provider with hook to easy styling component, a folder architecture ready and some configs to keep a codebase clean.

React Native Boilerplate Folder structure : src ├── assets │   ├── audios │   ├── fonts │   ├── icons │   └── images ├── components │   ├── Layout.tsx

LazyRabbit 23 Sep 1, 2022
This is a module for Waterfall/Bungeecord! That means instead of putting it in the plugins/ folder

CMD: Plugins This is a module for Waterfall/Bungeecord! That means instead of putting it in the plugins/ folder, you put it in the modules/ folder! In

CyberedCake 0 Jun 8, 2022
Schreibe die statische Methode intArrayMinimum so, dass sie den kleinsten im übergebenen Array enthaltenen Integer-Wert zurückgibt.

In dieser Aufgabe wiederholst du an einem einfachen Beispiel die Verarbeitung von Arrays. Konkret geht es darum den kleinsten Wert in einem Array zu f

null 2 Dec 23, 2021
Function allowing you to find duplicate in an array in linear time and constant space

Floyd's tortoise and hare Function allowing you to find duplicate in an array in linear time and constant space ! Floyd's method is a pretty amazing,

null 7 Mar 29, 2022
DCS 19 CO1212 - Array Operations Activity

Array Operations Download this two java files and implement the methods which are mentioned inside the class. Just use the basic things that I have ta

Dilshan Karunarathne 4 Apr 12, 2022
ReleaseFab is a Java client application which automatically generates Release Notes for any project.

ReleaseFab is a Java client application which atomatically generates Release Notes for any project. The information can be gathered from multiple different sources including the source code itself, the Git repository and an Application Lifecycle Management System of your choice.

comlet Verteilte Systeme GmbH 7 Jun 10, 2022