понедельник, 27 октября 2014 г.

Gretty 1.1.5 is out!

Hello people,

Gretty version 1.1.5 is out and immediately available at github, bintray, maven central and gradle plugin portal!

Gretty is a feature-rich gradle plugin for running webapps on Jetty and Tomcat. Sources available here:
https://github.com/akhikhl/gretty

What’s new in Gretty 1.1.5:
Full list of changes: https://github.com/akhikhl/gretty/blob/master/changes.md

I would be thankful for your feedback, bug reports and suggestions :)

вторник, 16 сентября 2014 г.

Gretty 1.1.3 is out!

I'm happy to announce that Gretty 1.1.3 is out!

New in Gretty 1.1.3: virtual mapping of gradle dependencies (of the web-application) to "WEB-INF/lib" directory. This feature is needed by some web frameworks accessing jar files in "WEB-INF/lib" (e.g. Freemarker).

Special thanks to @saladinkzn (Timur Shakurov) for introducing this nice feature.

Up-to-date Gretty sources are always available at:

 https://github.com/akhikhl/gretty

Gretty documentation: http://akhikhl.github.io/gretty-doc/

All Gretty releases are also available as maven artifacts at jcenter and maven central.

среда, 3 сентября 2014 г.

среда, 11 июня 2014 г.

Powerful feature in Gretty 0.0.24 - full support of Spring Boot 1.1.0

Today is a wonderful day: Spring Boot 1.1.0 was released and I released Gretty version 0.0.24.

Gretty is a feature-rich gradle plugin for running web-apps on Jetty. It supports multiple Jetty versions (7, 8 and 9), multiple web-apps and many more. It wraps Jetty functions as convenient Gradle tasks and configuration DSL. A complete list of Gretty features is available in feature overview.

There is new powerful feature in Gretty 0.0.24: it supports running Spring Boot web-apps out-of-the-box. All Gretty features, including (but not limited to) debugging, code coverage and integration tests, also apply to spring-boot web-apps.

Simplest Gretty setup with Spring Boot:

You get Gretty as maven artifacts at jcenter and maven central under the group "org.akhikhl.gretty".

Full Gretty sources and examples are available at https://github.com/akhikhl/gretty

Full Gretty documentation is available at http://akhikhl.github.io/gretty-doc/  

понедельник, 5 мая 2014 г.

Wuff version 0.0.1 is out! Gradle plugin for assembling OSGi/Eclipse-RCP/Eclipse-IDE

Today I release Wuff version 0.0.1!

Wuff is a gradle plugin for automating OSGi/Eclipse-RCP/Eclipse-IDE bundles and applications assembly. It is analog to Eclipse Tycho, but with all power and beauty of gradle.

Full sources and documentation are available here: https://github.com/akhikhl/wuff

Wuff is also available at jcenter and maven central.

пятница, 4 апреля 2014 г.

Gretty version 0.0.15 is out!

I release Gretty (gradle plugin for jetty) version 0.0.15!

New: fast-reload of webapp-resources, jdk8-compatibility.

Sources and documentation at https://github.com/akhikhl/gretty.

Also available on jcenter & maven central!

среда, 29 января 2014 г.

суббота, 25 января 2014 г.

Gitbucket – your own github-like web-application without a hassle

Meet gitbucket – your own github-like web-application, requiring minimum configuration:

https://github.com/takezoe/gitbucket

Features:
  • out-of-the-box HTTP access to git repositories (in browser and from command line)
  • web-based user management
  • web-based repository management
  • issue management, pull-requests, wiki, etc.
Not yet implemented features:
  • out-of-the-box SSH support (or integration with SSH-supporting solutions like gitolite)
  • online editing
My impression: this is very interesting application that I will certainly use as soon as missing features get implemented.

четверг, 23 января 2014 г.

gradle-onejar plugin version 0.0.5 is out!

I just released gradle-onejar plugin version 0.0.5!

The sources are available at https://github.com/akhikhl/gradle-onejar.

gradle-onejar is a gradle plugin, automating assembly of java application to a single runnable jar.

The plugin is available in maven central under coordinates “org.akhikhl.gradle-onejar:gradle-onejar:0.0.5″

It has many configuration options, described in online documentation.

Your comments and suggestions are welcome – here and at github!

суббота, 18 января 2014 г.

