Skip to content

Instantly share code, notes, and snippets.

@Tanapruk
Last active July 12, 2017 05:01
Show Gist options
  • Save Tanapruk/8d590422da8b0f581a9d9c153575e4a4 to your computer and use it in GitHub Desktop.
Save Tanapruk/8d590422da8b0f581a9d9c153575e4a4 to your computer and use it in GitHub Desktop.
Gradle Offline in local.properties

build.gradle

apply from: "offline.gradle"

offline.gradle

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
def isOffline = properties.getProperty('isoffline')


if (isOffline != null) {
    gradle.startParameter.setOffline(isOffline.toBoolean())
}

local.properties

isoffline=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment