Last active
June 20, 2020 11:52
-
-
Save pranay1494/1483cebd4137dc1270789ad1bcff0405 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
ext { | |
listOfDeepLinkUrls = new ArrayList<String>() | |
listOfDeepLinkUrls.add("/home") | |
locales = ["en", "ar","es","hi-IN"] | |
} | |
ext.generateData = { host, listOfDeepLinkUrls, locales,listOfDomains -> | |
String links = "" | |
listOfDeepLinkUrls.each{ item -> | |
links += data(item,host) | |
locales.each{ locale -> | |
listOfDomains.each { domain -> | |
links += data("/"+locale.replace("_","-")+item,domain) | |
} | |
} | |
} | |
return links | |
} | |
static def data(String path, String host) { | |
return http(path,host) + https(path,host) | |
} | |
static def http(String path, String host) { | |
return "\n" + | |
" <data\n" + | |
" android:host=\"$host\"\n" + | |
" android:pathPrefix=\"$path\"\n" + | |
" android:scheme=\"http\"/>\n" | |
} | |
static def https(String path, String host) { | |
return "\n" + | |
" <data\n" + | |
" android:host=\"$host\"\n" + | |
" android:pathPrefix=\"$path\"\n" + | |
" android:scheme=\"https\"/>\n" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment