Skip to content
This repository was archived by the owner on Sep 3, 2019. It is now read-only.

Commit 2e4a402

Browse files
authored
Merge pull request #1407 from cwillisf/modernize-debugging-instructions
Modernize debugging instructions
2 parents 72e4729 + e2140ee commit 2e4a402

File tree

3 files changed

+139
-25
lines changed

3 files changed

+139
-25
lines changed

.vscode/launch.json

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
// Use IntelliSense to learn about possible attributes.
3+
// Hover to view descriptions of existing attributes.
4+
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
5+
"version": "0.2.0",
6+
"configurations": [
7+
{
8+
"type": "swf",
9+
"request": "launch",
10+
"name": "Launch SWF built by IDE",
11+
"program": "${workspaceFolder}/build/ide/Scratch.swf"
12+
},
13+
{
14+
"type": "swf",
15+
"request": "launch",
16+
"name": "Launch Flash 11.6 SWF built by Gradle",
17+
"program": "${workspaceFolder}/build/11.6/Scratch.swf"
18+
},
19+
{
20+
"type": "swf",
21+
"request": "launch",
22+
"name": "Launch Flash 10.2 SWF built by Gradle",
23+
"program": "${workspaceFolder}/build/10.2/ScratchFor10.2.swf"
24+
},
25+
]
26+
}

README.md

