Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ardublockly
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ardublockly
Commits
7cc0b42c
Commit
7cc0b42c
authored
Nov 15, 2015
by
Immortalin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed code order
parent
9a69dff3
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
29 deletions
+22
-29
build.py
build.py
+22
-29
No files found.
build.py
View file @
7cc0b42c
...
...
@@ -75,32 +75,8 @@ class Gen_uncompressed(threading.Thread):
self
.
search_paths
=
search_paths
def
run
(
self
):
target_filename
=
"blockly_uncompressed.js"
add_dependency
=
[]
base_path
=
calcdeps
.
FindClosureBasePath
(
self
.
search_paths
)
deps
=
calcdeps
.
BuildDependenciesFromFiles
(
self
.
search_paths
)
filenames
=
calcdeps
.
CalculateDependencies
(
self
.
search_paths
,
[
os
.
path
.
join
(
"core"
,
"blockly.js"
)])
for
dep
in
deps
:
if
dep
.
filename
in
filenames
:
add_dependency
.
append
(
calcdeps
.
GetDepsLine
(
dep
,
base_path
))
add_dependency
=
"
\n
"
.
join
(
add_dependency
)
# Find the Blockly directory name and replace it with a JS variable.
# This allows blockly_uncompressed.js to be compiled on one computer and be
# used on another, even if the directory name differs.
m
=
re
.
search
(
"[
\\
/]([^
\\
/]+)[
\\
/]core[
\\
/]blockly.js"
,
add_dependency
)
add_dependency
=
re
.
sub
(
"([
\\
/])"
+
re
.
escape
(
m
.
group
(
1
))
+
"([
\\
/]core[
\\
/])"
,
'
\\
1" + dir + "
\\
2'
,
add_dependency
)
provides
=
[]
for
dep
in
deps
:
if
dep
.
filename
in
filenames
:
if
not
dep
.
filename
.
startswith
(
os
.
pardir
+
os
.
sep
):
# "../"
provides
.
extend
(
dep
.
provides
)
provides
.
sort
()
f
=
open
(
target_filename
,
"w"
)
target_filename
=
'blockly_uncompressed.js'
f
=
open
(
target_filename
,
'w'
)
f
.
write
(
HEADER
)
f
.
write
(
"""
var isNodeJS = !!(typeof module !== 'undefined' && module.exports);
...
...
@@ -141,9 +117,26 @@ window.BLOCKLY_BOOT = function() {
dir = window.BLOCKLY_DIR.match(/[^
\\
/]+$/)[0];
}
"""
)
f
.
write
(
add_dependency
+
"
\n
"
)
f
.
write
(
"
\n
"
)
f
.
write
(
"// Load Blockly.
\n
"
)
add_dependency
=
[]
base_path
=
calcdeps
.
FindClosureBasePath
(
self
.
search_paths
)
for
dep
in
calcdeps
.
BuildDependenciesFromFiles
(
self
.
search_paths
):
add_dependency
.
append
(
calcdeps
.
GetDepsLine
(
dep
,
base_path
))
add_dependency
=
'
\n
'
.
join
(
add_dependency
)
# Find the Blockly directory name and replace it with a JS variable.
# This allows blockly_uncompressed.js to be compiled on one computer and be
# used on another, even if the directory name differs.
m
=
re
.
search
(
'[
\\
/]([^
\\
/]+)[
\\
/]core[
\\
/]blockly.js'
,
add_dependency
)
add_dependency
=
re
.
sub
(
'([
\\
/])'
+
re
.
escape
(
m
.
group
(
1
))
+
'([
\\
/]core[
\\
/])'
,
'
\\
1" + dir + "
\\
2'
,
add_dependency
)
f
.
write
(
add_dependency
+
'
\n
'
)
provides
=
[]
for
dep
in
calcdeps
.
BuildDependenciesFromFiles
(
self
.
search_paths
):
if
not
dep
.
filename
.
startswith
(
os
.
pardir
+
os
.
sep
):
# '../'
provides
.
extend
(
dep
.
provides
)
provides
.
sort
()
f
.
write
(
'
\n
'
)
f
.
write
(
'// Load Blockly.
\n
'
)
for
provide
in
provides
:
f
.
write
(
"goog.require('%s');
\n
"
%
provide
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment