Skip to content

Commit

Permalink
Made script non-UNIX specific by using python-based pathing
Browse files Browse the repository at this point in the history
  • Loading branch information
jormundur00 committed Sep 20, 2024
1 parent abf3bd2 commit 5a55859
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions vm/tests/gh_workflows/NILayerTests/build_layer.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ def generate_matrix(path_to_data):
'''
Generates a matrix in the format of GAV coordinate pairs for GitHub actions.
'''
with open(f'{path_to_data}/popular-maven-libraries.json', 'r') as f:
with open(os.path.join(path_to_data,'popular-maven-libraries.json'), 'r') as f:
data = json.load(f)
with open(f'{path_to_data}/excluded-libraries.json', 'r') as f:
with open(os.path.join(path_to_data, 'exclude-file.json'), 'r') as f:
exclude_data = json.load(f)
matrix = {'coordinates': []}
found_first = False
Expand Down Expand Up @@ -50,9 +50,9 @@ def build_layer(gav, native_image_path):
subprocess.call(f'mvn dependency:get -Dartifact={gav} -Dtransitive=true', shell=True)

home_path = str(Path.home())
library_path = f'{home_path}/.m2/repository/{group_id.replace('.','/')}/{artifact_id}/{version}'
jar_path = f'{library_path}/{artifact_id}-{version}.jar'
subprocess.call(f'cp {library_path}/{artifact_id}-{version}.pom {library_path}/pom.xml', shell=True)
library_path = os.path.join(home_path, '.m2', 'repository', group_id.replace('.','/'), artifact_id, version)
jar_path = os.path.join(library_path, f'{artifact_id}-{version}.jar')
subprocess.call(f'cp {os.path.join(library_path, f'{artifact_id}-{version}.pom')} {os.path.join({library_path}, 'pom.xml')}', shell=True)
if Path(library_path).exists():
subprocess.call(f'mkdir {gav}', shell=True)
os.chdir(gav)
Expand Down

0 comments on commit 5a55859

Please sign in to comment.