MCPcopy Create free account
hub / github.com/defold/defold / create_standalone_editor_jar

Function create_standalone_editor_jar

editor/scripts/bundle.py:509–533  ·  view source on GitHub ↗

Build the platform-specific standalone editor jar. This replaces the old `lein zip-parallel uberjar` task. Since the parallel zip code now runs as a normal Clojure namespace instead of a Leiningen task, the Python build coordinates the few pieces the task previously handled: build t

(jdk, platform)

Source from the content-addressed store, hash-verified

507
508
509def create_standalone_editor_jar(jdk, platform):
510 """Build the platform-specific standalone editor jar.
511
512 This replaces the old `lein zip-parallel uberjar` task. Since the parallel
513 zip code now runs as a normal Clojure namespace instead of a Leiningen task,
514 the Python build coordinates the few pieces the task previously handled:
515 build the project jar, read merged `project.clj` settings, resolve
516 dependency jars, and pass them to the zip writer.
517 """
518 profile = 'release,%s,uberjar' % platform
519 log("Creating uberjar for platform %s..." % platform)
520 jar_output = invoke_lein(['with-profile', profile, 'jar'], jdk_path=jdk)
521 jar_output_match = re.search(r'Created (.*\.jar)', jar_output)
522 if not jar_output_match:
523 raise Exception("Unable to determine editor jar from Leiningen output:\n%s" % jar_output)
524 project_jar = jar_output_match.group(1)
525 standalone_jar = path.join('target', parse_lein_string(read_merged_project_value(profile, ':uberjar-name', jdk)))
526 exclusions = parse_lein_regexes(read_merged_project_value(profile, ':uberjar-exclusions', jdk))
527 exclusions_file = 'target/parallel-uberjar-exclusions.edn'
528 with open(exclusions_file, 'w') as f:
529 json.dump(exclusions, f)
530 classpath = invoke_lein(['with-profile', 'release,%s' % platform, 'classpath'], jdk_path=jdk)
531 jars = [project_jar] + [jar_path for jar_path in classpath.split(os.pathsep) if jar_path.endswith('.jar')]
532 invoke_zip_parallel(['create-standalone-jar', standalone_jar, exclusions_file] + jars, jdk_path=jdk)
533 return standalone_jar
534
535
536def create_bundle(jdk, platform, options):

Callers 1

create_bundleFunction · 0.85

Calls 8

invoke_leinFunction · 0.85
parse_lein_stringFunction · 0.85
parse_lein_regexesFunction · 0.85
invoke_zip_parallelFunction · 0.85
dumpMethod · 0.80
logFunction · 0.70
splitMethod · 0.65

Tested by

no test coverage detected