mahmoudparsian / data-algorithms-book

MapReduce, Spark, Java, and Scala for Data Algorithms Book
http://mapreduce4hackers.com
Other
1.07k stars 666 forks source link

Switch to Gradle build and JUnit (or other) tests #3

Closed slangeberg closed 10 years ago

slangeberg commented 10 years ago

Hi Mahmoud - I just got your book on early release from O'Reilly. I like it so far, and was interested in whether I can help you improve on your examples. This merge would add Gradle build system support. This includes dependency management like Maven, which would mean you could drop the jars in your /lib. Take a look at the build.gradle file, and you'll find it's much more compact than anything you can do in Ant, as Gradle and Maven favor convention over configuration.

You can run the chap 5 test now by running (*nix): $ cd /data-algorithms-book $ ./gradlew clean test

Windows:

gradlew.bat clean test

gradlew is a gradle wrapper that will pull down its own dependencies the first time, then run much faster, so that you don't have to manage gradle installation locally, if you don't want to.

Let me know what you think.

slangeberg commented 10 years ago

You may find that Spock is a good option for testing framework, as you can easily set up a set of scenarios with various inputs and expected outputs, such as their datatable example:

http://spock-framework.readthedocs.org/en/latest/data_driven_testing.html#data-tables

mahmoudparsian commented 10 years ago

Hello Scott,

Thank you very much for your interest in my book.

I will read your email and reply ASAP.

If possible, please send your comments on the book to me as well: mparsian@yahoo.com

Thank you! best regards, Mahmoud On Oct 11, 2014, at 2:59 PM, slangeberg notifications@github.com wrote:

Hi Mahmoud - I just got your book on early release from O'Reilly. I like it so far, and was interested in whether I can help you improve on your examples. This merge would add Gradle build system support. This includes dependency management like Maven, which would mean you could drop the jars in your /lib. Take a look at the build.gradle file, and you'll find it's much more compact than anything you can do in Ant, as Gradle and Maven favor convention over configuration.

You can run the chap 5 test now by running (*nix): $ cd /data-algorithms-book $ ./gradlew clean test

Windows:

gradlew.bat clean test

gradlew is a gradle wrapper that will pull down its own dependencies the first time, then run much faster, so that you don't have to manage gradle installation locally, if you don't want to.

Let me know what you think.

Scott You can merge this Pull Request by running

git pull https://github.com/slangeberg/data-algorithms-book master Or view, comment on, or merge it at:

https://github.com/mahmoudparsian/data-algorithms-book/pull/3

Commit Summary

Added basic gradle build and .gitignore Added groovy support; Added two dependencies successfully; Down to 15 compile errors in gradle added apache math and hadoop-client dependencies added apache math and hadoop-client dependencies Converted test to JUnit test. Added hamcrest matchers File Changes

A .gitignore (38) A build.gradle (47) A gradle/wrapper/gradle-wrapper.jar (0) A gradle/wrapper/gradle-wrapper.properties (6) A gradlew (164) A gradlew.bat (90) A settings.gradle (19) R src/test/java/org/dataalgorithms/chap05/PairOfWordsTest.java (19) Patch Links:

https://github.com/mahmoudparsian/data-algorithms-book/pull/3.patch https://github.com/mahmoudparsian/data-algorithms-book/pull/3.diff — Reply to this email directly or view it on GitHub.

mahmoudparsian commented 10 years ago

added gradle build

mahmoudparsian commented 10 years ago

Hi Scott,

Can you please update the README.md so that the reader can build with your added build scripts. (after a section, how to build for Python…).

Thanks, Mahmoud

On Oct 11, 2014, at 3:34 PM, Parsian, Mahmoud mparsian@yahoo.com wrote:

Hello Scott,

Thank you very much for your interest in my book.

I will read your email and reply ASAP.

If possible, please send your comments on the book to me as well: mparsian@yahoo.com

Thank you! best regards, Mahmoud On Oct 11, 2014, at 2:59 PM, slangeberg notifications@github.com wrote:

Hi Mahmoud - I just got your book on early release from O'Reilly. I like it so far, and was interested in whether I can help you improve on your examples. This merge would add Gradle build system support. This includes dependency management like Maven, which would mean you could drop the jars in your /lib. Take a look at the build.gradle file, and you'll find it's much more compact than anything you can do in Ant, as Gradle and Maven favor convention over configuration.

You can run the chap 5 test now by running (*nix): $ cd /data-algorithms-book $ ./gradlew clean test

Windows:

gradlew.bat clean test

gradlew is a gradle wrapper that will pull down its own dependencies the first time, then run much faster, so that you don't have to manage gradle installation locally, if you don't want to.

Let me know what you think.

Scott You can merge this Pull Request by running

git pull https://github.com/slangeberg/data-algorithms-book master Or view, comment on, or merge it at:

https://github.com/mahmoudparsian/data-algorithms-book/pull/3

Commit Summary

Added basic gradle build and .gitignore Added groovy support; Added two dependencies successfully; Down to 15 compile errors in gradle added apache math and hadoop-client dependencies added apache math and hadoop-client dependencies Converted test to JUnit test. Added hamcrest matchers File Changes

A .gitignore (38) A build.gradle (47) A gradle/wrapper/gradle-wrapper.jar (0) A gradle/wrapper/gradle-wrapper.properties (6) A gradlew (164) A gradlew.bat (90) A settings.gradle (19) R src/test/java/org/dataalgorithms/chap05/PairOfWordsTest.java (19) Patch Links:

https://github.com/mahmoudparsian/data-algorithms-book/pull/3.patch https://github.com/mahmoudparsian/data-algorithms-book/pull/3.diff — Reply to this email directly or view it on GitHub.

slangeberg commented 10 years ago

My pleasure!

mahmoudparsian commented 10 years ago

Thank you so much! On Oct 13, 2014, at 10:47 AM, slangeberg notifications@github.com wrote:

My pleasure!

— Reply to this email directly or view it on GitHub.