cl_crack

Tools for the Gradle Crack plugin


License
Aladdin
Install
gem install cl_crack -v 0.0.8

Documentation

Crack


What?

This project is a Gradle plugin for Android projects. It helps deal with some of build script's placeholders in some XML resource files, which official Build tools don't support.

Supported placeholders:

  • ${applicationId}
  • ${versionCode}
  • ${versionName}

Supported resource directories, XML tags and sub tags:

  • values*

      :::xml
      <resources>
          <string/>
    
  • xml*

      :::xml
      <account-authenticator/>
      <ContactsSource>
          <ContactsDataKind/>
      <searchable/>
      <sync-adapter/>
    

Usage

  1. build.gradle

     :::gradle
     buildscript {
         repositories {
             ...
             maven { url 'https://haibison.bitbucket.io/maven-repos' }
         }
    
         dependencies {
             ...
             classpath 'haibison.android:crack:x.x.x'
         }
     }
    

    Notes:

    • Remember to replace x.x.x with actual release version number.
    • We also published version 1.0.0 to Gradle Plugins. However for newer versions, we only support above repository URL.
  2. app/build.gradle (or similar)

     :::gradle
     ...
     android {
         ...
     }
    
     // Applying *after* `android {}` block
     apply plugin: 'haibison.android.crack'
    
  3. Logging

    The plugin prints log with this string as prefix: CRACK_ED126C09_x.x.x. For example:

     :::shell
     ...
     CRACK_ED126C09_1.0.1: xml/searchable.xml
    
  4. BuildConfig.TAG

    To have the plugin generate BuildConfig.TAG, you can add one extension to your project:

     :::gradle
     project.extensions.add(haibison.android.crack.Crack.EXT_TAG_PREFIX, 'YOUR-TAG-PREFIX_')
    

    It will generate TAG in this form: YOUR-TAG-PREFIX_ CRC32-OF-APPLICATION-ID _ VERSION-CODE. For example:

     :::java
     YOUR-TAG-PREFIX_ABCDEF678_9