Lines changed: 83 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,76 @@
1-
## Scratch 2.0 editor and player [![Build Status](https://api.travis-ci.org/LLK/scratch-flash.svg?branch=master)](https://travis-ci.org/LLK/scratch-flash)
2-
3-
#### Note: Scratch 2.0 is now in maintenance mode while the team focuses efforts on [Scratch 3.0](https://scratch.mit.edu/developers). While critical issues will be addressed please note that any feature requests or minor issues will not be reviewed until the next major release.
4-
5-
---
6-
7-
This is the open source version of Scratch 2.0 and the core code for the official version found on http://scratch.mit.edu. This code has been released under the GPL version 2 license. Forks can be released under the GPL v2 or any later version of the GPL.
8-
9-
If you're interested in contributing to Scratch, please take a look at the issues on this repository. Two great ways of helping Scratch are by identifying bugs and documenting them as issues, or fixing issues and creating pull requests. When submitting pull requests please be patient -- the Scratch Team is very busy and it can take a while to find time to review them. The organization and class structures can't be radically changed without significant coordination and collaboration from the Scratch Team, so these types of changes should be avoided.
10-
11-
It's been said that the Scratch Team spends about one hour of design discussion for every pixel in Scratch, but some think that estimate is a little low. While we welcome suggestions for new features in our <a href="http://scratch.mit.edu/discuss/1/">suggestions forum</a> (especially ones that come with mockups), we are unlikely to accept PRs with new features that we haven't deeply thought through. Why? Because we have a strong belief in the value of keeping things simple for new users. To learn more about our design philosophy, see this <a href="http://scratch.mit.edu/discuss/post/1576/">forum post<a>, or <a href="http://web.media.mit.edu/~jmaloney/papers/ScratchLangAndEnvironment.pdf">this paper</a>.
12-
13-
### Building
14-
15-
The Scratch 2.0 build process now uses [Gradle](http://gradle.org/) to simplify the process of acquiring dependencies: the necessary Flex SDKs will automatically be downloaded and cached for you. The [Gradle wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) is included in this repository, but you will need a Java Runtime Environment or Java Development Kit in order to run Gradle; you can download either from Oracle's [Java download page](http://www.oracle.com/technetwork/java/javase/downloads/index.html). That page also contains guidance on whether to download the JRE or JDK.
16-
17-
There are two versions of the Scratch 2.0 editor that can be built from this repository. See the following table to determine the appropriate command for each version. When building on Windows, replace `./gradlew` with `.\gradlew`.
1+
# Scratch 2.0 editor and player [![Build Status](https://api.travis-ci.org/LLK/scratch-flash.svg?branch=master)](https://travis-ci.org/LLK/scratch-flash)
2+
3+
## Note
4+
5+
**Scratch 2.0 is now in maintenance mode while the team focuses efforts on [Scratch
6+
3.0](https://scratch.mit.edu/developers). While critical issues will be addressed please note that any feature
7+
requests or minor issues will not be reviewed until the next major release.**
8+
9+
## Overview
10+
11+
This is the open source version of Scratch 2.0 and the core code for the official version found on
12+
<http://scratch.mit.edu>. This code has been released under the GPL version 2 license. Forks can be released under the
13+
GPL v2 or any later version of the GPL.
14+
15+
If you're interested in contributing to Scratch, please take a look at the issues on this repository. Two great ways
16+
of helping Scratch are by identifying bugs and documenting them as issues, or fixing issues and creating pull
17+
requests. When submitting pull requests please be patient -- the Scratch Team is very busy and it can take a while to
18+
find time to review them. The organization and class structures can't be radically changed without significant
19+
coordination and collaboration from the Scratch Team, so these types of changes should be avoided.
20+
21+
It's been said that the Scratch Team spends about one hour of design discussion for every pixel in Scratch, but some
22+
think that estimate is a little low. While we welcome suggestions for new features in our [suggestions
23+
forum](http://scratch.mit.edu/discuss/1/) (especially ones that come with mockups), we are unlikely to accept PRs with
24+
new features that we haven't deeply thought through. Why? Because we have a strong belief in the value of keeping
25+
things simple for new users. To learn more about our design philosophy, see [this forum
26+
post](http://scratch.mit.edu/discuss/post/1576/) or [this
27+
paper](http://web.media.mit.edu/~jmaloney/papers/ScratchLangAndEnvironment.pdf).
28+
29+
## Quick Start: Building and Debugging with Visual Studio Code
30+
31+
1. Build at least once using the Gradle instructions listed in the "Building" instructions below.
32+
* TL;DR: run `./gradlew build -Ptarget="11.6"` in a terminal (on Windows, replace `/` with `\` as usual).
33+
* This will download and unpack the necessary SDKs.
34+
* You may need to agree to a few licenses (press `y` then `enter`).
35+
* It may take quite a while and appear to hang at times. Watch disk and network activity to be sure.
36+
2. Install [Visual Studio Code](https://code.visualstudio.com/).
37+
3. Install the "ActionScript & MXML" extension (search for `@ext:as3` in the `Extensions` pane).
38+
* Reload VS Code when prompted.
39+
4. Add the `scratch-flash` folder to the VS Code workspace.
40+
5. Click "No SDK" then "Add more SDKs to this list...".
41+
6. Browse to your home directory, then go into `.gradle`, then `gradleFx`. Choose `sdks` and close the dialog.
42+
7. Your list of SDKs should now include something starting with "Apache Flex 4.15.0"; choose that.
43+
44+
You should now be able to build and debug using your usual Visual Studio Code hotkeys. The defaults are Ctrl+Shift+B
45+
(or Cmd+Shift+B on Mac) to build and F5 to run.
46+
47+
Note that this will build a SWF which requires a very recent version of Flash, so the IDE build should only be used
48+
for development and debugging. The Gradle builds (see below) are configured for compatibility with a broad range of
49+
Flash versions.
50+
51+
Check `asconfig.json` for the configuration settings used by the IDE build.
52+
53+
## Building
54+
55+
The Scratch 2.0 build process now uses [Gradle](http://gradle.org/) to simplify the process of acquiring dependencies:
56+
the necessary Flex SDKs will automatically be downloaded and cached for you. The [Gradle
57+
wrapper](https://docs.gradle.org/current/userguide/gradle_wrapper.html) is included in this repository, but you will
58+
need a Java Runtime Environment or Java Development Kit in order to run Gradle; you can download either from Oracle's
59+
[Java download page](http://www.oracle.com/technetwork/java/javase/downloads/index.html). That page also contains
60+
guidance on whether to download the JRE or JDK.
61+
62+
There are two versions of the Scratch 2.0 editor that can be built from this repository. See the following table to
63+
determine the appropriate command for each version. When building on Windows, replace `./gradlew` with `.\gradlew`.
1864

1965
Required Flash version | Features | Command
2066
--- | --- | ---
21-
11.6 or above | 3D-accelerated rendering | `./gradlew build -Ptarget=11.6`
22-
10.2 - 11.5 | Compatibility with older Flash (Linux, older OS X, etc.) | `./gradlew build -Ptarget=10.2`
67+
11.6 or above | 3D-accelerated rendering | `./gradlew build -Ptarget="11.6"`
68+
10.2 - 11.5 | Compatibility with older Flash (Linux, older OS X, etc.) | `./gradlew build -Ptarget="10.2"`
2369

2470
A successful build should look something like this (SDK download information omitted):
2571

2672
```sh
27-
$ ./gradlew build -Ptarget=11.6
73+
$ ./gradlew build -Ptarget="11.6"
2874
Defining custom 'build' task when using the standard Gradle lifecycle plugins has been deprecated and is scheduled to be removed in Gradle 3.0
2975
Target is: 11.6
3076
Commit ID for scratch-flash is: e6df4f4
@@ -55,19 +101,31 @@ build/11.6:
55101
Scratch.swf
56102
```
57103

58-
Please note that the Scratch trademarks (including the Scratch name, logo, Scratch Cat, and Gobo) are property of MIT. For use of these Marks, please see the [Scratch Trademark Policy](http://wiki.scratch.mit.edu/wiki/Scratch_1.4_Source_Code#Scratch_Trademark_Policy).
104+
Please note that the Scratch trademarks (including the Scratch name, logo, Scratch Cat, and Gobo) are property of MIT.
105+
For use of these Marks, please see the [Scratch Trademark
106+
Policy](http://wiki.scratch.mit.edu/wiki/Scratch_1.4_Source_Code#Scratch_Trademark_Policy).
107+
108+
## Debugging
59109

60-
### Debugging
61110
Here are a few integrated development environments available with Flash debugging support:
111+
112+
* [Visual Studio Code](https://code.visualstudio.com/)
62113
* [Intellij IDEA](http://www.jetbrains.com/idea/features/flex_ide.html)
63114
* [Adobe Flash Builder](http://www.adobe.com/products/flash-builder.html)
64115
* [FlashDevelop](http://www.flashdevelop.org/)
65116
* [FDT for Eclipse](http://fdt.powerflasher.com/)
66117

67-
It may be difficult to configure your IDE to use Gradle's cached version of the Flex SDK. To debug the Scratch 2.0 SWF with your own copy of the SDK you will need the [Flex SDK](http://flex.apache.org/) version 4.10+, and [playerglobal.swc files](http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html#playerglobal) for Flash Player versions 10.2 and 11.4 added to the Flex SDK.
118+
It may be difficult to configure your IDE to use Gradle's cached version of the Flex SDK. To debug the Scratch 2.0 SWF
119+
with your own copy of the SDK you will need the [Flex SDK](http://flex.apache.org/) version 4.10+, and
120+
[playerglobal.swc files](http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html#playerglobal) for
121+
Flash Player versions 10.2 and 11.6 added to the Flex SDK.
68122

69-
After downloading ``playerglobal11_4.swc`` and ``playerglobal10_2.swc``, move them to ``<path to flex>/frameworks/libs/player/<version>/playerglobal.swc``. E.g., ``playerglobal11_4.swc`` should be located at ``<path to flex>/frameworks/libs/player/11.4/playerglobal.swc``.
123+
After downloading ``playerglobal11_6.swc`` and ``playerglobal10_2.swc``, move them to
124+
``${FLEX_HOME}/frameworks/libs/player/${VERSION}/playerglobal.swc``. E.g., ``playerglobal11_6.swc`` should be located
125+
at ``${FLEX_HOME}/frameworks/libs/player/11.6/playerglobal.swc``.
70126

71127
Consult your IDE's documentation to configure it for your newly-constructed copy of the Flex SDK.
72128

73-
If the source is building but the resulting .swf is producing runtime errors, your first course of action should be to download version 4.11 of the Flex SDK and try targeting that. The Apache foundation maintains an [installer](http://flex.apache.org/installer.html) that lets you select a variety of versions.
129+
If the source is building but the resulting .swf is producing runtime errors, your first course of action should be to
130+
download version 4.11 of the Flex SDK and try targeting that. The Apache foundation maintains an
131+
[installer](http://flex.apache.org/installer.html) that lets you select a variety of versions.

asconfig.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"config": "flex",
3+
"type": "app",
4+
"files": ["src/Scratch.as"],
5+
"compilerOptions": {
6+
"default-size": {
7+
"width": 1024,
8+
"height": 640
9+
},
10+
"output": "build/ide/Scratch.swf",
11+
"source-path": [
12+
"src"
13+
],
14+
"library-path": [
15+
"libs"
16+
],
17+
"advanced-telemetry": true,
18+
"static-link-runtime-shared-libraries": true,
19+
"define": [
20+
{
21+
"name": "SCRATCH::allow3d",
22+
"value": true
23+
},
24+
{
25+
"name": "SCRATCH::revision",
26+
"value": "'dev-ide'"
27+
}
28+
]
29+
}
30+
}

0 commit comments

Comments
 (0)