I released Gretty version 0.0.8!

I released Gretty version 0.0.8! 

New: support of “jetty.xml” and “jetty-env.xml”.

Gretty is gradle plugin for running web-applications under jetty 7, 8 and 9 and servlet API 2.5, 3.0.1 and 3.1.0. It greatly simplifies and accelerates web-application development by providing:
  • hot-deployment
  • war-overlays
  • java debugger support
  • jetty security realms support
  • jetty.xml and jetty-env.xml support
  • slf4j/logback support
The complete sources and documentation are available at https://github.com/akhikhl/gretty

The compiled jars are in maven central under group 'org.akhikhl.gretty'

вторник, 10 декабря 2013 г.

понедельник, 28 октября 2013 г.

groovy script for running jetty server

The following script starts jetty server and opens the folder, specified on command line, for http access (read-only):
Usage:
  1. Save this script to file “jetty.groovy”
  2. Invoke on command-line:
    groovy jetty.groovy /path/to/some/folder"
  3. Enter address in web-browser:
    http://localhost:8080/jetty
Expected result: you see the content of the folder “/path/to/some/folder” in the web-browser.

пятница, 20 сентября 2013 г.

groovy switch: nasty bug

I found nasty error in Groovy compiler. Consider the following code:

1
2
3
4
5
6
7
8
byte b = 1
switch(b) {
  case 0..9:
    println 'it is between 0 and 9'
  break
  default:
    println 'it is something else'
}

It executes 'default' part, not the part with 0..9, which is not what a programmer would typically expect.
The reason behind it should be related to type conversion between "byte" and "int" types. With the following workaround:

1
swtch((int)b)

the program executes "proper" case.

среда, 4 сентября 2013 г.

groovy: switch statement and closure comprehension – nice for DSL

It is rather easy to extend groovy switch statement with our own DSL:


The trick here is that single-argument versions of IsGreaterThan, IsLessThan return closures. Switch-statement “understands” closures: it passes it’s argument (x in our case) as a parameter to the closure and expects boolean result being returned from the closure.Same thing can be done via function currying, but it looks not so nice, as with function overload.

среда, 7 августа 2013 г.

Groovy DSL == thermonuclear way of writing XML

The code:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import groovy.xml.MarkupBuilder

String createEAD(Closure closure) {
  def writer = new StringWriter()
  def xml = new MarkupBuilder(writer)
  xml.mkp.xmlDeclaration(version: '1.0', encoding: 'UTF-8')
  xml.'ead:ead'('xmlns:ead': 'urn:isbn:1-931666-22-9') {
    closure.delegate = new Object() {
      def text(Map attrs, content) {
        def a = attrs.keySet().find { it in ['bold', 'italic', 'underline'] }
        if(a && attrs[a]) {
          xml.'ead:emph' render: a, {
            text attrs.findAll({ it.key != a }), content
          }
        } else
          text content
      }
      def text(content) {
        if(content instanceof String)
          xml.mkp.yield content
        else if(content instanceof Closure)
          content()
      }
    }
    closure()
  }
  return writer.toString()
}

println createEAD {
  text bold: true, italic: true, {
    text 'Hello, '
    text underline: true, 'world!'
  }
}


produces XML:

1
2
3
4
5
6
7
8
<?xml version='1.0' encoding='UTF-8'?>
<ead:ead xmlns:ead='urn:isbn:1-931666-22-9'>
  <ead:emph render='bold'>
    <ead:emph render='italic'>Hello, 
      <ead:emph render='underline'>world!</ead:emph>
    </ead:emph>
  </ead:emph>
</ead:ead>

Firefox 23: Javascript is always ON

From Firefox 23 Release Notes:
"Enable JavaScript" preference checkbox has been removed and user-set values will be reset to the default
YESSS!!! javascript is now always ON, it is not even possible to turn it off! Other browsers, unite!
Bureaucrats will probably have to reconsider what they mean under Barrierefreiheit.

вторник, 6 августа 2013 г.

Partial interface implementation in groovy

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
interface X {
  void a()
  void b()  
}

class XAdapter implements X {
  void a() { println 'default implementation of a' }
  void b() { println 'default implementation of b' }
}

def o = [ 
  a: { println 'overridden implementation of a' } 
] as XAdapter

o.a()
o.b()
will output:
overridden implementation of a
default implementation of b