Aaron Babcock | 25 Oct 13:13 2014
Picon

[groovy-user] 10/25/2014 11:13:17 AM r

http://trngayrimenkul.com/hvu/borbrhagnrygvaxaaknis.pyiprljqhrdeg










Aaron Babcock

Keith Wedinger | 24 Oct 20:28 2014

[groovy-user] Groovy based tests not compiled / executed inside Android project

I am currently doing the following to develop an Android app. This project will contain a mixture of Java source and Groovy source.

Gradle 2.1 via wrapper

Plugins:
gradle-groovy-android-plugin:0.3.0
me.champeau.gradle:gradle-groovy-android-plugin:0.3.0

Dependencies:
compile 'com.android.support:support-annotations:20.0.0'
compile 'org.codehaus.groovy:groovy:2.4.0-beta-3:grooid'
compile ('org.codehaus.groovy:groovy-json:2.4.0-beta-1') {
    transitive = false
}

I am organizing my source as follows. This conforms to the Gradle based Android project structure so build.gradle should not need a sourceSets definition.

Main source:
src/main/java/<package dirs>/*.java
src/main/groovy/<package dirs>/*.groovy

Tests:
src/androidTest/java/<package dirs>/*.java
src/androidTest/groovy/<package dirs>/*.groovy

When I build my APK, the resultant APK contains the compiled Java and Groovy classes from src/main and all works as expected.
When I run ./gradlew connectedCheck to build and execute the tests, the Java based tests are the only ones that compile and execute. The Groovy based tests are ignored.
I can force IntelliJ IDEA to run the Groovy based tests by marking src/androidTest/groovy as a test source root. Unfortunately, this setting is stored inside workspace.iml which by convention is not committed to Git. And doing this has no impact on command line builds.

How can I get the command line build to compile and execute the Groovy based tests?

--
Keith Wedinger
Solutions Architect
Leading EDJE



This message is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you have received it by mistake please let us know by e-mail reply, delete it from your system, and know that any review, dissemination, distribution, or copying of this message is strictly prohibited. The integrity and security of this message cannot be guaranteed on the internet.
Keith Wedinger | 24 Oct 14:44 2014

[groovy-user] Incorrect Groovyc compilation errors inside Android Groovy project

I am using gradle-groovy-android-plugin:0.3.0, com.android.tools.build:gradle:0.13.+ and groovy:2.4.0-beta-3:grooid. When building my Android project which has a Groovy class that extends DialogFragment, I am getting the Groovyc compilation errors listed below.

Error:(46, 9) Groovyc: [Static type checking] - Cannot find matching method android.util.Log#d(java.lang.Object, java.lang.String). Please check if the declared type is right and if the method exists.
Error:(61, 9) Groovyc: [Static type checking] - Cannot find matching method android.os.Bundle#putInt(java.lang.Object, int). Please check if the declared type is right and if the method exists.
Error:(78, 9) Groovyc: [Static type checking] - Cannot find matching method android.util.Log#d(java.lang.Object, java.lang.String). Please check if the declared type is right and if the method exists.
Error:(86, 36) Groovyc: [Static type checking] - Cannot find matching method android.os.Bundle#getInt(java.lang.Object). Please check if the declared type is right and if the method exists.
Error:(86, 26) Groovyc: [Static type checking] - Cannot find matching method com.crown.ivhm.dialog.CrownProgressGroovyDialog#getString(java.lang.Object). Please check if the declared type is right and if the method exists.
Error:(84, 9) Groovyc: [Static type checking] - Cannot find matching method android.widget.TextView#setText(java.lang.Object). Please check if the declared type is right and if the method exists.

Links to the source file in question and build.gradle are below. I have checked / double checked the imports in the source file and everything looks correct. And build.gradle appears to be configured correctly. Any ideas?


--
Keith Wedinger
Solutions Architect
Leading EDJE



This message is confidential. It may also be privileged or otherwise protected by work product immunity or other legal rules. If you have received it by mistake please let us know by e-mail reply, delete it from your system, and know that any review, dissemination, distribution, or copying of this message is strictly prohibited. The integrity and security of this message cannot be guaranteed on the internet.
Rice Yeh | 24 Oct 05:19 2014
Picon

[groovy-user] Where does this method come from?

I find code like below

assert [1, 2, 3].sum() == 6

I just wonder where sum() method come from since ArrayList does not have sum method?
Tonton Sancho | 23 Oct 15:22 2014
Picon

[groovy-user] Adding IntegerMetaClass to GroovyShell dynamically

Hi all Groovy community,

I would like to use a custom IntegerMetaClass only in a given GroovyShell context.

The reason why is to not pollute the whole runtime with my potentially 'disturbing' IntegerMetaClass.

It works like a charm when I put my IntegerMetaClass.java implementation in the magic package groovy.runtime.metaclass.java.lang. But, when I try to add it manually to an intermediate GroovyClassLoader, it stops working.

// Pseudo-code without try catch, etc // Within my eval factory GroovyClassLoader gcl = new GroovyClassLoader(getClass().getClassLoader()); URL url = getClass().getClassLoader().getResource("groovy/runtime/metaclass/java/lang/IntegerMetaClass.groovy"); // I rename it to .groovy file GroovyCodeSource gcs = new GroovyCodeSource(url); Class> clazz = gcl.parseClass(gcs); // clazz is not null here and equals to what I expect: // Class // Now trying to use it in a groovy shell GroovyShell gs = new GroovyShell(gcl); gs.evaluate("10.minutes"); // Where .minutes is part of my IntegerMetaClass // Fail with an NoSuchProperty exception

Do I miss something to do on GroovyClassLoader more than just 'parsing' the MetaClass ? Anywhere else ?

Thanks so much in advance,

Christophe


View this message in context: Adding IntegerMetaClass to GroovyShell dynamically
Sent from the groovy - user mailing list archive at Nabble.com.
Jamie Echlin | 22 Oct 10:13 2014
Picon

[groovy-user] more informative comments in spock assertions

Hi,

I use assertions quite a lot, relying on that the comment is also displayed in the message. It would help a lot to be able to include interpolated variables in the comment... is it possible?

For example, looking up some value from a map where the user provides the key... I would like to be able to do:

def foo = map.userInput

assert foo // Could not find value for input: $userInput

I know this is simplistic, and could be written:

assert userInput in map.keySet()

but I do have many real-world examples where this would be very useful. Any ideas?

cheers, jamie

Keegan Witt | 20 Oct 18:34 2014
Picon

[groovy-user] Considering renaming some GMavenPlus goals

I recently realized some GMavenPlus goals don't follow the naming convention (the mojo got renamed, but not the goal).  I have no idea how I overlooked this so long.  I'm currently considering renaming
addTestSources -> testAddSources
addTestStubSources -> testAddStubSources
removeTestStubs -> testRemoveStubs

Much as I despise inconsistency, part of me is hesitant to make this change, since it'd mean folks would have to edit their pom after upgrading to get things working again (albeit a small edit).  The only other option I could think of is to extend each mojo using the alternate goal name, which would do nothing but call the parent.  The downside is, this would appear to the user as a clone (but deprecated in the Maven site), and not an alias.  I'm pretty sure Maven has no concept of aliased goals.

I opened a Jira to collect feedback and document the decision (http://jira.codehaus.org/browse/GMAVENPLUS-33).  I'd appreciate your opinion (even if you don't use GMavenPlus).

-Keegan

Jochen Theodorou | 20 Oct 10:49 2014
Picon

Re: [groovy-user] Bug Report ? Bad bytecode in MarkupTemplateEngine under 2.3.7 indy / JDK 7.0.50

Am 18.10.2014 13:58, schrieb Dean Jones:
> Sure, it fails on Mac with Java 1.7.0_55 and Linux 1.7.0_67, the basic
> code is in a utility class, Groovy, with  <at> CompileStatic, it was being
> built with the
> groovy-all-2.3.7-indy.jar, built using Gradle 2.0 with the indy compile
> flag set
>
> tasks.withType(GroovyCompile) {
>      groovyOptions.optimizationOptions.indy = true
> }
>
> Running in Tomcat 7.0.5X, generated from a REST call
>
> If I remove the indy libs and the indy compile flag from the entire app,
> and go back to non-indy, it all works as expected, no issues.

The problem is described in 
https://jira.codehaus.org/browse/GROOVY-6951, looks like I forgot to put 
1.7u55 on the list too. Anyway... the short story is: this is a JVM bug, 
not a groovy bug. It does not always happen, but we don't really have a 
way around it either. Updating to jdk1.7u72 or higher should resolve the 
problem

bye blackdrag

--

-- 
Jochen "blackdrag" Theodorou - Groovy Project Tech Lead
blog: http://blackdragsview.blogspot.com/
german groovy discussion newsgroup: de.comp.lang.misc
For Groovy programming sources visit http://groovy-lang.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

Russel Winder | 17 Oct 20:11 2014
Picon

[groovy-user] Emacs Modes – news and breaking changes

I have created the GitHub group Groovy-Emacs-Modes holding the
repository groovy-emacs-modes and pushed my Emacs-Groovy-Mode repository
to it, deleted my repository and cloned the new mainline as my new
version. This repository includes groovy-mode, grails-mode, and the
associated bits and pieces. I have created a pull request to MELPA for
an update to the repository location and to include grails-mode as well
as groovy-mode.

I have emailed the owner of the current gradle-mode asking if
collaboration and integration is appropriate. I am hoping the person
says yes.

Anyone interested in helping maintain the Emacs support for all the Gr8
technologies should feel free to contact me off the mailing list, so we
can set up appropriate collaborations.

(Whatever anyone claims, Emacs is the One True Editor™ ;-)

https://github.com/Groovy-Emacs-Modes/groovy-emacs-modes

--

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder <at> ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@...
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
Dinko Srkoč | 17 Oct 14:37 2014
Picon

[groovy-user] Traits and field assignments as expressions

Hi all,

Consider the following code:

class A { def foo def getBar() { foo = 42 } } def a = new A() assert a.bar == 42 assert a.foo == 42

The above code works because assignment in Groovy is treated as an expression, so assigning the value 42 to the field foo also returns the assigned value.

Now, let’s make A into a trait and see what happens:

trait A { def foo def getBar() { foo = 42 } } class C implements A {} def a = new C() assert a.bar == null // ... a bit unexpected assert a.foo == 42

So, what gives?

Using the AST Browser it can be seen that getBar() calls A$Trait$Helper.getBar(this), which in turn calls $self.A_foo$set(42) which returns void ($self is an instance of C) - hence null that getBar() returns.

In this particular case the traits’ semantics differs from the usual Groovy one for assignment. Should this be considered a bug?

Something similar to the above example bit me while I was replacing some <at> Mixins with traits.

Cheers,
Dinko

Russel Winder | 16 Oct 20:57 2014
Picon

[groovy-user] Re: [gpars-user] Using Concurrency and Parallelism Effectively

Jon,

Apologies for being very late seeing this. Python workshops and
Java/Groovy conferences are my excuses.

On Tue, 2014-09-30 at 09:54 +0000, Kerridge, Jon wrote:
> Hi,
> 
> I have just had published a book, in two parts, on Concurrency and
> Parallelism using the Java CSP libraries with, crucially, Groovy
> helper classes to make them much easier to use.
> 
> These are electronic books, available free, as follows:
> 
> Using Concurrency and Parallelism Effectively – I
> http://bookboon.com/en/using-concurrency-and-parallelism-effectively-i-ebook

I have downloaded this one and will give it a read just as soon as I
can.

> Using Concurrency and Parallelism Effectively – II
> http://bookboon.com/en/using-concurrency-and-parallelism-effectively-ii-ebook
> 
This one seems to require some sort of subscription so I'll read the
first part and then see what the deal is.

> The books have support software available from the same web site that
> contains the code of all the examples used and the line numbers in the
> book and the software match making it easy to use the book on an
> e-reader and the software on a workstation.

--

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder <at> ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel@...
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder

Gmane