Skip to content

Commit 6d3d3dc

Browse files
committed
Fixing blocking issues for next release.
Fixed #181, #182 and automated tests. This versions shows also mDNS informations if avalible, this will be used for an better integration for upcomming modes. The messenger / console integration makes no sense for all modes which are using any transpiler like Coofescript, Python, Pencil Code, .... To support such transpilers we would need to write specific wraper for each of them.
1 parent 0d9e1f5 commit 6d3d3dc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+420
-3268
lines changed

app/chrome_app/background.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,19 @@ chrome.app.runtime.onLaunched.addListener(
5151
Math.round((screenWidth - editorWidth) / 2),
5252
Math.round((screenHeight - editorHeight) / 2)
5353
);
54-
editor.drawAttention();
55-
editor.contentWindow.addEventListener('load', function() {
56-
console.log('Looking for p2p devices ...');
57-
chrome.mdns.onServiceList.addListener((data) => {
58-
console.log('Found p2p device', data);
59-
}, {
60-
serviceType: '_cros_p2p._tcp.local',
61-
});
54+
editor.contentWindow.addEventListener('load', () => {
55+
if (chrome.mdns) {
56+
let mDNS = editor.contentWindow.CWC_BUILDER.mDNS.bind(
57+
editor.contentWindow.CWC_BUILDER);
58+
chrome.mdns.onServiceList.addListener((data) => {
59+
mDNS('_cros_p2p._tcp.local', data);
60+
}, {serviceType: '_cros_p2p._tcp.local'});
61+
chrome.mdns.onServiceList.addListener((data) => {
62+
mDNS('_ssh._tcp.local', data);
63+
}, {serviceType: '_ssh._tcp.local'});
64+
}
6265
});
66+
editor.drawAttention();
6367
} else {
6468
console.warn('Loaded inside sand-boxed window!');
6569
}

app/default/js/app.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
* Decorates Coding with Chrome GUI after content is loaded and no other
33
* instance is already defined.
44
*/
5+
window['CWC_BUILDER'] = new cwc.ui.Builder();
56
window.addEventListener('load', function() {
6-
if (!window['CWC_BUILDER']) {
7-
new cwc.ui.Builder().decorate();
8-
}
7+
window['CWC_BUILDER'].decorate();
98
}, false);

build/cwc/frameworks.js

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ closureBuilder.build({
2828
name: 'cwc.framework.lego.Ev3',
2929
compress: true,
3030
srcs: glob([
31-
'src/frameworks/internal/lego/ev3/*.js',
31+
'src/frameworks/lego/ev3/*.js',
3232
]),
3333
deps: glob([
34-
'src/frameworks/internal/messenger/*.js',
34+
'src/frameworks/messenger/*.js',
3535
'src/protocol/robots/lego/ev3/*.js',
3636
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
3737
]),
@@ -46,65 +46,28 @@ closureBuilder.build({
4646
name: 'cwc.framework.lego.WeDo2',
4747
compress: true,
4848
srcs: glob([
49-
'src/frameworks/internal/lego/wedo2/*.js',
49+
'src/frameworks/lego/wedo2/*.js',
5050
]),
5151
deps: glob([
52-
'src/frameworks/internal/messenger/*.js',
52+
'src/frameworks/messenger/*.js',
5353
'src/protocol/robots/lego/wedo2/*.js',
5454
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
5555
]),
5656
out: 'genfiles/core/frameworks/internal/wedo2_framework.js',
5757
});
5858

5959

60-
/**
61-
* Python 2.x Framework
62-
*/
63-
closureBuilder.build({
64-
name: 'cwc.framework.Python2',
65-
compress: true,
66-
srcs: [
67-
'src/frameworks/internal/python/python2.js',
68-
],
69-
deps: glob([
70-
'src/utils/dialog/*',
71-
'src/utils/logger.js',
72-
]),
73-
externs: [
74-
'build/externs/i18n.js',
75-
'build/externs/skulpt.js',
76-
],
77-
out: 'genfiles/core/frameworks/internal/python2_framework.js',
78-
});
79-
80-
81-
/**
82-
* Python 3.x Framework
83-
*/
84-
closureBuilder.build({
85-
name: 'cwc.framework.Python3',
86-
compress: true,
87-
srcs: [
88-
'src/frameworks/internal/python/python3.js',
89-
],
90-
externs: [
91-
'build/externs/brython.js',
92-
],
93-
out: 'genfiles/core/frameworks/internal/python3_framework.js',
94-
});
95-
96-
9760
/**
9861
* mBot Framework
9962
*/
10063
closureBuilder.build({
10164
name: 'cwc.framework.makeblock.mBot',
10265
compress: true,
10366
srcs: glob([
104-
'src/frameworks/internal/makeblock/mbot/*.js',
67+
'src/frameworks/makeblock/mbot/*.js',
10568
]),
10669
deps: glob([
107-
'src/frameworks/internal/messenger/*.js',
70+
'src/frameworks/messenger/*.js',
10871
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
10972
]),
11073
out: 'genfiles/core/frameworks/internal/mbot_framework.js',
@@ -118,10 +81,10 @@ closureBuilder.build({
11881
name: 'cwc.framework.makeblock.mBotRanger',
11982
compress: true,
12083
srcs: glob([
121-
'src/frameworks/internal/makeblock/mbot_ranger/*.js',
84+
'src/frameworks/makeblock/mbot_ranger/*.js',
12285
]),
12386
deps: glob([
124-
'src/frameworks/internal/messenger/*.js',
87+
'src/frameworks/messenger/*.js',
12588
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
12689
]),
12790
out: 'genfiles/core/frameworks/internal/mbot_ranger_framework.js',
@@ -135,7 +98,7 @@ closureBuilder.build({
13598
name: 'cwc.framework.Messenger',
13699
compress: true,
137100
srcs: glob([
138-
'src/frameworks/internal/messenger/*.js',
101+
'src/frameworks/messenger/*.js',
139102
]),
140103
deps: glob([
141104
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
@@ -152,10 +115,10 @@ closureBuilder.build({
152115
name: 'cwc.framework.Phaser',
153116
compress: true,
154117
srcs: glob([
155-
'src/frameworks/internal/phaser/*.js',
118+
'src/frameworks/phaser/*.js',
156119
]),
157120
deps: glob([
158-
'src/frameworks/internal/messenger/*.js',
121+
'src/frameworks/messenger/*.js',
159122
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
160123
]),
161124
externs: [
@@ -165,17 +128,54 @@ closureBuilder.build({
165128
});
166129

167130

131+
/**
132+
* Python 2.x Framework
133+
*/
134+
closureBuilder.build({
135+
name: 'cwc.framework.Python2',
136+
compress: true,
137+
srcs: [
138+
'src/frameworks/python/python2.js',
139+
],
140+
deps: glob([
141+
'src/utils/dialog/*',
142+
'src/utils/logger.js',
143+
]),
144+
externs: [
145+
'build/externs/i18n.js',
146+
'build/externs/skulpt.js',
147+
],
148+
out: 'genfiles/core/frameworks/internal/python2_framework.js',
149+
});
150+
151+
152+
/**
153+
* Python 3.x Framework
154+
*/
155+
closureBuilder.build({
156+
name: 'cwc.framework.Python3',
157+
compress: true,
158+
srcs: [
159+
'src/frameworks/python/python3.js',
160+
],
161+
externs: [
162+
'build/externs/brython.js',
163+
],
164+
out: 'genfiles/core/frameworks/internal/python3_framework.js',
165+
});
166+
167+
168168
/**
169169
* Raspberry Pi Framework
170170
*/
171171
closureBuilder.build({
172172
name: 'cwc.framework.RaspberryPi',
173173
compress: true,
174174
srcs: glob([
175-
'src/frameworks/internal/raspberry_pi/*.js',
175+
'src/frameworks/raspberry_pi/*.js',
176176
]),
177177
deps: glob([
178-
'src/frameworks/internal/messenger/*.js',
178+
'src/frameworks/messenger/*.js',
179179
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
180180
]),
181181
out: 'genfiles/core/frameworks/internal/raspberry_pi_framework.js',
@@ -189,11 +189,11 @@ closureBuilder.build({
189189
name: 'cwc.framework.simple.Loader',
190190
compress: true,
191191
srcs: glob([
192-
'src/frameworks/internal/simple/*.js',
192+
'src/frameworks/simple/*.js',
193193
]),
194194
deps: glob([
195195
'src/config/config.js',
196-
'src/frameworks/internal/messenger/*.js',
196+
'src/frameworks/messenger/*.js',
197197
'src/utils/dialog/*',
198198
'src/utils/logger.js',
199199
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
@@ -209,10 +209,10 @@ closureBuilder.build({
209209
name: 'cwc.framework.Sphero',
210210
compress: true,
211211
srcs: glob([
212-
'src/frameworks/internal/sphero/*.js',
212+
'src/frameworks/sphero/*.js',
213213
]),
214214
deps: glob([
215-
'src/frameworks/internal/messenger/*.js',
215+
'src/frameworks/messenger/*.js',
216216
'third_party/coding-with-chrome-libraries/src/utils/stack/stack.js',
217217
]),
218218
out: 'genfiles/core/frameworks/internal/sphero_framework.js',
@@ -226,7 +226,7 @@ closureBuilder.build({
226226
name: 'cwc.framework.Turtle',
227227
compress: true,
228228
srcs: glob([
229-
'src/frameworks/internal/turtle/*.js',
229+
'src/frameworks/turtle/*.js',
230230
]),
231231
deps: [],
232232
externs: [

build/cwc/gss.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ closureBuilder.build({
7070
name: 'CwC messenger Style Sheet',
7171
prefix: 'cwc-',
7272
srcs: glob([
73-
'src/frameworks/internal/messenger/messenger.gss',
73+
'src/frameworks/messenger/messenger.gss',
7474
]),
7575
out: 'genfiles/core/css/messenger.css',
7676
});

build/cwc/main-debug.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ let glob = closureBuilder.globSupport();
2727
closureBuilder.build({
2828
name: 'cwc.ui.Builder',
2929
srcs: glob([
30-
'src/**/*.js',
31-
'gensoyfiles/**/*.js',
30+
'src/**/!(*_test).js',
31+
'gensoyfiles/**/!(*_test).js',
3232
'!src/{blocks,blocks/**.js}',
33-
'!src/frameworks/{internal,internal/**.js}',
34-
'third_party/coding-with-chrome-libraries/src/**/*.js',
33+
'!src/{frameworks,frameworks/**.js}',
34+
'third_party/coding-with-chrome-libraries/src/**/!(*_test).js',
3535
]),
3636
externs: [
3737
'build/externs/blockly.js',

build/cwc/main-raw.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ let glob = closureBuilder.globSupport();
2727
closureBuilder.build({
2828
name: 'cwc.ui.Builder',
2929
srcs: glob([
30-
'src/**/*.js',
31-
'gensoyfiles/**/*.js',
30+
'src/**/!(*_test).js',
31+
'gensoyfiles/**/!(*_test).js',
3232
'!src/{blocks,blocks/**.js}',
33-
'!src/frameworks/{internal,internal/**.js}',
34-
'third_party/coding-with-chrome-libraries/src/**/*.js',
33+
'!src/{frameworks,frameworks/**.js}',
34+
'third_party/coding-with-chrome-libraries/src/**/!(*_test).js',
3535
]),
3636
externs: [
3737
'build/externs/blockly.js',

build/cwc/main.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ let glob = closureBuilder.globSupport();
2727
closureBuilder.build({
2828
name: 'cwc.ui.Builder',
2929
srcs: glob([
30-
'src/**/*.js',
31-
'gensoyfiles/**/*.js',
30+
'src/**/!(*_test).js',
31+
'gensoyfiles/**/!(*_test).js',
3232
'!src/{blocks,blocks/**.js}',
33-
'!src/frameworks/{internal,internal/**.js}',
34-
'third_party/coding-with-chrome-libraries/src/**/*.js',
33+
'!src/{frameworks,frameworks/**.js}',
34+
'third_party/coding-with-chrome-libraries/src/**/!(*_test).js',
3535
]),
3636
externs: [
3737
'build/externs/addons.js',

build/usage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ const sections = [{
9191
name: 'test-soy',
9292
summary: 'Test all soy files for compilation errors.',
9393
}, {
94-
name: 'test-units',
94+
name: 'test:units',
9595
summary: 'Perform general unit tests.',
9696
}, {
9797
name: 'test-core',

0 commit comments

Comments
 (0)