This repository aimed to help you verify your task submission.
Choose one of the paths:
-
Check your submission file
>Move to Java layout - Using simple directory structure (1st method)
>Upload your project to github
. -
Check your submission file
>Move to Java layout - Using Gradle (2nd method)
>Upload your project to github
.
Note: All your Java classes MUST have an empty constuctor (constuctor with no arguments) && Getters&Setters for each class attribute!See
tests/
directory and try it out, passing all the checks doesn't mean you passed all the tests!
- Check your submission file
- Move to Java layout - Using simple directory structure (1st method)
- Move to Java layout - Using Gradle (2nd method)
- Upload your project to github
The submission file should be as follows:
<url for git clone>
<commit>
<ids>
For example - submission_file.txt
content:
https://github.com/Avielyo10/oop-dummy.git
f1de90bdb776222364d967d9b3bc7396ec053e0f
123456789_123456789
Run check_submission
: python check_submission.py <submission_file.txt>
.
For example:
❯ python check_submission.py submission_file.txt
=== OUTPUT ===
git repository is: https://github.com/Avielyo10/oop-dummy.git
IDs are: 123456789_123456789
Commit: f1de90bdb776222364d967d9b3bc7396ec053e0f
See if the details are right, if not - fix your <submission_file>.
Please put a valid git repository url - not git@
/gist
/wiki
/etc. - if you can't git clone <url for git clone>
then your repo is invalid - which means grade will be 0
.
-
The project is now at https://github.com/<YOUR_GITHUB_USERNAME>/oop-verifier.
-
Delete the content of
submission_file.txt
and put yours. Save it and push it to your repositry from above (3.
). -
Follow github help manual to create a pull request from a fork. The
base fork
is https://github.com/Avielyo10/oop-verifier and thehead fork
is https://github.com/<YOUR_GITHUB_USERNAME>/oop-verifier. -
You will see an orange dot next to your pull request, that's mean that I'm checking your
submission_file.txt
and it's content. If it turns on to greenV
then it's all good, redX
means something went wrong. You can click on it to see what went wrong with your project or if it succeeded. See the marks here (relates only to greenV
& redX
):
oop/ <-- (1)
├── resources.txt <-- (2)
└── src
├── main
│ └── java
│ └── Ex1 <-- (3)
│ └── someClass.java <-- (4)
└── test
└── java
└── Ex1 <-- (3)
└── someClassTest.java <-- (5)
-
(1) - Main directory, give it any name you want(just not
test
/java
). From here you initialize git. -
(2) -
resources.txt
- when using external libraries you can choose either unzip thejar
file into your project or write it onresources.txt
as follows: Go to https://search.maven.org/ and search for yourjar
(for example:gson
).
Click on the version.
On your right you'll see this:
Copy and paste it as it is toresources.txt
(including the wordimplementation
) - Example inresources.txt
. -
(3) - Package name is important. For tasks 0 & 1, put your java classes under
Ex1
, for the 2nd task onEx2
and so on. Onsrc/test/java
you MUST use the same package names assrc/main/java
-
(4) - Java classes for tasks 0 & 1, they all should import
package Ex1;
, for task 2 importpackage Ex2;
and so on. -
(5) - Junit class MUST have the same name ends with
Test
(see(4)
) and of course under the same package name! SeeComplexFunctionTest.java
for example.
See https://github.com/Avielyo10/oop-dummy
From now on your git repository must have the following layout: (Looks scary but we will do it in baby steps, don't worry)
oop/
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
├── main
│ ├── java
│ │ └── oop
│ │ └── App.java
│ └── resources
└── test
├── java
│ └── oop
│ └── AppTest.java
└── resources
Click here to download gradle to your computer.
On MacOS - just run: brew install gradle
.
Unzip the distribution zip file in the directory of your choosing, e.g.:
❯ mkdir /opt/gradle
❯ unzip -d /opt/gradle gradle-5.6.2-bin.zip
❯ ls /opt/gradle/gradle-5.6.2
LICENSE NOTICE bin getting-started.html init.d lib media
Create a new directory C:\Gradle
with File Explorer
.
Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-5.6.2
to your newly created C:\Gradle
folder.
Alternatively, you can unpack the Gradle distribution ZIP into C:\Gradle
using an archiver tool of your choice.
To run Gradle, the path to the unpacked files from the Gradle website need to be on your terminal’s path. The steps to do this are different for each operating system.
Configure your PATH
environment variable to include the bin directory of the unzipped distribution, e.g.:
❯ export PATH=$PATH:/opt/gradle/gradle-5.6.2/bin
Alternatively, you could also add the environment variable GRADLE_HOME
and point this to the unzipped distribution. Instead of adding a specific version of Gradle to your PATH
, you can add $GRADLE_HOME/bin
to your PATH
. When upgrading to a different version of Gradle, just change the GRADLE_HOME
environment variable.
In File Explorer
right-click on the This PC (or Computer) icon, then click Properties → Advanced System Settings → Environmental Variables
.
Under System Variables
select Path
, then click Edit
. Add an entry for C:\Gradle\gradle-5.6.2\bin
. Click OK
to save.
Alternatively, you could also add the environment variable GRADLE_HOME
and point this to the unzipped distribution. Instead of adding a specific version of Gradle to your Path
, you can add %GRADLE_HOME%/bin
to your Path
. When upgrading to a different version of Gradle, just change the GRADLE_HOME
environment variable.
❯ mkdir oop
❯ cd oop/
❯ gradle init --type java-application
Select all the defaults (by pressing Enter
on each step).
Create oop
directory move into it and run gradle init --type java-application
using cmd
or powershell
.
Select all the defaults (by pressing Enter
on each step).
❯ cd oop/
❯ gradle clean test
=== OUTPUT ===
BUILD SUCCESSFUL in 801ms
4 actionable tasks: 4 executed
Only the BUILD <STATUS>
matters.
oop/
├── build.gradle <-- This file over here
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
├── main
│ ├── java
│ │ └── oop
│ │ └── App.java
│ └── resources
└── test
├── java
│ └── oop
│ └── AppTest.java
└── resources
Go to build.gradle
and delete all its conetnt, copy & paste this instead:
plugins {
// Apply the java plugin to add support for Java
id 'java'
id "com.gradle.build-scan" version "3.1.1"
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// This dependency is used by the application.
implementation 'com.google.guava:guava:28.0-jre'
implementation 'com.google.code.gson:gson:2.3.1'
// Use JUnit test framework
testImplementation 'org.junit.jupiter:junit-jupiter:5.5.2'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
You can also find it here.
❯ gradle clean test
=== OUTPUT ===
BUILD SUCCESSFUL in 801ms
4 actionable tasks: 4 executed
Go to oop/src/main/java/
, create new directory Ex1
(not - eX1
/ex1
/EX1
/Ex0
/etc.)
Move your files there. Make sure that every Java class has package Ex1;
line at the top.
Now your layout should look something like that:
oop/
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
├── main
│ ├── java
│ │ ├── Ex1 <-- Right here
│ │ │ ├── complex_function.java
│ │ │ ├── cont_function.java
│ │ │ ├── function.java
│ │ │ ├── functions.java
│ │ │ ├── Monom_Comperator.java
│ │ │ ├── Monom.java
│ │ │ ├── Operation.java
│ │ │ ├── Polynom_able.java
│ │ │ ├── Range.java
│ │ │ └── StdDraw.java
│ │ └── oop
│ │ └── App.java
│ └── resources
└── test
├── java
│ └── oop
│ └── AppTest.java
└── resources
❯ gradle clean test
=== OUTPUT ===
BUILD SUCCESSFUL in 801ms
4 actionable tasks: 4 executed
See Move to Java layout - Using simple directory structure (1st method) on resources.txt
((2)
).
oop/ <-- This directory
├── build.gradle
├── gradle
│ └── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
└── src
├── main
│ ├── java
│ │ ├── Ex1
│ │ │ ├── complex_function.java
│ │ │ ├── cont_function.java
│ │ │ ├── function.java
│ │ │ ├── functions.java
│ │ │ ├── Monom_Comperator.java
│ │ │ ├── Monom.java
│ │ │ ├── Operation.java
│ │ │ ├── Polynom_able.java
│ │ │ ├── Range.java
│ │ │ └── StdDraw.java
│ │ └── oop
│ │ └── App.java
│ └── resources
└── test
├── java
│ └── oop
│ └── AppTest.java
└── resources
git init
git add .
git commit -m "<your commit message here>"
git remote add origin <your git repository>
git push -u origin master
Your project layout needs to look similarly to this layout.