Skip to content

Commit fcf899f

Browse files
Merge branch 'master' into two-fer
2 parents 29b0d2d + cef5fa7 commit fcf899f

156 files changed

Lines changed: 2397 additions & 641 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.

.github/stale.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.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

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Hi! Thanks for contributing to the Exercism Java track!
2+
3+
Before opening your pull request, please review the track policies linked below and make sure your changes comply with them all. This helps us focus our review time on the more important aspects of your changes.
4+
5+
- [Prefer instance methods](https://github.com/exercism/java/blob/master/POLICIES.md#prefer-instance-methods)
6+
- [Starter implementations](https://github.com/exercism/java/blob/master/POLICIES.md#starter-implementations)
7+
- [Ignore noninitial tests](https://github.com/exercism/java/blob/master/POLICIES.md#ignore-noninitial-tests)
8+
- [Multiple file submissions](https://github.com/exercism/java/blob/master/POLICIES.md#multiple-file-submissions)

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: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Our policies are not set-in-stone. They represent directions chosen at a point i
3030

3131
> 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.
3232
33-
References: [[1](https://github.com/exercism/xjava/issues/177#issuecomment-261291741)]
33+
References: [[1](https://github.com/exercism/java/issues/177#issuecomment-261291741)]
3434

3535
### Starter implementations
3636

@@ -40,28 +40,32 @@ References: [[1](https://github.com/exercism/xjava/issues/177#issuecomment-26129
4040
`throw new UnsupportedOperationException("Delete this statement and provide your own implementation.");`
4141
> - 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).
4242
43-
References: [[1](https://github.com/exercism/xjava/issues/178)]
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.
4448
4549
### Ignore noninitial tests
4650

4751
> 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).
4852
49-
References: [[1](https://github.com/exercism/xjava/issues/101#issuecomment-249349204)]
53+
References: [[1](https://github.com/exercism/java/issues/101#issuecomment-249349204)]
5054

5155
### Multiple file submissions
5256

5357
> 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.
5458
55-
References: [[1](https://github.com/exercism/xjava/issues/365#issuecomment-292533120)]
59+
References: [[1](https://github.com/exercism/java/issues/365#issuecomment-292533120)]
5660

5761
### Good first patches
5862

59-
> 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/xjava/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+patch%22).
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).
6064
61-
References: [[1](https://github.com/exercism/xjava/issues/220#issue-196447088)]
65+
References: [[1](https://github.com/exercism/java/issues/220#issue-196447088)]
6266

6367
### Simple onboarding
6468

6569
> 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.
6670
67-
References: [[1](https://github.com/exercism/xjava/issues/395#issue-215734887)]
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

_template/build.gradle

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apply plugin: "java"
2+
apply plugin: "eclipse"
3+
apply plugin: "idea"
4+
5+
repositories {
6+
mavenCentral()
7+
}
8+
9+
dependencies {
10+
testCompile "junit:junit:4.12"
11+
}
12+
13+
test {
14+
testLogging {
15+
exceptionFormat = 'full'
16+
events = ["passed", "failed", "skipped"]
17+
}
18+
}
File renamed without changes.

0 commit comments

Comments
 (0)