Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ To submit a fix for an existing exercise or port an exercise to Java with the le

There are two objectives to the design of this build:

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;
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 reference solution;
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.

This repo is a multi-project gradle build.
Expand All @@ -74,7 +74,7 @@ This repo is a multi-project gradle build.

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

* its `build.gradle` points the "main" sourceset to the example code.
* its `build.gradle` points the "main" sourceset to the reference solution.
* its `settings.gradle` names each of the subprojects, one for each problem in the set.

### The Problem Submodules
Expand All @@ -87,7 +87,7 @@ Each problem/submodule is a subdirectory of the same name as its slug.
Each problem/submodule has three source sets:

* `src/test/java/` — a test suite defining the edges of the problem
* `src/example/java/` — an example solution that passes all the tests
* `./meta/src/reference/java/` — a reference solution that passes all the tests
* `src/main/java/` — starter source files, if required/desired *(this directory usually only has a `.keep` file in it)*.

----
Expand Down
4 changes: 2 additions & 2 deletions bin/journey-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ solve_all_exercises() {
echo "=================================================="

${exercism_cli} fetch ${TRACK} $exercise
cp -R -H ${track_root}/exercises/${exercise}/src/example/${TRACK}/* ${exercism_exercises_dir}/${TRACK}/${exercise}/src/main/${TRACK}/
cp -R -H ${track_root}/exercises/${exercise}/.meta/src/reference/${TRACK}/* ${exercism_exercises_dir}/${TRACK}/${exercise}/src/main/${TRACK}/

pushd ${exercism_exercises_dir}/${TRACK}/${exercise}
# Check that tests compile before we strip @Ignore annotations
Expand Down Expand Up @@ -275,7 +275,7 @@ solve_single_exercise() {
echo "=================================================="

${exercism_cli} fetch ${TRACK} $exercise_to_solve
cp -R -H ${track_root}/exercises/${exercise_to_solve}/src/example/${TRACK}/* ${exercism_exercises_dir}/${TRACK}/${exercise_to_solve}/src/main/${TRACK}/
cp -R -H ${track_root}/exercises/${exercise_to_solve}/.meta/src/reference/${TRACK}/* ${exercism_exercises_dir}/${TRACK}/${exercise_to_solve}/src/main/${TRACK}/

pushd ${exercism_exercises_dir}/${TRACK}/${exercise_to_solve}
# Check that tests compile before we strip @Ignore annotations
Expand Down
3 changes: 2 additions & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -678,5 +678,6 @@
"grains",
"say"
],
"language": "Java"
"language": "Java",
"solution_pattern": "reference"
}
8 changes: 4 additions & 4 deletions exercises/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// This root Gradle project is used for:
//
// - Checking that every test suite compiles against its corresponding example implementation;
// - Checking that every example implementation passes its corresponding test suite;
// - Checking that every test suite compiles against its corresponding reference implementation;
// - Checking that every reference implementation passes its corresponding test suite;
// - Checking that every provided starter implementation compiles.
//
// This file is never delivered to Exercism users.
Expand All @@ -28,10 +28,10 @@ subprojects {
afterEvaluate { project ->

sourceSets {
// Set the directory containing the example implementation as the default source set. Default
// Set the directory containing the reference solution as the default source set. Default
// compile tasks will now run against this source set.
main {
java.srcDirs = ["src/example/java"]
java.srcDirs = [".meta/src/reference/java"]
}

// Define a custom source set named "starterSource" that points to the starter implementations
Expand Down