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

Function create_dmg

editor/scripts/bundle.py:654–683  ·  view source on GitHub ↗
(bundle_dir, options, platform)

Source from the content-addressed store, hash-verified

652 return matches
653
654def create_dmg(bundle_dir, options, platform):
655 # setup
656 dmg_dir = os.path.join("build", "dmg")
657 rmtree(dmg_dir)
658 mkdirs(dmg_dir)
659
660 # create file tree for the .dmg
661 # It's important to use symlinks=True, otherwise notarization will fail
662 # since copytree will resolve them while copying (making them no longer
663 # signed)
664 shutil.copytree(bundle_dir, '%s/Defold.app' % dmg_dir, symlinks=True)
665 shutil.copy('bundle-resources/dmg_ds_store', '%s/.DS_Store' % dmg_dir)
666 shutil.copytree('bundle-resources/dmg_background', '%s/.background' % dmg_dir)
667 run.command(['ln', '-sf', '/Applications', '%s/Applications' % dmg_dir])
668
669 # create dmg
670 dmg_file = os.path.join("target/editor", "Defold-%s.dmg" % platform)
671 if os.path.exists(dmg_file):
672 os.remove(dmg_file)
673 run.command(['hdiutil', 'create', '-fs', 'JHFS+', '-volname', 'Defold', '-srcfolder', dmg_dir, dmg_file])
674
675 # sign the dmg
676 if not options.skip_codesign:
677 certificate = mac_certificate(options.codesigning_identity)
678 if certificate is None:
679 error("Codesigning certificate not found for signing identity %s" % (options.codesigning_identity))
680 sys.exit(1)
681
682 run.command(['codesign', '-s', certificate, dmg_file])
683 notarize_dmg(dmg_file, options)
684
685def notarization_status(uuid, notarization_username, notarization_password, notarization_team_id = None):
686 args = ['xcrun', 'notarytool', 'info',

Callers 1

create_bundleFunction · 0.85

Calls 10

rmtreeFunction · 0.85
mkdirsFunction · 0.85
mac_certificateFunction · 0.85
notarize_dmgFunction · 0.85
commandMethod · 0.80
exitMethod · 0.80
existsMethod · 0.65
removeMethod · 0.65
errorFunction · 0.50
copyMethod · 0.45

Tested by

no test coverage detected