Skip to content
Snippets Groups Projects
Verified Commit b741fa9f authored by Sebastian's avatar Sebastian
Browse files

Fix problem with different values of BUILD_DIR in create_sources_jar()

parent a36fff2d
No related branches found
No related tags found
1 merge request!32Fix problem with different values of BUILD_DIR in create_sources_jar()
Pipeline #14887 passed with warnings
...@@ -34,7 +34,7 @@ def setup(): ...@@ -34,7 +34,7 @@ def setup():
check_call(['git', 'submodule', 'update'], cwd=Path(BUILD_DIR)) check_call(['git', 'submodule', 'update'], cwd=Path(BUILD_DIR))
# create sources jar before building # create sources jar before building
jar_name = create_sources_jar(versions, PLATFORM) jar_name = create_sources_jar(versions, PLATFORM, BUILD_DIR)
return versions, jar_name return versions, jar_name
......
...@@ -74,7 +74,7 @@ def setup(platform): ...@@ -74,7 +74,7 @@ def setup(platform):
prepare_repos(versions) prepare_repos(versions)
# create sources jar before building # create sources jar before building
jar_name = create_sources_jar(versions, platform) jar_name = create_sources_jar(versions, platform, BUILD_DIR)
return versions, jar_name return versions, jar_name
...@@ -183,10 +183,10 @@ def reset_time(filename, versions): ...@@ -183,10 +183,10 @@ def reset_time(filename, versions):
check_call(['touch', '--no-dereference', '-t', versions['timestamp'], filename]) check_call(['touch', '--no-dereference', '-t', versions['timestamp'], filename])
def create_sources_jar(versions, platform): def create_sources_jar(versions, platform, build_dir):
output_dir = get_output_dir(platform) output_dir = get_output_dir(platform)
jar_files = [] jar_files = []
for root, dir_names, filenames in os.walk(BUILD_DIR): for root, dir_names, filenames in os.walk(build_dir):
for f in filenames: for f in filenames:
if '/.git' in root: if '/.git' in root:
continue continue
...@@ -195,13 +195,13 @@ def create_sources_jar(versions, platform): ...@@ -195,13 +195,13 @@ def create_sources_jar(versions, platform):
reset_time(file, versions) reset_time(file, versions)
jar_name = get_sources_file_name(versions, platform) jar_name = get_sources_file_name(versions, platform)
jar_path = os.path.abspath(jar_name) jar_path = os.path.abspath(jar_name)
rel_paths = [os.path.relpath(f, BUILD_DIR) for f in sorted(jar_files)] rel_paths = [os.path.relpath(f, build_dir) for f in sorted(jar_files)]
# create jar archive with first files # create jar archive with first files
jar_step = 5000 jar_step = 5000
check_call(['jar', 'cf', jar_path] + rel_paths[0:jar_step], cwd=BUILD_DIR) check_call(['jar', 'cf', jar_path] + rel_paths[0:jar_step], cwd=build_dir)
# add subsequent files in steps, because the command line can't handle all at once # add subsequent files in steps, because the command line can't handle all at once
for i in range(jar_step, len(rel_paths), jar_step): for i in range(jar_step, len(rel_paths), jar_step):
check_call(['jar', 'uf', jar_path] + rel_paths[i:i + jar_step], cwd=BUILD_DIR) check_call(['jar', 'uf', jar_path] + rel_paths[i:i + jar_step], cwd=build_dir)
return jar_name return jar_name
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment