in benchmarking/run_remote.py [0:0]
def _buildProgram(self, tempdir):
# build binary
platform = self.args.platform
program = tempdir + "/program"
if os.name == "nt":
program = program + ".exe"
elif platform.startswith("ios"):
program = program + ".ipa"
if self.prebuilt_binary:
program = self.prebuilt_binary
elif self.args.buck_target:
print("Building program with buck...")
success = buildUsingBuck(program, self.args.platform, self.args.buck_target)
if not success:
return
else:
print("Building program...")
success = buildProgramPlatform(
program,
self.args.repo_dir,
self.args.framework,
self.args.frameworks_dir,
self.args.platform,
)
if not success:
return
# upload all files under the fname directory
filedir = os.path.dirname(program)
allfiles = []
if os.path.exists(filedir):
if self.prebuilt_binary:
allfiles = [program]
else:
allfiles = [
os.path.join(filedir, f)
for f in os.listdir(filedir)
if os.path.isfile(os.path.join(filedir, f))
]
for fn in allfiles:
filename, _ = self.file_handler.uploadFile(fn, None, None, False)
getLogger().info("program: {}".format(filename))
self.filenames[os.path.basename(fn)] = filename
# main program needs to be in
self.filenames["program"] = self.filenames[os.path.basename(program)]
else:
self.filenames["program"] = program