forked from AtomicGameEngine/AtomicGameEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBuildLinux.js
More file actions
executable file
·144 lines (93 loc) · 3.98 KB
/
BuildLinux.js
File metadata and controls
executable file
·144 lines (93 loc) · 3.98 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
var fs = require('fs-extra');
var path = require("path");
var host = require("./Host");
var config = require("./BuildConfig");
var buildTasks = require("./BuildTasks");
var atomicRoot = config.atomicRoot;
var buildDir = config.artifactsRoot + "Build/Linux/";
var editorAppFolder = config.artifactsRoot + "AtomicEditor/";
function copyAtomicNET() {
if (!config["with-atomicnet"])
return;
fs.copySync(atomicRoot + "Artifacts/AtomicNET/" + config["config"],
editorAppFolder + "Resources/ToolData/AtomicNET/" + config["config"]);
fs.copySync(atomicRoot + "Script/AtomicNET/AtomicProject.json",
editorAppFolder + "Resources/ToolData/AtomicNET/Build/Projects/AtomicProject.json");
}
function copyAtomicEditor() {
// Copy the Editor binaries
fs.copySync(buildDir + "Source/AtomicEditor/AtomicEditor",
config.artifactsRoot + "AtomicEditor/AtomicEditor");
// We need some resources to run
fs.copySync(atomicRoot + "Resources/CoreData",
editorAppFolder + "Resources/CoreData");
fs.copySync(atomicRoot + "Resources/PlayerData",
editorAppFolder + "Resources/PlayerData");
fs.copySync(atomicRoot + "Data/AtomicEditor",
editorAppFolder + "Resources/ToolData");
fs.copySync(atomicRoot + "Resources/EditorData",
editorAppFolder + "Resources/EditorData");
fs.copySync(atomicRoot + "Artifacts/Build/Resources/EditorData/AtomicEditor/EditorScripts",
editorAppFolder + "Resources/EditorData/AtomicEditor/EditorScripts");
fs.copySync(buildDir + "Source/AtomicPlayer/Application/AtomicPlayer",
editorAppFolder + "Resources/ToolData/Deployment/Linux/AtomicPlayer");
var binaryFiles = ["chrome-sandbox", "libcef.so", "natives_blob.bin", "snapshot_blob.bin"];
var resourceFiles = ["cef.pak",
"cef_100_percent.pak",
"cef_200_percent.pak",
"cef_extensions.pak",
"devtools_resources.pak",
"icudtl.dat",
"locales"];
for (var i = 0; i < binaryFiles.length; i++) {
fs.copySync(atomicRoot + "Submodules/CEF/Linux/Release/" + binaryFiles[i], editorAppFolder+"/" + binaryFiles[i]);
}
for (var i = 0; i < resourceFiles.length; i++) {
fs.copySync(atomicRoot + "Submodules/CEF/Linux/Resources/" + resourceFiles[i], editorAppFolder+"/" + resourceFiles[i]);
}
copyAtomicNET();
}
namespace('build', function() {
task('atomiceditor_phase2', {
async: true
}, function() {
process.chdir(buildDir);
var cmds = ["make AtomicEditor AtomicPlayer -j2"];
jake.exec(cmds, function() {
copyAtomicEditor();
if (config.package) {
jake.Task['package:linux_editor'].invoke();
}
complete();
}, {
printStdout: true
});
});
// Builds a standalone Atomic Editor, which can be distributed out of build tree
task('atomiceditor', {
async: true
}, function() {
// Always cleanly create the editor target folder
host.cleanCreateDir(editorAppFolder);
// We clean atomicNET here as otherwise platform binaries would be deleted
var createDirs = [config.artifactsRoot + "AtomicNET/", buildDir, host.getGenScriptRootDir()];
var removeDirs = [config.artifactsRoot + "Build/Android/"];
host.setupDirs(!config.noclean, createDirs, removeDirs);
process.chdir(buildDir);
var cmds = [];
// Generate Atomic solution, AtomicTool binary, and script bindings
cmds.push("cmake ../../../ -DATOMIC_DEV_BUILD=0 -DCMAKE_BUILD_TYPE=" + config["config"]);
cmds.push("make AtomicNETNative -j2")
jake.exec(cmds, function() {
var rootTask = jake.Task['build:atomiceditor_phase2'];
buildTasks.installBuildTasks(rootTask);
rootTask.addListener('complete', function () {
complete();
});
rootTask.invoke();
}, {
printStdout: true,
printStderr: true
});
});
});// end of build namespace