Skip to content

Commit

Permalink
Added script for packaging executables generated from Unity
Browse files Browse the repository at this point in the history
  • Loading branch information
Winter-Guerra committed Aug 15, 2018
1 parent 051c2f0 commit f8cce66
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions packageFlightgogglesExecutables.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
import os.path as path
import fire

# Usage: ./packageFlightgogglesExecutables.sh /media/medusa/BCAE9765AE9716CC/FlightGogglesStaging/ v1.5.4-rc1
# Will package EXEs that have the form FlightGogglesStaging/v1.5.4-rc1/<platform>
# Usage: ./packageFlightgogglesExecutables.sh /media/medusa/BCAE9765AE9716CC/FlightGogglesStaging/v1.5.6/

def packageFlightgogglesExecutables(base_dir="/media/medusa/BCAE9765AE9716CC/FlightGogglesStaging/", version="v1.5.6"):
# Find directory for the executable version
sourceDir = path.expanduser(path.join(base_dir, version))

def packageFlightgogglesExecutables(base_dir, version):
platformFolders = ["Linux64", "macOS", "Windows64"]

# Unity builder uses different conventions for the platform folder and the platform name in the linux executable
Expand All @@ -17,18 +19,10 @@ def packageFlightgogglesExecutables(base_dir, version):
for platform in platformFolders:
# Get platform string to use in tarball
platformStringForTarball = platformExecutableLookup.get(platform, platform)
platformFolder = path.join(base_dir, version, platform)

print "" # newline

print "Packing platform %s at folder %s" % (platform, platformFolder)


# Check that this folder exists
if not path.exists(platformFolder):
print "WARNING: Platform folder %s does not exist. Skipping." % platformFolder
continue
print "Packing platform: %s" % platform

platformFolder = path.join(sourceDir, platform)
tarballName = "FlightGoggles_%s_%s.tar.gz" % (version, platformStringForTarball)
tarballPath = path.join(platformFolder, tarballName)

Expand All @@ -39,12 +33,7 @@ def packageFlightgogglesExecutables(base_dir, version):
print "Finished compressing %s" % tarballName

# Move tarball to the base_dir
destinationTarballName = path.join(base_dir, tarballName)
try:
os.remove(destinationTarballName)
except OSError:
pass
shutil.move(tarballPath, base_dir)
shutil.move(tarballPath, sourceDir)



Expand Down

0 comments on commit f8cce66

Please sign in to comment.