Created
January 25, 2015 13:12
-
-
Save Ghedeon/affdc95aeafafe6684cd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.android.builder.testing.ConnectedDeviceProvider | |
def DEVICES_PROPERTY = "devices" | |
ConnectedDeviceProvider.metaClass.getProperty = { String name -> | |
def metaProperty = delegate.metaClass.getMetaProperty(name) | |
def property = metaProperty.getProperty(delegate) | |
if (name.equals(DEVICES_PROPERTY) && project.hasProperty(DEVICES_PROPERTY)) { | |
def devicesSerials = project.getProperties().get(DEVICES_PROPERTY).split(/,/) | |
def devices = property.findAll {devicesSerials.contains(it.serialNumber)} | |
property = devices | |
} | |
property | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment