Date post: | 14-Apr-2018 |
Category: |
Documents |
Upload: | denis-minimalist |
View: | 220 times |
Download: | 0 times |
of 39
7/30/2019 Rake as build tool in java and other projects
1/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 1
Rake as build management tool
for developers and project managers
Denis Lutz
7/30/2019 Rake as build tool in java and other projects
2/39
AgendaRake for Developers
The Hyphothesis about Ant
Hello World from Rake
Ant Hypothesis proove 1
Rake for Project Managers
Ant Hypothesis proove 2
Case Study The Perfect Build
Riskmanagement
3 Improvements you can make with rake
2
7/30/2019 Rake as build tool in java and other projects
3/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 3
Ant
We use ant in java projects
build management
deployments
initial project setup / configurations
product data load
7/30/2019 Rake as build tool in java and other projects
4/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 4
Ant
Hypothesis
1. Ant is not sufficient for what we want to do
2. We dont use Ant often enough to learn it properly
Solution: RAKE!
7/30/2019 Rake as build tool in java and other projects
5/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 5
Rake
What is Rake (from JRuby) ?
build management language based on ruby
domain specific language (DSL) for builds based on ruby
rake for ruby is like ant for java the build management tool
existing rake version in jruby
rake from jruby is able to call any other ant task or target (!)
7/30/2019 Rake as build tool in java and other projects
6/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 6
What is rake?
Download jruby at http://jruby.org/download
http://jruby.org/downloadhttp://jruby.org/download7/30/2019 Rake as build tool in java and other projects
7/39Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 7
What is rake?
Calling a core ant taskrake is a plain mapping to the ant java classes!
We can call any task or target that ant has!
7/30/2019 Rake as build tool in java and other projects
8/39Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 8
What is rake?
Create a task that is dependent on the unzip taskIt should create a folder and move the unzipped file into it
7/30/2019 Rake as build tool in java and other projects
9/39Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 9
nt is not sufficient for what we want to do
1. Ant is not sufficient for what we want to do.
Not anymore since we have better choices.It was created as no scripting languages were supporting java.
What are we usually doing with Ant?
Back to Hypothesis
7/30/2019 Rake as build tool in java and other projects
10/39Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 10
nt is not sufficient for what we want to do
build management
deployments
initial project setup
data load (csv, fixtures)
cron job execution
moving / copying / deleting files or directories
writing to files
processing data sets
building dependencies on coditions
7/30/2019 Rake as build tool in java and other projects
11/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 11
nt is not sufficient for what we want to do
moving / copying / deleting files and directories
Ant: Looks pretty simple right? Just couple lines, markup was always easy
Rake: I want to do operations as would it be in a unix environment, and rake realizes it:
7/30/2019 Rake as build tool in java and other projects
12/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 12
nt is not sufficient for what we want to do
processing a data set (Array) in a loop
Ant: See, for anything that a normal language has, ant has a markup version of it
Ant: So you will be always fine and be able to write what you want
Rake: Well lets just take a scripting language then like ruby
Rake: and by the way, can you use unique ant syntax somewhere else ouside the build scripts?
7/30/2019 Rake as build tool in java and other projects
13/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 13
nt is not sufficient for what we want to do
Ant: Yea, conditions are definded on
the tasks themselves, since its all about tasks.
7/30/2019 Rake as build tool in java and other projects
14/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 14
nt is not sufficient for what we want to do
Rake: thats all we wanted:
7/30/2019 Rake as build tool in java and other projects
15/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 15
nt is not sufficient for what we want to do
Rake: How about some methods to dont repeat yourself in the build?
Ant: Methods??? Your kidding me right? Targets are your methods, or create a macrodef
Ant: If it gets too complicated soo create your java class and call it from ant
Dude, I just want a method ok?
So attribute is clear thats what I need
Whats the deal with the ?
What is the suppose to mean?
So I predefine what tasks I will call inside my new macro ?
Should I always use sequential ?
Ant: Here is the macrodef syntax Rake:
7/30/2019 Rake as build tool in java and other projects
16/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 16
nt is not sufficient for what we want to do
Rake: Watch, thats what I want..
7/30/2019 Rake as build tool in java and other projects
17/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 17
nt is not sufficient for what we want to do
Rake: I want to create some objects in my script
Ant: Objects??? Lets not exagerrate here ok?
Ant: If its that complicated just create a custom ant task with a java class
Rake: Yea, its like object orientation = elegance , so we should use it directly in the script
7/30/2019 Rake as build tool in java and other projects
18/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 18
nt is not sufficient for what we want to do
Ant: LOL, it should not be that complicated
Ant: unless you really want to fly to the moon
Rake: Well lets say I have a deployment script and I deal with servers
Rake: This is what I could do with object orientation, all this in one file, within mins
7/30/2019 Rake as build tool in java and other projects
19/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 19
Ant is not sufficient for what we want to do
elegant
powerful
maintable
easy understanble
no external classes to do it
7/30/2019 Rake as build tool in java and other projects
20/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 20
nt is not sufficient for what we want to do
Why project managersshould love rake?
7/30/2019 Rake as build tool in java and other projects
21/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 21
nt is not sufficient for what we want to do
2. We dont use Ant often enough to learn it properly
We have proper ant experience only at the project setup
its mostly done by one dedicated person
everyone else is not familiar with ant and the build script
developers tend to do fast adjustments to the script using the ant api
you are good with ant if you worked with it for a longer time
the ant knowledge can not be used somewhere else
developers have no motivation to learn it properly
trivial language construtcs in ant are too complicated to remember
7/30/2019 Rake as build tool in java and other projects
22/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 22
nt is not sufficient for what we want to do
Why would it be different with rake?
rake is a subset of ruby => ruby syntax
jruby can be declared as the core scripting language in each (java) project anyways
because we need ruby for: data import, front end, parsing, any scripting language tasks
the knowledge of rake ( = ruby ) is a good investment for developers
ruby is a great, simple, elegant and powerfull language
developers can do with ruby knowledge much more then with same amount of ant knowledge
7/30/2019 Rake as build tool in java and other projects
23/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 23
But java has its scripting languages
But java has its scripting languages..
Why dont we use groovy, beanshell, jsr?
ruby has a bigger community then the java scripting languages (proofes on next slides)
ruby knowledge is reused much more in projects with ruby if declared as scripting language
front ends can be written in ruby on rails
ruby knowledge can be reused much more on the US market
java scripting languages = languages that are running on jvm
well, ruby runs on jvm too, so same integration as e.g. groovy
7/30/2019 Rake as build tool in java and other projects
24/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 24
nt is not sufficient for what we want to do
Ruby gained a lot of popularity within the scripting languages
7/30/2019 Rake as build tool in java and other projects
25/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 25
nt is not sufficient for what we want to do
Rails competes with JSF in the meanwhile, which indirectly shows thepower and acceptance of the ruby language on the us market.
7/30/2019 Rake as build tool in java and other projects
26/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 26
mprovements we could reach by using rake
1. Setting up the project initially and for any new team member
2. Working with the project everyday
3. Deployment management
Which parts of your java project can be improved by using rake?
7/30/2019 Rake as build tool in java and other projects
27/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 27
mprovements we could reach by using rake
1. Setting up the project initially and for any new team member
setting up the system always a time consuming task
knowledge is mostly party written on the wiki and outdated
no one really knows what the project setup steps are
the older the project the more out of sync is it
the project setup takes usually the time of the new person and one team member
At the end you loose a lot of time, instead of initially investing little bit more!
7/30/2019 Rake as build tool in java and other projects
28/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 28
mprovements we could reach by using rake
What database do I need? What are the database properties?Where should I configure them?
Who should I ask about it?
Where is the wiki page about this project?
I have a windows machine,are there any differences to a macs?
What should I writeinto my hosts file?
What the a new member feels at the project setup:
How do I start this special backend / front end / solr server?
7/30/2019 Rake as build tool in java and other projects
29/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 29
mprovements we could reach by using rake
How can we fix it? = What can be automated? = Run in one workflow?
Git/SVN Checkout
Local database setup (setting up mysql/oracle + create database)
Unzipping of vendor files (commercial integrated systems, solr, patches)
Cofiguration files setup: user setting + default + environment
Build (starting automatically)
Database initialization (without entering any client)
different data imports (* n times)
other step by a cronjob (* n times)
server startup (front end, back end, solr, any other server)
commercial integrated system configuration
generating data load files with ruby (just another ruby script execution
7/30/2019 Rake as build tool in java and other projects
30/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 30
mprovements we could reach by using rake
1. The project itself should know about its setup, not the wiki, it will be outdated and lost
2. The only one thing that the user should do is the database installation and checkout
3. Even in the manual steps, the user should be guided by the rake script
using of rake as much a more powerful tool then ant dedicated person in each project responsible for the build maintenance
project planned time investment for a complete project setup by a build investment will immidiatelly pay off, with a new team member at the latest
thinking in a perspective of a beginner who has no project knowledge
thinking in a perspective of one big setup workflow without interruptions
7/30/2019 Rake as build tool in java and other projects
31/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 31
mprovements we could reach by using rake
Demo / Case Study
The perfect project setup
Hi, how are you doing? . Yea, nice to meet you and welcome.
My manager told me to help you to setup your system
You are a junior developer? Got you, you just starting, no problem
You have a mac? Great. So here is what I want you to do:
1. Install jruby http://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.zip
2. Unzip and add it to your classpath, so it works from console
3. Checkout out the trunk of the project http://yourdomain.com/svn/fromjavatoruby/trunk
4. During the checkout, you can install mysql if you dont have it yet, create a mysql user
5. Then just call jruby S rake full_project_setup , the script will guide you from there
http://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.ziphttp://arvatosystems-us.com/svn/fromjavatoruby/trunkhttp://arvatosystems-us.com/svn/fromjavatoruby/trunkhttp://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.ziphttp://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.ziphttp://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.ziphttp://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.ziphttp://jruby.org.s3.amazonaws.com/downloads/1.5.3/jruby-bin-1.5.3.zip7/30/2019 Rake as build tool in java and other projects
32/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 32
mprovements we could reach by using rake
Demo / Case Study
The perfect Project Setup, what did we do? :
SVN Checkout --> manually
Local database setup (setting up mysql/oracle + create database) (still potentially automatable)
Unzipping of vendor files (solr, patches) DONE
Cofiguration files setup: user setting + default + environment DONE
Build (starting automatically) DONE
Database initialization (without entering the webclient) DONE
different data imports (* n times) DONE
other step by a cronjob (* n times) DONE
server start up / which beanshell script should I call? DONE started, informed the user how to do it
solr setup and startup / how should I call it, on which port is it running? (same as config step
7/30/2019 Rake as build tool in java and other projects
33/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 33
Perfect Build: Highlights
7/30/2019 Rake as build tool in java and other projects
34/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 34
mprovements we could reach by using rake
Demo / Case Study
The perfect Project Setup, why was that much more time and money saving?
did the user need any project specific knowledge yet? No did he need to ask someone for something? No did he need to look up a wiki page and wait till his account on it is created? No even if there was a manual step we were exactly telling the user what to do at the right time
our assumtion for now was: he works on a mac / unix system
he had to be able to install mysql database by himself
he should have been able to check out the project
7/30/2019 Rake as build tool in java and other projects
35/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 35
mprovements we could reach by using rake
Why the rake integration has no risks for any java environment?
jruby rake runs on the java virtual machine and calls the old ant tasks
we have the old ant build.xml still inside the project
we can go back to ant all the time, just by adding old ant targets
jruby is used anyways if this is the official project scripting language
so we are not introducing something new to our standard setup
7/30/2019 Rake as build tool in java and other projects
36/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 36
Improvements: Working with the project everyday
each developer should get familiar with the build
the build is your source for any automation
server starts (back end/ sorl/ front end/ any server)
cronjob execution (instead of looking it up in a client and executing)
repetitive data load (you work on a data load and need repetitive execution)
any new task that can be added, is easy to add with rake
2. Working with the project everyday
7/30/2019 Rake as build tool in java and other projects
37/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 37
Improvements: Deployment management
3. Deployment management
granular understandable / maintable
same advantages as for the project setup apply
ivy integration
7/30/2019 Rake as build tool in java and other projects
38/39
Denis Lutz/ Rake as buildmanagement tool for developers and managers03/09/13 38
Conslusion
Conclusion/Suggestions
ant => has weak points, was ok a long time, but its time to move on
rake => great new option to use, has a lot of synergies and is fun
separate discussion needed for deployments strategy based on rake
start saving money and time today
start having smooth builds today
7/30/2019 Rake as build tool in java and other projects
39/39
Thanks
Thanks
Questions?