Skip to content

Commit eba0291

Browse files
authored
Merge branch 'master' into poker
2 parents fe2139b + 9b30aee commit eba0291

250 files changed

Lines changed: 4260 additions & 1757 deletions

File tree

Some content is hidden

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

exercises/_template/src/example/java/.keep renamed to .Rhistory

File renamed without changes.

‎.gitattributes‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Autodetect text files
2+
* text=auto
3+
4+
# Force the following filetypes to have unix eols, so Windows does not break them
5+
*.* text eol=lf
6+
7+
# Force images/fonts to be handled as binaries
8+
*.jpg binary
9+
*.jpeg binary
10+
*.png binary

‎.github/PULL_REQUEST_TEMPLATE.md‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!-- Your content goes here: -->
2+
3+
4+
5+
<!-- DO NOT EDIT BELOW THIS LINE! -->
6+
---
7+
8+
Reviewer Resources:
9+
10+
[Track Policies](https://github.com/exercism/xjava/blob/master/POLICIES.md#event-checklist)

‎.gitignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,4 @@ build/
88
*.iml
99
bin/configlet
1010
bin/configlet.exe
11-
gradle/
1211
/exercises/.nb-gradle/

‎.travis.yml‎

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,9 @@ language: java
33
jdk:
44
- oraclejdk8
55

6-
notifications:
7-
webhooks:
8-
urls:
9-
- https://webhooks.gitter.im/e/5e9ccd41111917b19478
10-
on_success: change # options: [always|never|change] default: always
11-
on_failure: always # options: [always|never|change] default: always
12-
on_start: never # options: [always|never|change] default: always
13-
146
# http://docs.travis-ci.com/user/migrating-from-legacy
157
sudo: false
16-
cache: bundler
8+
179
addons:
1810
apt:
1911
packages:
@@ -24,9 +16,31 @@ before_install:
2416
- rvm use 2.2.5
2517
- bin/build-jq.sh # we want jq 1.5 features; not avail through pkg repo.
2618

19+
# https://docs.travis-ci.com/user/customizing-the-build#Skipping-the-Installation-Step
20+
install: true # if we don't skip install, ./gradlew assemble is invoked, but this task is not available.
21+
2722
before_script:
2823
- export PATH=$TRAVIS_BUILD_DIR/bin:$PATH # ensure our tools are prefered over included ones.
2924

3025
script:
3126
- bin/unit-tests.sh
3227
- bin/journey-test.sh
28+
29+
# configure caching (https://docs.travis-ci.com/user/languages/java/#Caching)
30+
before_cache:
31+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
32+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
33+
# format from https://docs.travis-ci.com/user/caching/#Enabling-multiple-caching-features
34+
cache:
35+
bundler: true
36+
directories:
37+
- $HOME/.gradle/caches/
38+
- $HOME/.gradle/wrapper/
39+
40+
notifications:
41+
webhooks:
42+
urls:
43+
- https://webhooks.gitter.im/e/5e9ccd41111917b19478
44+
on_success: change # options: [always|never|change] default: always
45+
on_failure: always # options: [always|never|change] default: always
46+
on_start: never # options: [always|never|change] default: always

‎LICENSE‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
The MIT License (MIT)
1+
MIT License
22

3-
Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
3+
Copyright (c) 2017 Exercism, Inc
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

‎POLICIES.md‎

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Track Policies
2+
3+
This document:
4+
5+
- describes all current track-wide policies; and
6+
- lists all policies that should be reviewed in response to any given track event.
7+
8+
Maintainers should refer to this document each time they review a pull request.
9+
10+
Our policies are not set-in-stone. They represent directions chosen at a point in time with the information/context available at that time. We actively encourage contributors to review and critique them. If you have read through the references that informed an existing policy and still feel it should be improved or removed, please comment and describe:
11+
12+
1. your alternative perspective;
13+
2. your proposed changes; and
14+
3. how your proposal balances your own perspective with those already raised during prior discussions.
15+
16+
## Event Checklist
17+
18+
| Track Event | Policies to review |
19+
|:------------|:-----------------|
20+
| Exercise added | [Prefer instance methods](#prefer-instance-methods); [Starter implementations](#starter-implementations); [Ignore noninitial tests](#ignore-noninitial-tests) |
21+
| Exercise updated | [Ignore noninitial tests](#ignore-noninitial-tests); [Multiple file submissions](#multiple-file-submissions) |
22+
| Track order changed | [Starter implementations](#starter-implementations); [Multiple file submissions](#multiple-file-submissions) |
23+
| New issue observed in track | [Good first patches](#good-first-patches) |
24+
| "Good first patch" issue completed | [Good first patches](#good-first-patches) |
25+
| Installing Java instructions updated | [Simple onboarding](#simple-onboarding) |
26+
27+
## Policy Descriptions
28+
29+
### Prefer instance methods
30+
31+
> Most (all?) exercises should be implemented in the form of instance methods since they contain "domain logic" and we (Exercism) want to encourage exemplary software.
32+
33+
References: [[1](https://github.com/exercism/java/issues/177#issuecomment-261291741)]
34+
35+
### Starter implementations
36+
37+
> - Exercises 1-10: provide stubs for all required constructors and methods. Stubs should include the following body:
38+
`throw new UnsupportedOperationException("Delete this statement and write your own implementation.");`
39+
> - Exercises 11-20: provide stubs for all constructors and methods required by the first test; comment-out the bodies of any tests that require non-stubbed constructors or methods. Stubs should include the following body:
40+
`throw new UnsupportedOperationException("Delete this statement and provide your own implementation.");`
41+
> - Exercises 21+: provide no stubs, but mention any "interesting" interface aspects in the HINT.md file (which gets merged into the README.md for the exercise).
42+
43+
References: [[1](https://github.com/exercism/java/issues/178)]
44+
45+
### Do not make user-facing classes `final`
46+
47+
> Starter implementations and test classes should not include the `final` keyword in class declarations as it isn't strictly necessary and could be confusing to people unfamiliar with Java.
48+
49+
### Ignore noninitial tests
50+
51+
> All but the first test in an exercise test suite should be annotated `@Ignore("Remove to run test")` (single test) or `@Ignore("Remove to run tests")` (parametrized test).
52+
53+
References: [[1](https://github.com/exercism/java/issues/101#issuecomment-249349204)]
54+
55+
### Multiple file submissions
56+
57+
> The first exercise in the track whose test suite mandates multiple solution files should be accompanied by a HINT.md file reminding the practitioner that the CLI supports multiple file submissions.
58+
59+
References: [[1](https://github.com/exercism/java/issues/365#issuecomment-292533120)]
60+
61+
### Good first patches
62+
63+
> Aim to keep 10-20 small and straightforward issues open at eny given time. Identify any such issues by applying the "Good first patch" label. You can view the current list of these issues [here](https://github.com/exercism/java/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+patch%22).
64+
65+
References: [[1](https://github.com/exercism/java/issues/220#issue-196447088)]
66+
67+
### Simple onboarding
68+
69+
> The Installing Java instructions should seek to minimize the number of steps and the number of concepts a new-to-the-track practitioner needs to learn to get to coding.
70+
71+
References: [[1](https://github.com/exercism/java/issues/395#issue-215734887)]

‎README.md‎

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
# xJava [![Build Status](https://travis-ci.org/exercism/xjava.svg?branch=master)](https://travis-ci.org/exercism/xjava) [![Join the chat at https://gitter.im/exercism/xjava](https://badges.gitter.im/exercism/xjava.svg)](https://gitter.im/exercism/xjava?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1+
# java [![Build Status](https://travis-ci.org/exercism/java.svg?branch=master)](https://travis-ci.org/exercism/java) [![Join the chat at https://gitter.im/exercism/xjava](https://badges.gitter.im/exercism/java.svg)](https://gitter.im/exercism/xjava?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
22

33
Source for Exercism Exercises in Java.
44

55
## Contributing Guide
66

7-
For general information about how to contribute to Exercism, please refer to the [Contributing Guide](https://github.com/exercism/x-api/blob/master/CONTRIBUTING.md#the-exercise-data).
7+
For general information about how to contribute to Exercism, please refer to the [Contributing Guide](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks).
88

99
## Table of Contents
1010

@@ -32,13 +32,13 @@ To submit a fix for an existing exercise or port an exercise to Java with the le
3232
1. **Ensure you have the basic Java tooling installed:** JDK 1.8+, an editor and Gradle 2.x.
3333

3434
(see [exercism.io: Installing Java](http://exercism.io/languages/java/installing))
35-
- **Setup a branch on a fork of [exercism/xjava](https://github.com/exercism/xjava) on your computer.**
35+
- **Setup a branch on a fork of [exercism/java](https://github.com/exercism/java) on your computer.**
3636

37-
See [GitHub Help: Forking](https://help.github.com/articles/fork-a-repo/). Use those instructions (in conjunction with [Exercism Contributing Guide](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md#git-basics)) to:
37+
See [GitHub Help: Forking](https://help.github.com/articles/fork-a-repo/). Use those instructions (in conjunction with the [Git Basics doc](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/git-basics.md)) to:
3838
* "fork" a repository on GitHub;
3939
- install `git`;
4040
- "clone" a copy of your fork;
41-
- configure an "upstream remote" (in this case, `exercism/xjava`);
41+
- configure an "upstream remote" (in this case, `exercism/java`);
4242
- create a branch to house your work
4343
- **Write the codes.** Do your work on that branch you just created.
4444

@@ -52,31 +52,31 @@ To submit a fix for an existing exercise or port an exercise to Java with the le
5252
$ git push
5353
```
5454

55-
[Exercism Contributing Guide :: Commit Messages](https://github.com/exercism/x-common/blob/master/CONTRIBUTING.md#commit-messages) provides practical advice on crafting meaningful commit messages.
55+
The Git Basics doc has a section on [commit messages](https://github.com/exercism/docs/blob/master/contributing-to-language-tracks/git-basics.md#commit-messages) that provides practical advice on crafting meaningful commit messages.
5656
- **Verify that your work passes all tests.** When you create a pull request (PR), GitHub triggers a build on Travis CI. Your PR will not be merged unless those tests pass.
5757

5858
## Getting Familiar With the Codebase
5959

6060
There are two objectives to the design of this build:
6161

62-
1. when a problem is built from within the xjava repo, the tests run against the "example" code (i.e. when you, the contributor, are developing the exercise);
63-
2. when a problem is built outside the xjava repo (when a participant is solving the exercise), the tests run against the "main" code.
62+
1. when a problem is built from within the `exercism/java` repo (i.e. when you, the contributor, are developing the exercise), the tests run against the "example" code;
63+
2. when a problem is built outside the `exercism/java` repo (when a participant is solving the exercise), the tests run against the "main" code.
6464

6565
This repo is a multi-project gradle build.
6666

6767
### The `exercises` Module
6868

6969
This is the top-level module, contained in the `exercises` directory. It is a container for the problem sub-modules.
7070

71-
* it's `build.gradle` points the "main" sourceset to the example code.
72-
* it's `settings.gradle` names each of the subprojects, one for each problem in the set.
71+
* its `build.gradle` points the "main" sourceset to the example code.
72+
* its `settings.gradle` names each of the subprojects, one for each problem in the set.
7373

7474
### The Problem Submodules
7575

7676
The `exercises` subdirectory contains all of the problem submodules.
7777
Each problem/submodule is a subdirectory of the same name as its slug.
7878

79-
* it's `build.gradle` names dependencies required to work that problem.
79+
* its `build.gradle` names dependencies required to work that problem.
8080

8181
Each problem/submodule has three source sets:
8282

@@ -109,18 +109,11 @@ and if you review the logs of your x-api, you'll find:
109109
2015-09-06 15:21:01 - JSON::GeneratorError - source sequence is illegal/malformed utf-8:
110110
```
111111

112-
This is because some files generated by the build can't be served from the x-api. This is by design: the CLI does not serve binaries. To fix this, simply make sure you do a clean in your `xjava` repo before you fetch:
112+
This is because some files generated by the build can't be served from the x-api. This is by design: the CLI does not serve binaries. To fix this, simply make sure you do a clean in your `exercism/java` repo before you fetch:
113113

114114
```
115-
cd ~/workspace/exercism/xjava/exercises
115+
cd ~/workspace/exercism/java/exercises
116116
gradle clean
117117
cd ~/workspace/exercism/exercises
118118
exercism fetch java bob
119119
```
120-
121-
122-
# License
123-
124-
The MIT License (MIT)
125-
126-
Copyright (c) 2014 Katrina Owen, _@kytrinyx.com
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ repositories {
99
dependencies {
1010
testCompile "junit:junit:4.12"
1111
}
12+
1213
test {
1314
testLogging {
1415
exceptionFormat = 'full'

0 commit comments

Comments
 (0)