Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Git,Travis,Gradle

This is a short introduction to Git, Travis, and Gradle, alls used at command line and jointly with Github. It contains some examples and a few simple exercises that make you to get use to the commands. For further information, please see https://www.blogger.com/blogger.g?blogID=6687556278632539882#editor/target=post;postID=5021188629184529191;onPublishedMenu=allposts;onClosedMenu=allposts;postNum=0;src=postname

  • Login to see the comments

  • Be the first to like this

Git,Travis,Gradle

  1. 1. Git, Gradle andTravis CI: a short guide to start with them Mercoledì, febbraio 1, 17 Marialaura Bancheri 1
  2. 2. New Project 1)  Create your project on Eclipse 2)  Create you repo on gitHub and save the https 3)  git init (to initialize the new repository) 4)  git remote add origin https://yourhttps 5)  git status 6)  git add ( the changes or the new files) 7)  git commit –m “first commit” 8)  git push origin master Mercoledì, febbraio 1, 17 Marialaura Bancheri 2
  3. 3. New Branch 1)  git checkout -b HelloWorldMonday 2)  do your changes on the branch..(git add, commit, push origin HelloWorldMonday) 3)  git checkout master 4)  git merge HelloWorldMonday 5)  git push origin master 6)  git branch –d HelloWorldMonday Mercoledì, febbraio 1, 17 Marialaura Bancheri 3
  4. 4. Copying an existing project 1)  git clone https//yourhttps 2)  import from eclipse an existing project into workspace Mercoledì, febbraio 1, 17 Marialaura Bancheri 4
  5. 5. Also useful -  git status -  git pull (to upgrade the repo) -  git log (to see the history of the repo) -  git tag -a v0.1 -m "Just another test" -  git push origin v0.1 -  git rm (to remove undesired files) -  http://rogerdudler.github.io/git-guide/ Mercoledì, febbraio 1, 17 Marialaura Bancheri 5
  6. 6. Gradle: how to create a new project 1) Install Gradle plugin on Eclipse (help àEclipse Marketplace) Mercoledì, febbraio 1, 17 Marialaura Bancheri 6
  7. 7. Gradle: how to create a new project 2) Create a new Gradle Project - 1/2 Mercoledì, febbraio 1, 17 Marialaura Bancheri 7
  8. 8. Gradle: how to create a new project 3) Create a new Gradle Project -2/2 Mercoledì, febbraio 1, 17 Marialaura Bancheri 8
  9. 9. Gradle: what’s in a Gradle project? Mercoledì, febbraio 1, 17 Marialaura Bancheri 9 Codes Tests build.gradle
  10. 10. !!! Gradle: what’s more in a Gradle project respect to an Eclipse project? Mercoledì, febbraio 1, 17 Marialaura Bancheri 10
  11. 11. build.gradle Mercoledì, febbraio 1, 17 Marialaura Bancheri 11
  12. 12. build.gradle – Water Budget Project Mercoledì, febbraio 1, 17 Marialaura Bancheri 12
  13. 13. build.gradle – Water Budget Project Mercoledì, febbraio 1, 17 Marialaura Bancheri 13
  14. 14. How to transform an old project into a Gradle project Mercoledì, febbraio 1, 17 Marialaura Bancheri 14 1)  Clone the project https://github.com/Mariolina88/HelloWorldWithTest.git 2)  Open the project and see how it is organized 3)  Reorganize sub-folders : src/main/java/helloWorldWithTest/HelloWorldWithTest.java src/test/java/test/HelloWorldTest.java 4)  Create or import the build.gradle file (see the folder helps of the project) 5)  Import the project in eclipse as a Gradle Project and test it!
  15. 15. Create a new repo! Mercoledì, febbraio 1, 17 Marialaura Bancheri 15 1)  Create a repo on your personal git profile with the Gradle HelloWorld! 2) Push your changes on it: - First way: delete the folder .git from your project and start with the new repo! (see slide 2, points 3-8); - Second way: git remote –v (to check the old remote) git remote set-url origin https://yourhttps git remote –v (to check the new remote) git status (it is always good to see what’s going on) git push origin master
  16. 16. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 16 1) Go on your new repository page
  17. 17. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 17 2) Settings à Integrations and services 3) Add service and find Travis CI
  18. 18. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 18 4) Click on https://travis-ci.org/profile
  19. 19. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 19 5) Sing in with GitHub
  20. 20. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 20 6) Find in the list of your repos, the HelloWorldWithGradleTest and activate it
  21. 21. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 21 6) Creat the file travis.yml for the project (see the folder helps of the project)
  22. 22. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 22 6) Add the file travis.yml to the project and commit to the repo 7) if everything is working you will see in the commit page a green thick
  23. 23. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 23 8) Click on the thick and see the Travis page with the info on the test
  24. 24. Travis CI Mercoledì, febbraio 1, 17 Marialaura Bancheri 24 More info can be found at: Getting started: https://docs.travis-ci.com/user/getting-started/ Encryption key: https://docs.travis-ci.com/user/encryption-keys/
  25. 25. That’s all folks! Mercoledì, febbraio 1, 17 Marialaura Bancheri 25

×