Commit 3cf0d472 authored by Mygod's avatar Mygod

Minimize build script

parent b622545c
......@@ -5,24 +5,11 @@ apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
def getCurrentFlavor() {
Gradle gradle = getGradle()
String tskReqStr = gradle.getStartParameter().getTaskRequests().toString()
Pattern pattern;
if( tskReqStr.contains( "assemble" ) )
pattern = Pattern.compile("assemble(\\w+)(Release|Debug)")
else
pattern = Pattern.compile("generate(\\w+)(Release|Debug)")
Matcher matcher = pattern.matcher( tskReqStr )
if( matcher.find() )
return matcher.group(1).toLowerCase()
else
{
Matcher matcher = Pattern.compile("(assemble|generate)(\\w+)(Release|Debug)")
.matcher(getGradle().getStartParameter().getTaskRequests().toString())
if (matcher.find()) return matcher.group(1).toLowerCase() else {
println "NO MATCH FOUND"
return "";
return ""
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment