浏览代码

Clean up documentation for x-api v3

Katrina Owen 10 年前
父节点
当前提交
486597a382
共有 6 个文件被更改,包括 231 次插入27 次删除
  1. 0
    0
      docs/HELLO.md
  2. 140
    19
      docs/INSTALLATION.md
  3. 0
    0
      docs/RESOURCES.md
  4. 91
    0
      docs/TESTS.md
  5. 0
    3
      docs/TOOLS.md
  6. 0
    5
      docs/WORKFLOW.md

+ 0
- 0
docs/HELLO.md 查看文件


+ 140
- 19
docs/INSTALLATION.md 查看文件

1
-## Installation
1
+## Windows
2
 
2
 
3
-You will need:
3
+If you are new-ish to programming in Java, these instructions are for you. This is a step-by-step opinionated guide to getting from zero to submitting your first exercise.
4
 
4
 
5
-* Java 8
6
-* Gradle
7
 
5
 
8
-### Java
6
+### Install Java Development Kit 1.8
9
 
7
 
10
-If typing `java -version` on the command-line returns `command not found` or similar, then go to [java.com](https://www.java.com/en/download/help/index_installing.xml), which will tell you how to install Java on your system.
11
 
8
 
12
-If Java is already installed, you will see something like the following, perhaps with some extra details about builds and virtual machines:
9
+First determine if you have Java installed already.
13
 
10
 
14
-    java version "1.8.0"
11
+In a Command Prompt window (Start -> Command Prompt)...
15
 
12
 
16
-### Gradle
13
+```
14
+C:\Users\johndoe> java -version
15
+```
17
 
16
 
18
-On Mac OS X you can install Gradle using homebrew:
17
+if you see:
19
 
18
 
20
-    brew install gradle
19
+```
20
+'java' is not recognized as an internal or external command,
21
+operable program or batch file.
22
+```
21
 
23
 
22
-On Windows you will need to visit the [Gradle](http://gradle.org/installation) website and follow the instructions there.
24
+You'll need to install the JDK — it contains both a Java Runtime and development tools.
23
 
25
 
24
-* Download the latest version (big green button)
25
-* Unpack the ZIP file, which will contain a folder (e.g. gradle-2.2.1)
26
-* Copy the folder to a convenient location
27
-* Add that location + `\bin` to your `PATH`
26
+1. Go to [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html) and download the latest version of the JDK (at the time of writing, [JDK 8u45](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
27
+2. Run the installer, using all the defaults.
28
 
28
 
29
-Verify that it has been installed correctly by running:
29
+Verify that the install worked.
30
 
30
 
31
-    gradle -version
31
+Close any open Command Prompt windows and in a *new* Command Prompt window...
32
 
32
 
33
-You should see a version number as well as some extra information about build time and dependencies.
33
+```
34
+C:\Users\johndoe> java -version
35
+```
36
+
37
+You should see something like this:
38
+
39
+```
40
+java version "1.8.0_45"
41
+Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
42
+Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
43
+```
44
+
45
+The exact version number is not important, just that version 1.8 or better is installed. Circa 2004, Sun Microsystem, in their inifinite wisdom, decided that it would be "better" to have dual numbering conventions.  Java 1.8 == Java 8.0.
46
+
47
+### Install IntelliJ IDEA Community Edition
48
+
49
+Download, install and configure IntelliJ with the JDK you have installed:
50
+
51
+1. Download [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/) and run the installer; accept all the defaults.
52
+
53
+2. Run IntelliJ (Start -> All Programs -> JetBrains -> IntelliJ IDEA Community Edition).
54
+    * The first time you do, IntelliJ walks you through some initial setup.  We recommend selecting a UI Theme and then just clicking "Skip All and Set Defaults".
55
+
56
+3. In the "Welcome to IntelliJ IDEA" window, open the "Configure" pull-down and select "Project Defaults", then "Project Structure".
57
+
58
+3. In the "Default Project Structure" dialog, find the "Project SDK:" section in the right panel.  Click the "New..." button and select "JDK".
59
+
60
+4. In the "Select Home Directory for JDK" file open dialog, navigate to "`C:\Program Files\Java\jdk1.8...`".  Be sure to select the JDK, not the JRE.  Click "OK".
61
+
62
+5. Back in the "Default Project Structure" dialog, in the "Project language level:" section, select "8 - Lambdas, type annotations etc.".  Click "OK".
63
+
64
+## Mac OS X
65
+
66
+If you are new-ish to programming in Java on Mac OS X, these instructions are for you.
67
+This is a step-by-step opinionated guide to getting from zero to submitting your first exercise.
68
+
69
+### Step 1 — Install Java Development Kit 1.8
70
+
71
+First, determine if the JDK 1.8 is installed:
72
+
73
+```bash
74
+$ java -version
75
+```
76
+
77
+What you do next depends on the output of that command.
78
+
79
+#### No JDKs Installed
80
+
81
+If you have no JDKs installed at all (e.g. you have a fresh install of Mac OS X 10.10 [Yosemite]),
82
+the OS presents a dialog:
83
+
84
+![To use the "java," command-line tool you need to install a JDK.  Click "More Info..." to visit the Java Developer Kit download website.](img/setup/java/mac-osx--install-java-dialog.png)
85
+
86
+Clicking on the "More Info..." button takes you to the [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html).
87
+
88
+Download the latest version of the JDK (at the time of writing,
89
+[JDK 8u45](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
90
+and run the installer, using all the defaults.
91
+
92
+Skip down to [Verify JDK Install](#verify-jdk-install)
93
+
94
+#### Older JDKs Installed
95
+
96
+If you see something like...
97
+
98
+```bash
99
+java version "1.6.0_65"
100
+Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
101
+Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)
102
+```
103
+
104
+Or any version that is prior to 1.8, you need to install the 1.8 JDK...
105
+
106
+1. Go to [Oracle OTN](http://www.oracle.com/technetwork/java/javase/downloads/index.html)
107
+and download the latest version of the JDK (at the time of writing,
108
+[JDK 8u45](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html))
109
+2. Run the installer, using all the defaults.
110
+
111
+#### Verify JDK Install
112
+
113
+Let's verify that the installation worked...
114
+
115
+```bash
116
+$ java -version
117
+```
118
+
119
+You should see something like this:
120
+
121
+```bash
122
+java version "1.8.0_45"
123
+Java(TM) SE Runtime Environment (build 1.8.0_45-b15)
124
+Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)
125
+```
126
+
127
+The exact version number is not important, just that version 1.8 or better is installed.
128
+Circa 2004, Sun Microsystem, in their inifinite wisdom, decided that it would be "better" to
129
+have dual numbering conventions.  Java 1.8 == Java 8.0.
130
+
131
+Congratulations, you've ensured you have the proper version of Java, itself, installed!
132
+
133
+### Step 2 — Install IntelliJ IDEA Community Edition
134
+
135
+Download, install and configure IntelliJ with the JDK you have installed:
136
+
137
+1. Download [IntelliJ IDEA Community Edition](https://www.jetbrains.com/idea/download/) and
138
+run the installer; accept all the defaults.
139
+
140
+2. Run IntelliJ (`/Applications/IntelliJ IDEA 14 CE.app`)
141
+    * The first time you do, IntelliJ walks you through some initial setup.  We recommend
142
+      selecting a UI Theme and then just clicking "Skip All and Set Defaults".
143
+
144
+3. In the "Welcome to IntelliJ IDEA" window, open the "Configure" pull-down and select
145
+   "Project Defaults", then "Project Structure".
146
+
147
+6. In the "Default Project Structure" dialog, find the "Project SDK:" section in the right panel.
148
+   Click the "New..." button and select "JDK".
149
+
150
+5. In the "Select Home Directory for JDK" file open dialog, navigate to
151
+   `/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home`. Click "OK".
152
+
153
+6. Back in the "Default Project Structure" dialog, in the "Project language level:" section,
154
+   select "8 - Lambdas, type annotations etc.".  Click "OK".

+ 0
- 0
docs/RESOURCES.md 查看文件


+ 91
- 0
docs/TESTS.md 查看文件

1
+## Windows
2
+
3
+1) In the Command Prompt window, get the first exercise...
4
+
5
+```
6
+C:\Users\johndoe> exercism fetch java
7
+
8
+New:
9
+java (Etl)      C:\Users\johndoe\exercism\java\etl
10
+
11
+unchanged: 0, updated: 0, new: 1
12
+```
13
+
14
+2) In the "Welcome to IntelliJ IDEA" window, click the "Open" option.
15
+
16
+3) Navigate to the "C:\Users\johndoe\exercism\java\etl" folder.  Make sure you've selected the "etl" folder. Click "OK".
17
+
18
+4) In the "Import Project from Gradle" dialog, check the "auto-import" and "create directories" checkboxes and select "Use customizable gradle wrapper".
19
+
20
+```
21
+Gradle project:    [C:\Users\johndoe\exercism\java\etl\build.gradle   ](...)
22
+
23
+[X] Use auto-import
24
+[X] Create directories for empty content roots automatically
25
+
26
+( ) Use default gradle wrapper (not configured for the current project)
27
+(o) Use customizable gradle wrapper
28
+( ) Use local gradle distribution
29
+
30
+...
31
+```
32
+
33
+5) Click "OK".  IntelliJ will automatically create its project artifacts based on the Gradle project file.
34
+
35
+* After the project has loaded and you've dismissed the "Tip of the Day" dialog, you may see a notice (in the top-right-hand corner), saying, "Unindex remote maven repositories found." you can safely dismiss this notice.
36
+
37
+6) Open the `README.md` file and carefully read the background for the assignment.
38
+
39
+7) Start by running the test suite: In the "Project" view, right-click on the test file (`etl\src\test\java\EtlTest`), select "Run", then pick the "EtlTest" that has a JUnit icon to the left of it (red and green arrows), NOT the Gradle icon (circular green).
40
+
41
+* When you first start an exercise, you should expect compilation errors because the test is setting expectations on a class that you need to write.  By trying to run the tests, you get a nice list of what needs to be fixed in the "Messages Make" view.
42
+
43
+... and away you go!!!
44
+
45
+## Mac OS X
46
+
47
+### Get started with the first exercise
48
+
49
+1. In the terminal window, get the first exercise...
50
+
51
+        $ exercism fetch java
52
+
53
+        Not Submitted:       1 problem
54
+        Java (Etl) /Users/johndoe/exercism/java/etl
55
+
56
+        New:                 1 problem
57
+        Java (Etl) /Users/johndoe/exercism/java/etl
58
+
59
+        unchanged: 0, updated: 0, new: 1
60
+
61
+2. In the "Welcome to IntelliJ IDEA" window, click the "Open" option.
62
+
63
+3. Navigate to the `/Users/johndoe/exercism/java/etl` folder.  Make sure you've selected the
64
+   "etl" folder. Click "OK".
65
+
66
+4. In the "Import Project from Gradle" dialog, check the "auto-import" and "create directories"
67
+   checkboxes and select "Use customizable gradle wrapper".
68
+
69
+    ![IntelliJ 14 CE -- Gradle import dialog](img/setup/java/mac-osx--idea-ce-gradle-import-dialog.png)
70
+
71
+5. Click "OK".  IntelliJ will automatically create its project artifacts based on the Gradle project file.
72
+
73
+ * After the project has loaded and you've dismissed the "Tip of the Day" dialog, you may see a
74
+   notice (in the top-right-hand corner), saying, "Unindex remote maven repositories found." you can
75
+   safely dismiss this notice.
76
+
77
+6. Open the `README.md` file and carefully read the background for the assignment.
78
+
79
+7. Start by running the test suite: In the "Project" view, right-click on the test file
80
+   (`etl\src\test\java\EtlTest`), select "Run", then pick the "EtlTest" that has a JUnit icon to the
81
+   left of it (red and green arrows), NOT the Gradle icon (circular green).
82
+   ![Run tests through IDEA JUnit Runner, NOT Gradle](img/setup/java/mac-osx--idea-ce-run-unit-tests.png)
83
+
84
+ * If these menu options don't appear at first, wait for a few seconds and try again; IntelliJ is still
85
+   configuring the project with a Java nature.
86
+
87
+ * When you first start an exercise, you should expect compilation errors because the test is
88
+   setting expectations on a class that you need to write.  By trying to run the tests, you get a
89
+   nice list of what needs to be fixed in the "Messages Make" view.
90
+
91
+... and away you go!!!

+ 0
- 3
docs/TOOLS.md 查看文件

1
-## IDE integration
2
-
3
-Check out [Gradle Tooling](http://gradle.org/tooling) for integration into IDEs such as Eclipse.

+ 0
- 5
docs/WORKFLOW.md 查看文件

1
-## Running Tests
2
-
3
-Change directories to the downloaded exercism problem, and then run
4
-
5
-    $ gradle test