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

Use create_sources_jar() from utils.py for macOS

parent a115b134
No related branches found
No related tags found
1 merge request!30Use create_sources_jar() from utils.py for macOS
Pipeline #14879 passed with warnings
......@@ -5,7 +5,7 @@ from subprocess import check_call
import hashlib
import utils
from utils import get_version, get_build_versions, reset_time, \
from utils import get_version, get_build_versions, reset_time, create_sources_jar \
get_sources_file_name, get_output_dir, get_sha256, pack, create_pom_file
from pathlib import Path
import tarfile
......@@ -34,7 +34,7 @@ def setup():
check_call(['git', 'submodule', 'update'], cwd=Path(BUILD_DIR))
# create sources jar before building
jar_name = create_sources_jar(versions)
jar_name = create_sources_jar(versions, PLATFORM)
return versions, jar_name
......@@ -95,29 +95,6 @@ def package_macos(versions, jar_name):
sha256hash = get_sha256(file)
print("%s: %s" % (file, sha256hash))
def create_sources_jar(versions):
output_dir = get_output_dir(PLATFORM)
jar_files = []
for root, dir_names, filenames in os.walk(BUILD_DIR):
for f in filenames:
if '/.git' in root:
continue
jar_files.append(os.path.join(root, f))
for file in jar_files:
reset_time(file, versions)
jar_name = get_sources_file_name(versions, PLATFORM)
jar_path = os.path.abspath(jar_name)
rel_paths = [os.path.relpath(f, BUILD_DIR) for f in sorted(jar_files)]
# create jar archive with first files
jar_step = 5000
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
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)
return jar_name
def compare_output_with_upstream(versions):
compare_with_upstream(versions, "aarch64")
compare_with_upstream(versions, "x86_64")
......
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