Skip to content
Snippets Groups Projects
Commit 985e0c64 authored by akwizgran's avatar akwizgran
Browse files

Don't clobber built jar when downloading reference jar.

parent b6d31c37
No related branches found
No related tags found
1 merge request!11Simplify zip paths, update Go and NDK
......@@ -3,8 +3,8 @@ import os, shutil
from glob import glob
from subprocess import check_call
from utils import get_build_versions, ex, get_sha256, zip_files, get_final_file_name, \
get_sources_file_name, get_pom_file_name, reset_time, get_version_number, check_go_version, \
from utils import get_build_versions, ex, get_sha256, zip_files, get_final_file_path, \
get_sources_file_path, get_pom_file_path, reset_time, get_version_number, check_go_version, \
get_version_and_tool, get_output_dir, get_platform_output_dir, GO_PATH, GO_ROOT, NDK_DIR
......@@ -193,7 +193,7 @@ def package_windows(tool, versions):
def package(tool, versions, file_list, platform):
zip_file = get_final_file_name(tool, versions, platform)
zip_file = get_final_file_path(tool, versions, platform)
zip_files(file_list, zip_file, versions)
create_sources_jar(tool, versions, platform)
create_pom_file(tool, versions, platform)
......@@ -215,19 +215,18 @@ def create_sources_jar(tool, versions, platform):
for file in glob(os.path.join(repo_dir, '*')):
reset_time(file, versions)
jar_files.append(os.path.relpath(file, repo_dir))
jar_path = get_sources_file_name(tool, versions, platform)
jar_path = get_sources_file_path(tool, versions, platform)
check_call(['jar', 'cf', jar_path] + jar_files, cwd=repo_dir)
def create_pom_file(tool, versions, platform):
tool_version = get_version_number(versions)
pom_file = get_pom_file_name(tool, versions, platform)
pom_file = get_pom_file_path(tool, versions, platform)
template = 'template-%s-%s.pom' % (tool, platform)
with open(template, 'rt') as infile:
with open(pom_file, 'wt') as outfile:
for line in infile:
outfile.write(line.replace('VERSION', tool_version))
return pom_file
if __name__ == "__main__":
......
......@@ -76,23 +76,23 @@ def get_version_number(versions):
return versions['tag']
def get_output_file(tool, versions, platform, suffix):
def get_output_file_path(tool, versions, platform, suffix):
output_dir = get_platform_output_dir(tool, platform)
version = get_version_number(versions)
filename = '%s-%s-%s%s' % (tool, platform, version, suffix)
return os.path.join(output_dir, filename)
def get_final_file_name(tool, versions, platform):
return get_output_file(tool, versions, platform, '.jar')
def get_final_file_path(tool, versions, platform):
return get_output_file_path(tool, versions, platform, '.jar')
def get_sources_file_name(tool, versions, platform):
return get_output_file(tool, versions, platform, '-sources.jar')
def get_sources_file_path(tool, versions, platform):
return get_output_file_path(tool, versions, platform, '-sources.jar')
def get_pom_file_name(tool, versions, platform):
return get_output_file(tool, versions, platform, '.pom')
def get_pom_file_path(tool, versions, platform):
return get_output_file_path(tool, versions, platform, '.pom')
def get_output_dir(tool):
......
......@@ -3,7 +3,7 @@ import os
import sys
from subprocess import check_call, CalledProcessError
from utils import get_sha256, fail, get_build_versions, get_final_file_name, \
from utils import get_sha256, fail, get_build_versions, get_final_file_path, \
get_version_and_tool, get_version_number
......@@ -25,7 +25,7 @@ def verify(tool, command_line_version, platform):
tool_version, versions = get_build_versions(tool, command_line_version)
# download reference binary
file_name = get_final_file_name(tool, versions, platform)
file_name = os.path.basename(get_final_file_path(tool, versions, platform))
os.makedirs('reference', exist_ok=True)
reference_file_name = os.path.join('reference', file_name)
# try downloading from maven central
......@@ -58,7 +58,7 @@ def verify(tool, command_line_version, platform):
def get_url(tool, versions, platform):
version = get_version_number(versions)
directory = "%s-%s" % (tool, platform)
file = get_final_file_name(tool, versions, platform)
file = os.path.basename(get_final_file_path(tool, versions, platform))
return "https://repo.maven.apache.org/maven2/org/briarproject/%s/%s/%s" % (directory, version, file)
......
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