Coder Social home page Coder Social logo

gradle-android-utils's Introduction

gradle-android-utils Build Status

This is a set of utilities for Android build system.

NOTE: This project is still alpha-qality; API will be change without notice

METHODS

void iconToGrayScale(File inputFile, File outputFile)

Converts the input icon file into grayscaled one.

void copyFile(File inputFile, File outputFile, boolean toOverwrite = false)

Create outputFile from inputFile if it does not exist.

You can force overwrite with specifies the true to the 3rd argument.

void initSdkDir(Map<String, String> extra = null)

Creates local.properties if it does not exist, which includes sdk.dir, ndk.dir and extra properties.

void writeResources(File file, Map<String, String> dict)

Creates a resource XML file, which contains dict.

Version parseVersion(String versionName), Version readVersion(File versionFile)

Prases or reads a version object, which has toVersionCode() and toVersionName() methods.

void setBuildConfigField(buildType, Map<String, Object> buildConfigMap)

Set buildConfigField from Map. Requirements to 'com.android.tools.build:gradle:0.8.0' or later.

// For example

android.variantFilter{ variant ->
    def buildConfigMap = [
        'APP_NAME': 'MyApp' + variant.buildType.name.capitalize(),
        'EXTENSION_MIN_SDK_INT': 14,
        'API_SERVER_PRODUCTION': false,
    ]

    setBuildConfigField(variant.buildType, buildConfigMap)
    // or
    //setBuildConfigField(variant.flavors.get(0), buildConfigMap)
}

/**
 * //Build result
 *
 * public final class BuildConfig {
 *   ...
 *   // Fields from build type: debug
 *   public static final String APP_NAME = "MyAppDebug";
 *   public static final Integer EXTENSION_MIN_SDK_INT = 14;
 *   public static final Boolean API_SERVER_PRODUCTION = false;
 * }
 */

SEE ALSO

LICENSE

This program is free software; you can redistribute it and/or modify it under the same terms of the MIT license.

gradle-android-utils's People

Contributors

gfx avatar ichigotake avatar tomorrowkey avatar rejasupotaro avatar monae avatar

Watchers

 avatar

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.