mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-15 03:30:29 +03:00
common: add calculate_gradle_flavor_combination
This commit is contained in:
parent
6c054f62ca
commit
e957583337
2 changed files with 20 additions and 0 deletions
|
|
@ -58,6 +58,7 @@ from typing import List
|
|||
import git
|
||||
import glob
|
||||
import io
|
||||
import itertools
|
||||
import os
|
||||
import sys
|
||||
import re
|
||||
|
|
@ -4823,6 +4824,20 @@ def calculate_archive_policy(app, default):
|
|||
return archive_policy
|
||||
|
||||
|
||||
def calculate_gradle_flavor_combination(flavors):
|
||||
"""Calculate all combinations of gradle flavors."""
|
||||
combination_lists = itertools.product(*[[flavor, ''] for flavor in flavors])
|
||||
combinations = [
|
||||
re.sub(
|
||||
r' +\w',
|
||||
lambda pat: pat.group(0)[-1].upper(),
|
||||
' '.join(combination_list).strip(),
|
||||
)
|
||||
for combination_list in combination_lists
|
||||
]
|
||||
return combinations
|
||||
|
||||
|
||||
FDROIDORG_MIRRORS = [
|
||||
{
|
||||
'isPrimary': True,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue