пятница, 14 июня 2013 г.

Meet Gretty: gradle plugin for running web-applications under Jetty 8.1.8

I created little gradle plugin for running web-applications under Jetty 8.1.8.

The main advantage for a programmer is that now it’s possible to use servlet-api 3.0 and higher (under standard gradle-jetty plugin it was not possible, because jetty was too old).

Full sources, documentation and examples here:

https://github.com/akhikhl/gretty

пятница, 7 июня 2013 г.

Gradle script: multiproject git-gradle management

Suppose you build your software project from many open-source components, most of which are already available via git. How to automate clone/pull/build/install cycle, especially across projects from different git-repositories? How to establish high-level inter-project dependencies?

For that I wrote gradle script, which implements multiproject git-gradle management. It works as follows: you write configuration file, name it “config.gradle”, put it to the same folder as “build.gradle” (of multiproject git-gradle) and then run “gradle build”.

Full documentation and sources are available at:
https://github.com/akhikhl/multiproject-git-gradle

четверг, 6 июня 2013 г.

Automated git-pull

Suppose you have 20 git-repositories, which you actively pull and push from/to central location (e.g. github). Don't you think pulling them by hand is too mechanical? And what if you forget to pull some?

I wrote little gradle script capable of automated git-pull:

https://gist.github.com/akhikhl/5727210

You drink your morning coffee and the machine does the job for you.

Credits come to the creators of excellent gradle-git plugin:

https://github.com/ajoberstar/gradle-git

среда, 5 июня 2013 г.

Programming for fun: script for batch installation of maven artifacts

I created gradle script that delivers batch installation of maven artifacts to local maven repository (source code here: https://github.com/akhikhl/contribs).

The script supports two tasks - installContribs and cleanContribs - but can be extended with additional tasks (for example, implementing deployment to corporate repo).

how installContribs task works:

1. you call it with the command-line:

gradle -b contribs.gradle 
(or you rename script to "build.gradle" and just put it somewhere in the multi-project tree, it will be called by gradle automatically).

2. installContribs task iterates the current folder (where the script resides) and all it's subfolders.

3. in each folder it iterates files with extension "pom".

4. for each found pom-file it looks for ".jar", "-sources.jar" and "-javadoc.jar" and install all found files (together with pom) to the local maven repository.

5. pom-file without jars will be installed as an artifact on it's own. Typical use-case: installation of parent-poms and aggregator-poms.

The script accurately calculates inputs/outputs. If all files were not changed since the last installation, it does not install anything and shows "UP-TO-DATE" in the console.

cleanContribs task makes script "forget" about the time of the last artifact installation. As the result, running script with installContribs task will install all artifacts anew.

Programming for fun: script for mass checksum (MD5 and SHA1) calculation in the file system.

I created little gradle script for mass checksum (MD5 and SHA1) calculation in the file system:

https://github.com/akhikhl/checksums

At the beginning that was more like exercise in using gradle for non-compilation tasks and in integrating apache-commons into gradle script.

Now, I think, I will do more gradle than bash, because gradle scripts are: a) portable b) have access to limitless power of all java libraries.

воскресенье, 2 июня 2013 г.

суббота, 1 июня 2013 г.

checkableRows example (jQuery)

Example of checkableRows, selectableRows and focusable behavior

Example of checkableRows, selectableRows and focusable behavior.

Use mouse, UP, DOWN and SPACE keys.
Allow multiple selection (click with CTRL or SHIFT key).
Product IdArtistAlbumYearI like it
001BeatlesPlease Please Me1963
002BeatlesA Hard Day's Night1964
003BeatlesYellow Submarine1969
004Rolling StonesDecember's Children (And Everybody's)1965
005Rolling StonesBeggars Banquet1968
006Rolling StonesGoats Head Soup1973
Selected product Ids: []
Checked product Ids: []
Log:
If you feel interested, see checkableRows source code and documentation and more examples on a separate page.