- Notifications
You must be signed in to change notification settings - Fork0
javaeeeee/xjava
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Source for Exercism Exercises in Java.
For general information about how to contribute to Exercism, please refer to theContributing Guide.
- Overview
- Contributing With Minimal Setup
- Getting Familiar With the Codebase
- Advanced: Complete Local Setup
This guide covers contributing to the Java track. If you are new, this guide is for you.
If, at any point, you're having any trouble, pop in theGitter exercism/dev room for help.
First things first: by contributing to Exercism, you are making this learning tool that much better and improving our industry as a whole... thank you!!!
To submit a fix for an existing exercise or port an exercise to Java with the least amount of setup:
Ensure you have the basic Java tooling installed: JDK 1.8+, an editor and Gradle 2.x.
Setup a branch on a fork ofexercism/xjava on your computer.
SeeGitHub Help: Forking. Use those instructions (in conjunction withExercism Contributing Guide) to:
- "fork" a repository on GitHub;
- install
git; - "clone" a copy of your fork;
- configure an "upstream remote" (in this case,
exercism/xjava); - create a branch to house your work
Write the codes. Do your work on that branch you just created.
TheGetting Familiar With the Codebase section, below, is an orientation.
Commit, push and create a pull request.
Something like:
$ git add .$ git commit -m "(An intention-revealing commit message)"$ git pushExercism Contributing Guide :: Commit Messages provides practical advice on crafting meaningful commit messages.
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.
There are two objectives to the design of this build:
- 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);
- when a problem is built outside the xjava repo (when a participant is solving the exercise), the tests run against the "main" code.
This repo is a mulit-project gradle build.
This is the top-level module, contained in theexercises directory. It is a container for the problem sub-modules.
- it's
build.gradlepoints the "main" sourceset to the example code. - it's
settings.gradlenames each of the subprojects, one for each problem in the set.
Theexercises subdirectory contains all of the problem submodules.Each problem/submodule is a subdirectory of the same name as its slug.
- it's
build.gradlenames dependencies required to work that problem.
Each problem/submodule has three source sets:
src/test/java/— a test suite defining the edges of the problemsrc/example/java/— an example solution that passes all the testssrc/main/java/— starter source files, if required/desired(this directory usually only has a.keepfile in it).
If you are going to make significant contribution(s) to the track, you might find it handy to have a complete local install of exercism on your computer. This way, you can run the full suite of tests without having to create/update a PR.
The easiest way to achieve this is simply use thebin/journey-test.sh script. However, you may want to perform other tests, depending on what you are doing. You can do so by duplicating the setup performed by thebin/journey-test.sh script.
If youexercism fetch after doing a build, the CLI will fail with the following error message:
$ exercism fetch java bob2015/09/06 15:03:21 an internal server error was received.Please file a bug report with the contents of 'exercism debug' at: https://github.com/exercism/exercism.io/issuesand if you review the logs of your x-api, you'll find:
127.0.0.1 - - [06/Sep/2015:15:20:56 -0700] "GET /v2/exercises/java/bob HTTP/1.1" 500 514949 0.21382015-09-06 15:21:01 - JSON::GeneratorError - source sequence is illegal/malformed utf-8: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 yourxjava repo before you fetch:
cd ~/workspace/exercism/xjava/exercisesgradle cleancd ~/workspace/exercism/exercisesexercism fetch java bobThe MIT License (MIT)
Copyright (c) 2014 Katrina Owen,_@kytrinyx.com
About
Exercism Exercises in Java
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Languages
- Java96.9%
- Shell3.1%