Improves Gradle's ability to update browser addons

This commit is contained in:
Markil3
2021-09-14 10:53:01 -06:00
parent 91980aac75
commit 3eab100a08
5 changed files with 185 additions and 133 deletions

View File

@@ -217,6 +217,22 @@ task movePolicies(type: Copy) {
dependsOn setupProfile
from files("browserConf")
into "$rootDir/firefox/"
filesMatching('**/policies.json'){
def pre = ""
for (File addon: configurations.addon.resolve())
{
if (pre.length() > 0)
{
pre += ",\n"
}
pre += "\"" + addon.name.substring(0, addon.name.lastIndexOf('.')) + "\": {\n"
pre += "\"installation_mode\": \"forced_install\","
pre += "\"install_url\": \"" + addon.toURI().toString() + "\""
pre += "}"
}
println "Expanding ${pre}"
expand(preinstalled: pre)
}
doLast {
println "Making policies firefox!"
}