Skip to content

Commit

Permalink
Merge pull request #661 from mendix/DEP-5242_mendix_10_mpk_support_4.x
Browse files Browse the repository at this point in the history
Support Mendix10 MPK builds
  • Loading branch information
sailhenz authored Jun 30, 2023
2 parents e41168c + 8457082 commit ad86923
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
4 changes: 3 additions & 1 deletion buildpack/core/mono.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ def ensure_and_get_mono(mx_version, buildpack_dir, cache_dir):
)
return mono_location
else:
version = get_dependency(dependency_name, buildpack_dir)["version"]
version = get_dependency(dependency_name, buildpack_dir=buildpack_dir)[
"version"
]
try:
mono_location = _get_mono_path("/tmp/opt", version)
except NotFoundException:
Expand Down
10 changes: 9 additions & 1 deletion buildpack/core/mxbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,25 @@ def build_from_source(

util.lazy_remove_file(BUILD_ERRORS_JSON)

args = [
build_command = [
os.path.join(mono_location, "bin/mono"),
"--config",
os.path.join(mono_location, "etc/mono/config"),
os.path.join(mxbuild_location, "modeler/mxbuild.exe"),
]

if runtime_version >= 10: # mx10 support
build_command = [os.path.join(mxbuild_location, "modeler/mxbuild")]

parameters = [
"--target=package",
"--output=/tmp/model.mda",
f"--java-home={jdk_location}",
f"--java-exe-path={os.path.join(jdk_location, 'bin/java')}",
]

args = build_command + parameters

if runtime_version >= 6.4 or os.environ.get("FORCE_WRITE_BUILD_ERRORS"):
args.append(f"--write-errors={BUILD_ERRORS_JSON}")
logging.debug("Will write build errors to %s", BUILD_ERRORS_JSON)
Expand Down
1 change: 1 addition & 0 deletions buildpack/stage.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ def cleanup_dependency_cache(cached_dir, dependency_list):
runtime_version,
JAVA_VERSION,
)
copy_dependency_file() # dependency file was deleted after mpk build process
except RuntimeError as error:
logging.error(error)
sys.exit(1)
Expand Down

0 comments on commit ad86923

Please sign in to comment.