-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathBuildXmlFiles.sbsl
48 lines (38 loc) · 1.24 KB
/
BuildXmlFiles.sbsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#required Common/Path.sbsl
#required Common/Zip.sbsl
#required Common/Logger.sbsl
method Script(CliPath: String, ProjectPath: String, DestinationFolder: String = "", ArchiveName: String = "")
if not Path.Exists(CliPath)
Logger.e("Couldn't find edt cli executable: %CliPath")
;
if not Path.Exists(ProjectPath)
Logger.e("Couldn't find project folder: %ProjectPath")
;
if DestinationFolder == ""
DestinationFolder = new File(ProjectPath).Path
;
if not Path.Exists(DestinationFolder)
Logger.e("Couldn't find build destination folder: %DestinationFolder")
;
if ArchiveName == ""
ArchiveName = new File(ProjectPath).Name
;
val DataPath = Files.CreateTempDirectory()
val BuildPath = Files.CreateTempDirectory()
val Args = [
"-data",
DataPath,
"-command",
"export",
"--project",
ProjectPath,
"--configuration-files",
BuildPath
]
val EdtCli = new OsProcess(CliPath, Args, True)
EdtCli.Start()
EdtCli.WaitForCompletion()
val ZipPath = Path.Join(DestinationFolder, "%ArchiveName.zip")
Zip.CreateFromDirectory(BuildPath.Path, ZipPath)
Logger.i("Zipped project path: ${ZipPath}")
;