Skip to content

Commit 23d0ef4

Browse files
author
Christopher Willis-Ford
committed
Update the README to include Gradle instructions
1 parent e6df4f4 commit 23d0ef4

1 file changed

Lines changed: 47 additions & 7 deletions

File tree

README.md

Lines changed: 47 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,49 @@ If you're interested in contributing to Scratch, please take a look at the issue
66
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>.
77

88
### Building
9-
To build the Scratch 2.0 SWF you will need [Ant](http://ant.apache.org/), 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. Scratch is used in a multitude of settings and some users have older versions of Flash which we try to support (as far back as 10.2).
109

11-
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``.
10+
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.
1211

13-
The ``build.properties`` file sets the default location for the Flex SDK. Create a ``local.properties`` file to set the location on your filesystem. Your ``local.properties`` file may look something like this:
14-
```
15-
FLEX_HOME=/home/joe/downloads/flex_sdk_4.11
12+
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`.
13+
14+
Required Flash version | Features | Command
15+
--- | --- | ---
16+
11.6 or above | 3D-accelerated rendering | `./gradlew build -Ptarget=11.6`
17+
10.2 - 11.5 | Compatibility with older Flash (Linux, older OS X, etc.) | `./gradlew build -Ptarget=10.2`
18+
19+
A successful build should look something like this (SDK download information omitted):
20+
21+
```sh
22+
$ ./gradlew build -Ptarget=11.6
23+
Defining custom 'build' task when using the standard Gradle lifecycle plugins has been deprecated and is scheduled to be removed in Gradle 3.0
24+
Target is: 11.6
25+
Commit ID for scratch-flash is: e6df4f4
26+
:copyresources
27+
:compileFlex
28+
WARNING: The -library-path option is being used internally by GradleFx. Alternative: specify the library as a 'merged' Gradle dependendency
29+
:copytestresources
30+
:test
31+
Skipping tests since no tests exist
32+
:build
33+
34+
BUILD SUCCESSFUL
35+
36+
Total time: 13.293 secs
1637
```
17-
Now you can run Ant ('ant' from the commandline) to build the SWF.
1838

19-
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.
39+
Upon completion, you should find your new SWF in the `build` subdirectory.
40+
41+
```sh
42+
$ ls -R build
43+
build:
44+
10.2 11.6
45+
46+
build/10.2:
47+
ScratchFor10.2.swf
48+
49+
build/11.6:
50+
Scratch.swf
51+
```
2052

2153
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).
2254

@@ -26,3 +58,11 @@ Here are a few integrated development environments available with Flash debuggin
2658
* [Adobe Flash Builder](http://www.adobe.com/products/flash-builder.html)
2759
* [FlashDevelop](http://www.flashdevelop.org/)
2860
* [FDT for Eclipse](http://fdt.powerflasher.com/)
61+
62+
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.
63+
64+
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``.
65+
66+
Consult your IDE's documentation to configure it for your newly-constructed copy of the Flex SDK.
67+
68+
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.

0 commit comments

Comments
 (0)