Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Commit

Permalink
build: Fix avro4j config script
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewinci committed Feb 13, 2022
1 parent 5d890dd commit d1ed47f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/build.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import glob
import os
from helper import build_file
import requests

"""
Must run first
./gradlew getDependencySources
./gradlew :app:mergeLocalLibs
python3.8 scripts/build.py
python3 scripts/build.py
"""

header = """<configuration timestamp="2022-02-12T00:00:00.000000000Z">
Expand Down Expand Up @@ -53,6 +54,13 @@

jars_path = "./app/build/distributions/app/lib/"

# retrieve os specific jars
for k in os_specific_jar:
with open(jars_path + k, 'wb') as jar:
r = requests.get(os_specific_jar[k]["uri"], allow_redirects=True)
jar.write(r.content)

# retrieve jars dependencies from the gradle output
dependency_files = set(
glob.glob("./**/**/**/dependencies.txt") + glob.glob("./**/**/dependencies.txt")
)
Expand All @@ -65,10 +73,13 @@
dependency_map.update(insulator_jar)
dependency_map.update(os_specific_jar)

# Remove prefix in local jars
jars = [j.replace(jars_path, "") for j in glob.glob(f"{jars_path}*.jar")]

# Build xml line for each dependency
files = {j: build_file(jars_path + j, dependency_map.get(j)) for j in jars}

# Put all together
print("Writing new update4j config file")
with open("insulator-update.xml", "w") as config:
config.write(header + "\n")
Expand Down

0 comments on commit d1ed47f

Please sign in to comment.