1
1
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
2
2
import (" //build/toolchain/cc_wrapper.gni" )
3
3
import (" //build_extra/rust/rust.gni" )
4
- import (" //third_party/v8/gni/snapshot_toolchain.gni" )
5
- import (" //third_party/v8/gni/v8.gni" )
6
- import (" deno.gni" )
7
4
8
5
main_extern = [
9
6
{
10
7
label = " ../core:deno"
11
8
crate_name = " deno"
12
9
crate_type = " rlib"
13
10
},
11
+ {
12
+ label = " ../cli_snapshots:deno_cli_snapshots"
13
+ crate_name = " deno_cli_snapshots"
14
+ crate_type = " rlib"
15
+ },
14
16
{
15
17
label = " $rust_build :serde_derive"
16
18
crate_name = " serde_derive"
@@ -60,109 +62,6 @@ if (is_posix) {
60
62
main_extern_rlib += [ " nix" ]
61
63
}
62
64
63
- ts_sources = [
64
- " ../js/base64.ts" ,
65
- " ../js/blob.ts" ,
66
- " ../js/body.ts" ,
67
- " ../js/buffer.ts" ,
68
- " ../js/build.ts" ,
69
- " ../js/chmod.ts" ,
70
- " ../js/chown.ts" ,
71
- " ../js/colors.ts" ,
72
- " ../js/compiler.ts" ,
73
- " ../js/console.ts" ,
74
- " ../js/console_table.ts" ,
75
- " ../js/copy_file.ts" ,
76
- " ../js/core.ts" ,
77
- " ../js/custom_event.ts" ,
78
- " ../js/deno.ts" ,
79
- " ../js/diagnostics.ts" ,
80
- " ../js/dir.ts" ,
81
- " ../js/dispatch.ts" ,
82
- " ../js/dispatch_json.ts" ,
83
- " ../js/dispatch_minimal.ts" ,
84
- " ../js/dom_file.ts" ,
85
- " ../js/dom_types.ts" ,
86
- " ../js/dom_util.ts" ,
87
- " ../js/error_stack.ts" ,
88
- " ../js/errors.ts" ,
89
- " ../js/event.ts" ,
90
- " ../js/event_target.ts" ,
91
- " ../js/fetch.ts" ,
92
- " ../js/file_info.ts" ,
93
- " ../js/files.ts" ,
94
- " ../js/form_data.ts" ,
95
- " ../js/format_error.ts" ,
96
- " ../js/get_random_values.ts" ,
97
- " ../js/globals.ts" ,
98
- " ../js/headers.ts" ,
99
- " ../js/io.ts" ,
100
- " ../js/lib.deno_runtime.d.ts" ,
101
- " ../js/lib.web_assembly.d.ts" ,
102
- " ../js/link.ts" ,
103
- " ../js/location.ts" ,
104
- " ../js/main.ts" ,
105
- " ../js/make_temp_dir.ts" ,
106
- " ../js/metrics.ts" ,
107
- " ../js/mkdir.ts" ,
108
- " ../js/mock_builtin.js" ,
109
- " ../js/net.ts" ,
110
- " ../js/os.ts" ,
111
- " ../js/performance.ts" ,
112
- " ../js/permissions.ts" ,
113
- " ../js/plugins.d.ts" ,
114
- " ../js/process.ts" ,
115
- " ../js/read_dir.ts" ,
116
- " ../js/read_file.ts" ,
117
- " ../js/read_link.ts" ,
118
- " ../js/remove.ts" ,
119
- " ../js/rename.ts" ,
120
- " ../js/repl.ts" ,
121
- " ../js/request.ts" ,
122
- " ../js/resources.ts" ,
123
- " ../js/stat.ts" ,
124
- " ../js/symlink.ts" ,
125
- " ../js/text_encoding.ts" ,
126
- " ../js/timers.ts" ,
127
- " ../js/truncate.ts" ,
128
- " ../js/type_directives.ts" ,
129
- " ../js/types.ts" ,
130
- " ../js/url.ts" ,
131
- " ../js/url_search_params.ts" ,
132
- " ../js/util.ts" ,
133
- " ../js/utime.ts" ,
134
- " ../js/version.ts" ,
135
- " ../js/window.ts" ,
136
- " ../js/workers.ts" ,
137
- " ../js/write_file.ts" ,
138
- " ../js/xeval.ts" ,
139
- " ../tsconfig.json" ,
140
-
141
- # Listing package.json and yarn.lock as sources ensures the bundle is rebuilt
142
- # when npm packages are added/removed or their contents changes.
143
- " ../package.json" ,
144
- " ../third_party/yarn.lock" ,
145
- ]
146
-
147
- # When Cargo is driving the build, GN/Ninja are used to produce these non-Rust
148
- # targets. Cargo handles all Rust source files and the final linking step.
149
- group (" deno_deps" ) {
150
- deps = [
151
- " :snapshot_compiler" ,
152
- " :snapshot_deno" ,
153
- ]
154
- }
155
-
156
- # Optimized dependencies for cross compiled builds.
157
- # This can be removed once we get snapshots into cross compiled builds.
158
- group (" deno_deps_cross" ) {
159
- testonly = true
160
- deps = [
161
- " :compiler_bundle" ,
162
- " :main_bundle" ,
163
- ]
164
- }
165
-
166
65
# Reads the cargo info from Cargo.toml
167
66
deno_cargo_info = exec_script (" ../build_extra/rust/get_cargo_info.py" ,
168
67
[ rebase_path (" Cargo.toml" , root_build_dir ) ],
@@ -172,9 +71,6 @@ rust_executable("deno") {
172
71
source_root = " main.rs"
173
72
extern = main_extern
174
73
extern_rlib = main_extern_rlib
175
- deps = [
176
- " :deno_deps" ,
177
- ]
178
74
179
75
# Extract version from Cargo.toml
180
76
# TODO integrate this into rust.gni by allowing the rust_executable template
@@ -189,41 +85,10 @@ rust_test("cli_test") {
189
85
source_root = " main.rs"
190
86
extern = main_extern
191
87
extern_rlib = main_extern_rlib
192
- deps = [
193
- " :deno_deps" ,
194
- ]
195
88
196
89
# Extract version from Cargo.toml
197
90
inputs = [
198
91
" Cargo.toml" ,
199
92
]
200
93
env = [ " CARGO_PKG_VERSION=${ deno_cargo_info.version } " ]
201
94
}
202
-
203
- bundle (" main_bundle" ) {
204
- sources = ts_sources
205
- out_dir = " $target_gen_dir /bundle/"
206
- out_name = " main"
207
- }
208
-
209
- bundle (" compiler_bundle" ) {
210
- sources = ts_sources
211
- out_dir = " $target_gen_dir /bundle/"
212
- out_name = " compiler"
213
- }
214
-
215
- # Generates $target_gen_dir/snapshot_deno.bin
216
- snapshot (" snapshot_deno" ) {
217
- source_root = " $target_gen_dir /bundle/main.js"
218
- deps = [
219
- " :main_bundle" ,
220
- ]
221
- }
222
-
223
- # Generates $target_gen_dir/snapshot_compiler.bin
224
- snapshot (" snapshot_compiler" ) {
225
- source_root = " $target_gen_dir /bundle/compiler.js"
226
- deps = [
227
- " :compiler_bundle" ,
228
- ]
229
- }
0 commit comments