Skip to content
This repository has been archived by the owner on Jun 5, 2018. It is now read-only.
Sergey Shatunov edited this page Aug 3, 2014 · 15 revisions

HoloEverywhere Plugin

You can use plugin for easy attaching HoloEverywhere and addons:

buildscript {
  repositories {
    mavenCentral()
  }
  dependencies {
    classpath 'org.holoeverywhere:plugin:0.3.+' 
  }
}

apply plugin: 'holoeverywhere-app' // or holoeverywhere-library

// You can ommit any block
holoeverywhere {
  // Addons for library
  addons {
    preferences
    slider
  }
  library {
    version = 'latest' // you can use 'latest', 'snapshot' or specific version
  }
}

See wiki for all options

Manual attaching

Also you can add repo and attach modules manually

repositories {
  ...
  maven { url "http://192.241.191.41/repo" }
}
dependencies {
  compile 'com.android.support:support-v4:18.0.+@jar'
  compile 'org.holoeverywhere:library:2.1.+@aar'
  compile 'org.holoeverywhere:addon-preferences:2.1.+@aar'
  compile 'org.holoeverywhere:addon-slider:2.1.+@aar'
}

Plugin options

holoeverywhere {
  library {
    // force use a specified version, in case of 'latest' and 'snapshot'
    // repository index will downloaded and extract latest available version
    version = ['latest', 'snapshot', '*.*.*' (eg '2.1.0', '2.1.1-SNAPSHOT')]
  }
  support {
    // You can leave inherit as default for grabbing
    // support-v4 library from pom file of holoeverywhere library
    version = ['inherit', 'latest', '*.*.*']
  }
  signing {
    // You can directly provide sign properties for each build variant:
    [release|debug] {
      storeFile = '/home/user/keystore.jks'
      storePassword = 'myStorePasswordY}$*F}#$*'
      keyAlias = 'keyAlias'
      keyPassword = 'myKeyPassword(%*&%&!$%T^!'
    }
    // or can safely store this secret values in your local properties file,
    // which will not commit to VCS.
    // Put this values in the next pattern to ~/.gradle/gradle.properties:
    // projectNameStoreFile=/home/user/keystore.jks
    // projectNameStorePassword=myStorePasswordY}$*F}#$*
    // projectNameKeyAlias=keyAlias
    // projectNameKeyPassword=myKeyPassword(%*&%&!$%T^!
    //
    // and use this config value:
    release.key 'projectName'
    debug.key 'projectName'
    // or shortcut version for both build variants:
    key 'projectName'
  }
  // if you want to publish your library/apk in maven-like repositories
  // you can use a publish feature
  publish {
    // provide some values for your pom file:
    url = 'http://your.project/page'
    scm {
      url = 'http://your.project/scm/url'
      connection = 'scm:[email protected]:path/to/repo'
      developerConnection = 'scm:[email protected]:path/to/repo'
    }
    // if your project hosted on GitHub you can use shortcut version:
    github 'Username', 'ProjectName'

    // repository for publising
    repository {
      // as usual first manual properties:
      url = 'http://your.repository/url'
      snapshotUrl = 'http://your.repository/snapshot/url'

      // any of auth property may be omitted
      userName = 'userName' // basic auth & ssh key
      password = 'password' // basic auth & ssh key
      passphrase = 'passphrase' // ssh key
      privateKey = '/path/to/private/key' // ssh key

      // and as usual you can use shortcut versions:

      sonatype {
        // this declaration will set url and snapshotUrl properties
        // also this lookup global properties sonatype[UserName,Password,Passphrase,PrivateKey]
        // and use it if exists
        // but you can override it:
        userName = 'overridedUsername'
      }

      holoeverywhere {
        // Wow. I don't think that you have rights for writing to HoloEverywhere's server
        // Ignore it for your safety
      }

      local '/home/user/localrepo' {
        // just local repo
        // if you omit path property then local maven repo (~/.m2/repository) will used
      }
    }

    license {
      // Well, you known what to do:
      name = 'Super License'
      url = 'http//your.project/license'
      comments = 'See on Facebook'

      // Shortcuts! Do you like shortcuts, yes?
      mit {}
      apache {}
      bsd2 {}
      bsd3 {}
      gpl2 {}
      gpl3 { comments = 'Wow, GPL3 application for Android! Awesome!' }
      lgpl2 {}
      lgpl3 {}
    }
  }
}

apply plugin: 'holoeverywhere-publish' // Don't forget this line if you want to use publish feature!
Clone this wiki locally