Java icon indicating copy to clipboard operation
Java copied to clipboard

Convert the repository into a Java project

Open varunu28 opened this issue 8 years ago • 74 comments

@christianbender @AnupKumarPanwar @dynamitechetan

This is something which something which we have discussed in the past and have been raised by multiple users of the repo. The repo can be converted to a complete Java project with correct package structure, JUnit tests and Java language standard checkers. I want that anyone who is adding a new algorithm should add respective tests and follow a set coding standard so that the repo can become more usable for users who can then clone it into a local IDE and work on it.

Similar to Scala Repo

I propose that we create a development branch on which we can start making the changes and replace it with the master once it fulfills the above-mentioned requirement. I would like to take the initiative and start this task.

Please share your feedback.

varunu28 avatar Jul 29 '18 17:07 varunu28

@MarisaAfuera You would have to fork the repo first and then when you cd into the repo on your local machine, you need to switch to development branch using git checkout Development

varunu28 avatar Aug 27 '18 16:08 varunu28

@Varun I'm going to try it from eclipse. Thank you.

El lun., 27 ago. 2018 a las 18:35, Varun Upadhyay ([email protected]) escribió:

@MarisaAfuera https://github.com/MarisaAfuera You would have to fork the repo first and then when you cd into the repo on your local machine, you need to switch to development branch using git checkout Development

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheAlgorithms/Java/issues/474#issuecomment-416286523, or mute the thread https://github.com/notifications/unsubscribe-auth/ASac7J8TAVfcOdtRIUT4urIBfZyhgHJfks5uVB_jgaJpZM4VlgEF .

MarisaAfuera avatar Aug 27 '18 16:08 MarisaAfuera

@MarisaAfuera I suppose eclipse also has a very good Git support(Not sure about exact setup)

If you face any issues on eclipse, I would advice you to run this command through a terminal

varunu28 avatar Aug 27 '18 17:08 varunu28

@varun. Thanks. I have installed a plugin for git. I could change the repository in my local environment to development. Now I look for something to do.

El lun., 27 ago. 2018 19:10, Varun Upadhyay [email protected] escribió:

@MarisaAfuera https://github.com/MarisaAfuera I suppose eclipse also has a very good Git support(Not sure about exact setup)

If you face any issues on eclipse, I would advice you to run this command through a terminal

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheAlgorithms/Java/issues/474#issuecomment-416297102, or mute the thread https://github.com/notifications/unsubscribe-auth/ASac7Pvl8fRrBPMlHUhQ7e7xUkYrv8giks5uVCgagaJpZM4VlgEF .

MarisaAfuera avatar Aug 27 '18 21:08 MarisaAfuera

@varunu28 is there any progress on this issue? if not much, I will work on this tonight, and create a PR

burnz248 avatar Aug 27 '18 22:08 burnz248

@burnz248 The Development branch is created and instructions for opening a PR have been updated in the README of the branch

varunu28 avatar Aug 27 '18 23:08 varunu28

After forking, cloning and checking out to the Development I noticed that the structure of the project is not conventional, at least as I far as I've seen. The structure we usually see is this:

  • src\main\java\com\example
  • src\test\java\com\example

With this we have the same packages for both source and tests: com.example I don't know about Eclipse because I will not using it right now, but IntelijIDEA complains a lot with the current structure. I think we can agree that a package structure which appears the "src" folder like here "src.main.com.java.conversions" is not conventional. What do you think? Would it be better to make this change, it would be too much trouble for the rest of the collaborators?

Leoat12 avatar Aug 28 '18 01:08 Leoat12

@Leoat12 I have the project opened in IntelliJ and it shows a green mark in the IDE. I have a vanilla setup of IntelliJ and it is showing no issues. Can you please check if you have any kind of checker enabled?

varunu28 avatar Aug 28 '18 02:08 varunu28

I think he is referring to the standard Gradle project layout.

—Aleksandr Diamond


From: Varun Upadhyay [email protected] Sent: Monday, August 27, 2018 8:21:22 PM To: TheAlgorithms/Java Cc: Diamond, Aleksandr S; Comment Subject: Re: [TheAlgorithms/Java] Convert the repository into a Java project (#474)

@Leoat12https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FLeoat12&data=01%7C01%7Casdiamond%40miners.utep.edu%7Ca356130fee1641d23a8308d60c8cf327%7C857c21d21a1643a490cfd57f3fab9d2f%7C1&sdata=r%2BCelB7rl%2BYs1P4cKnXeMM039SsRrrZ0h6SEqX59Fjs%3D&reserved=0 I have the project opened in IntelliJ and it shows a green mark in the IDE. I have a vanilla setup of IntelliJ and it is showing no issues. Can you please check if you have any kind of checker enabled?

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FTheAlgorithms%2FJava%2Fissues%2F474%23issuecomment-416429054&data=01%7C01%7Casdiamond%40miners.utep.edu%7Ca356130fee1641d23a8308d60c8cf327%7C857c21d21a1643a490cfd57f3fab9d2f%7C1&sdata=hVpjhh0qsfUXP9WADfvnw%2FUxDn7nzrdW4txgByqYTnI%3D&reserved=0, or mute the threadhttps://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FAVe8OIhjZqlAvEDI_TJZWcT-ZGOFjQk9ks5uVKkigaJpZM4VlgEF&data=01%7C01%7Casdiamond%40miners.utep.edu%7Ca356130fee1641d23a8308d60c8cf327%7C857c21d21a1643a490cfd57f3fab9d2f%7C1&sdata=nXCDeoTSYlJc%2B8wxgwCUNUbW%2FnzZs3JxYb%2Fb9VKMmv0%3D&reserved=0.

asdiamond avatar Aug 28 '18 02:08 asdiamond

@asdiamond As of now we are not considering any build tool. We are focussing on building a basic java project with complete test coverage.

varunu28 avatar Aug 28 '18 02:08 varunu28

@Varun @Leonardo @Aleksandr Althought there are a lot of ways to make package structure, I think that we must to have an standard way for the project.

I've seen that for PR "add Test for InsertionSort #494", the autor has created the test package. Maybe because there aren't enough details in readme file.

Maybe you can add in readme.md of the DEVELOPMENT branch:

El mar., 28 ago. 2018 a las 4:28, Varun Upadhyay ([email protected]) escribió:

@asdiamond https://github.com/asdiamond As of now we are not considering any build tool. We are focussing on building a basic java project with complete test coverage.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/TheAlgorithms/Java/issues/474#issuecomment-416430097, or mute the thread https://github.com/notifications/unsubscribe-auth/ASac7F2ZU0kryknLiXzczZdgif1Il364ks5uVKq0gaJpZM4VlgEF .

MarisaAfuera avatar Aug 28 '18 15:08 MarisaAfuera

@MarisaAfuera @Leoat12 I have updated the project structure now.

varunu28 avatar Aug 28 '18 20:08 varunu28

I Suggest to make a new branch that for this issue and merge it when it's ready or change it to be master branch. This idea is best thing can be happen to this repo , excited to see it happening soon.

cyberkhalil avatar Aug 30 '18 13:08 cyberkhalil

@khalil2535 Already created a Development branch and people have started contributing to it. Please refer Development branch for more details

varunu28 avatar Aug 30 '18 21:08 varunu28

@varunu28 hello i am completely new to github . it will great if you would guide me i will love to contribute , currently i am learning java so i can help with all my efforts thanks

bhati-lokendra avatar Sep 29 '18 18:09 bhati-lokendra

Sure @bhati-lokendra . You can start by adding tests to Development branch. Please refer the README before making the changes. Do let me know if you face any issues

varunu28 avatar Sep 29 '18 18:09 varunu28

What about adding Travis CI in the developement branch?

NeverMendel avatar Oct 01 '18 19:10 NeverMendel

@NeverMendel That would be really helpful for testing as the tests are going to increase with time on the development branch

varunu28 avatar Oct 01 '18 19:10 varunu28

Do we really need this? As we are planning to go ahead with a website also for the organization where students can learn algorithms and their implementation in various programming languages. So for the automated fetching or the code from repositories using Github APIs, I think keeping them in single file codes will be beneficial down the line.

AnupKumarPanwar avatar Oct 02 '18 12:10 AnupKumarPanwar

@AnupKumarPanwar It would be helpful if a beginner wants to pull the complete project on their local and want to change the code, tests would be beneficial. Also, someone trying to contribute to the repository, tests would be helpful in verifying their changes. The project structure and the test automation teaches the best Java practices along with the algorithms and keeps the repository in a systematic way.

As far as the website is concerned, we can make some changes to the API script to fetch codes from this project structure also. Great initiative btw. I was not aware of it and would be happy to be a part of this.

varunu28 avatar Oct 02 '18 13:10 varunu28