These are chat archives for jruby-gradle/jruby-gradle-plugin

5th
Jun 2015
Schalk W. Cronjé
@ysb33r
Jun 05 2015 07:13
I don't really know. I just use the default template. I would say though, that it is better to render the html from asciidoctor and then push those pages to gh-pages, rather than let github render the pages.
Christian Meier
@mkristian
Jun 05 2015 08:41
@ysb33r some integration tests use gems "${OUR_GEM}@gem" what does this @gem means ? what does it do ?
Schalk W. Cronjé
@ysb33r
Jun 05 2015 08:49
@mkristian It refers to the extension. flatDir repoS do not have any metadata like maven and ivy and always defaults to look to find .jar. So doing that, tells it to look for .gem.
Christian Meier
@mkristian
Jun 05 2015 08:50
wow - thanks. that explains all my problems I do have
Christian Meier
@mkristian
Jun 05 2015 09:30
@rtyler @ysb33r updated my PR. I did setup a mavenRepo under src/integ/mavenRepo with live maven-metadata.xml but with empty gem files. they do install but have no content. the test will not produce any traffic but has extra disk usage of 150kB
R. Tyler Croy
@rtyler
Jun 05 2015 13:04
@mkristian heh, that's fine to me
Christian Meier
@mkristian
Jun 05 2015 13:08
yes, I will :)
but the integration test was bothering me and felt important
rtyler @rtyler nods
R. Tyler Croy
@rtyler
Jun 05 2015 13:31
testing is good :)
@ysb33r I have a question about some of your trait refactoring
R. Tyler Croy
@rtyler
Jun 05 2015 13:40
@ysb33r this code regresses some behavior that I added (which was poorly tested, mea culpa)
@ysb33r I'm wondering why it's necessary to stringize the args?
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:42
not sure about that code, also wonderwing why you are using underscores in names
R. Tyler Croy
@rtyler
Jun 05 2015 13:42
I didn't write that _convert method, you did I think
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:42
stringize normally only used for public task methods to perform just-in-time conversion form obj->string
R. Tyler Croy
@rtyler
Jun 05 2015 13:43
the behavior that I added without really talking to much about it, was the ability to pass closures as scriptArgs which can have deferred evaluation
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:43
agh yes, if was me
R. Tyler Croy
@rtyler
Jun 05 2015 13:43
heh
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:43
stringize should do that for you, I think.
I am now getting confused which Gradle utilities do.
hold on
BTW the underscores were to work around something in Gradle + traits
R. Tyler Croy
@rtyler
Jun 05 2015 13:49
orly
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:49
code is wrong if you want to do that (i had to look this up in my own book preview!!)
    List<String> getScriptArgs() { 
        CollectionUtils.stringize( 
            this.scriptArgs.collect {  it ->
                it instanceof Closure ? (it as Closure).call() : it 
            } .flatten() 
        )
    }
R. Tyler Croy
@rtyler
Jun 05 2015 13:50
ah, I'll update
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:51
that is a pretty smart piece of code - it will also flatten out collecitons found in collections
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:56
sometimes I think it would be worthwhile creating a grade-contrib library will all sorts of stuff like that in
haha, since I attending an AST masterclass by Andres this week, maybe I’ll do it as an AST :)
R. Tyler Croy
@rtyler
Jun 05 2015 13:57
ew
Schalk W. Cronjé
@ysb33r
Jun 05 2015 13:59

just think if all you needed to write was

@GradleInputs( flatten=true, closures=true )
LIst<String> scriptArgs

and it added all of the necessary code for you

R. Tyler Croy
@rtyler
Jun 05 2015 14:00
that's pretty magical though
R. Tyler Croy
@rtyler
Jun 05 2015 14:12
@ysb33r where is the appropriate place to put trait tests?
I do not see a JRubyExecTraitSpec.groovy
Schalk W. Cronjé
@ysb33r
Jun 05 2015 14:21
I did not test the trais, I tested the class the implements the trait. Groovy Traits cannot be instantiated.
So in this case if would be in JRubyExec or JRubyExecDelegate
rtyler @rtyler nods
ysb33r @ysb33r is context swtiching between too much of late
R. Tyler Croy
@rtyler
Jun 05 2015 14:28
alrighty, I've got a change tested and ready, woot
#127 enqueued
Schalk W. Cronjé
@ysb33r
Jun 05 2015 14:42
You’ve done too much in that code IMHO. Your change to the internals of _convertScriptArgs would have been more than enough. Not sure why you still want to carry List<Object> through - it might end up not being serializable, which is a requirement for Gradle properties
R. Tyler Croy
@rtyler
Jun 05 2015 14:44
already corrected :)
Schalk W. Cronjé
@ysb33r
Jun 05 2015 14:44
:+1:
R. Tyler Croy
@rtyler
Jun 05 2015 14:44
if Mr. Travis is okay with it I'll merge
Schalk W. Cronjé
@ysb33r
Jun 05 2015 14:44
you’ll need to put the stringize back as well
Ignore that
I just re-read the code
R. Tyler Croy
@rtyler
Jun 05 2015 14:45
\o/
R. Tyler Croy
@rtyler
Jun 05 2015 15:31
@mkristian do you have more work-in-progress changes for #126 coming? I'd like to get both of our changes prepped for 0.2.2 release
Christian Meier
@mkristian
Jun 05 2015 15:31
give me 15 minutes to round it up
R. Tyler Croy
@rtyler
Jun 05 2015 15:34
no problem
R. Tyler Croy
@rtyler
Jun 05 2015 15:55
@mkristian with the jruby-mains and classloader work you've done, do you have an idea of how file globbing is supposed to work?
Schalk W. Cronjé
@ysb33r
Jun 05 2015 15:55
I have not really had any chance to look at the work @mkristian has done on the maven resolving strategies. I suspect it might be possible to refactor it at some stage in the future to use configuration rules instead. I’ll look at it at some time, but in the mean time I am just accepting those changes as-is.
R. Tyler Croy
@rtyler
Jun 05 2015 15:56
We have some code that does `Dir[FIle.dirname(FILE) + "/*.rb"].each { |f| require f }
File.dirname(__FILE__) ends up being uri:classloader: which appears correct to me, but the glob does not take effect it seems
rtyler @rtyler heads to a co-working space to get out of the house
Christian Meier
@mkristian
Jun 05 2015 15:59
@rtyler this only works if there are those .jrubydir files inside the directories
R. Tyler Croy
@rtyler
Jun 05 2015 15:59
hm, okay
Christian Meier
@mkristian
Jun 05 2015 15:59
which jrubyJar should produce
R. Tyler Croy
@rtyler
Jun 05 2015 16:00
they're there for stuff that was included by the plugin, but not for stuff that was included by my own into() { from } type statements
it might be due to how the service artifact plugin is adding those includes, will check when I get back online in 10
Christian Meier
@mkristian
Jun 05 2015 16:03
@rtyler adjusted to use real types and do log only when enabled. so PR in queue on travis
@ysb33r I think I am using "Dependency resolve rules" but if there is something better I am all for it especially since there is at least one test for the last change
R. Tyler Croy
@rtyler
Jun 05 2015 16:22
@mkristian the PR doesn't show as updated in GH
Christian Meier
@mkristian
Jun 05 2015 16:24
and now ?
R. Tyler Croy
@rtyler
Jun 05 2015 16:26
there we go
hooray, I'll merge once travis gives the okie doie
dokie*
@mkristian do we have any facilities to forcefully create the jrubydir stuff?
so it's using the copyspec stuff already inside of the Jar task
it must be running after the jrubydir code in the jar plugin executes or something along those lines
R. Tyler Croy
@rtyler
Jun 05 2015 16:33
actually, it looks like some of my code is in build/dirinfo correctly
the plot thickens!
@ysb33r I've been thinking a lot lately about consolidating the jruby-gradle plugins (jar, war, base) into a single repository
and making it a multi project build
R. Tyler Croy
@rtyler
Jun 05 2015 16:38
to reduce the amount of per-repo overhead that is sometimes getting in the way
do you have thoughts on this?
Schalk W. Cronjé
@ysb33r
Jun 05 2015 16:39

and making it a multi project build.

LOL. I did ask you about it way back then ...

rtyler @rtyler frowns
R. Tyler Croy
@rtyler
Jun 05 2015 16:39
multiproject builds were scarier to me then, and I was much more worried about bad API designs and coupling
I'm far less concerned about those now
Schalk W. Cronjé
@ysb33r
Jun 05 2015 16:40
I have to say, it is much harder to get bad coupling when building with Gradle. It is just down to the way the build system is designed. Bad coupling usually shows up quickly via a dirty, mangled build script.
R. Tyler Croy
@rtyler
Jun 05 2015 16:41
@mkristian okay, it looks like this code in the JRubyJarConfigurator is executing for my custom added code, but the resulting artifact does not have the .jrubydir files added for those custom added directories
Schalk W. Cronjé
@ysb33r
Jun 05 2015 16:42
@rtyler I’ve done groovy-vfs as a multi-build. I’ve had to do one or two in between releases of just one component in the build, but mostly I’ve always released in one big go updating all components.
R. Tyler Croy
@rtyler
Jun 05 2015 16:42
hrm, and I was mistaken, the files are not getting added to build/dirinfo
rtyler @rtyler nods
R. Tyler Croy
@rtyler
Jun 05 2015 16:44
@mkristian this is the same internal project, I can push some updates t oa branch if you'd like to take a look
R. Tyler Croy
@rtyler
Jun 05 2015 16:53
oh interesting, the root .jrubydir has a flattened out version of the files I'm including listed in it
well, not flattened out
but missing a part of the directory structure
Christian Meier
@mkristian
Jun 05 2015 16:54
hmm
@rtyler ok push it and I have a look
R. Tyler Croy
@rtyler
Jun 05 2015 17:23
alright, #126 merged, I think v0.2.2 might be ready for liftoff
R. Tyler Croy
@rtyler
Jun 05 2015 18:06
@mkristian #54 doesn't get fixed with include instead of into() from { } FWIW
heh, turns out that's becaues the files don't get included at all
gahh
Christian Meier
@mkristian
Jun 05 2015 18:12
include needs to have from "." - at least I have this in my scratch build.gradle
yes, the default Jar tasks also needs a from '.' for include to work
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:17
from '.' doesn't sound kosher.
R. Tyler Croy
@rtyler
Jun 05 2015 18:18
@mkristian are you working on #54 right now?
Christian Meier
@mkristian
Jun 05 2015 18:18
task missing2(type :Jar) { include "rakes/*" }
produces an empty jar
with from '.' it contains the directory and its files
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:20
Do from ('rakes') { include '**' }
R. Tyler Croy
@rtyler
Jun 05 2015 18:26
@ysb33r that version doesn't preserve rakes/ directory structure in the jar
Christian Meier
@mkristian
Jun 05 2015 18:27
@rtyler not working on #54 - need to finish the merge from jruby-1_7 to master. and #54 I will never finish today
R. Tyler Croy
@rtyler
Jun 05 2015 18:27
heh, gotcha
I'll dig around and try to find a work-around
for now at least, since I don't really understand the dirinfo code as much as I would like
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:28
What does it lose?
R. Tyler Croy
@rtyler
Jun 05 2015 18:29
@ysb33r the rakes/ directory itself
the contents get put into the root of the jar file
Christian Meier
@mkristian
Jun 05 2015 18:31
https://github.com/jruby-gradle/jruby-gradle-jar-plugin/blob/master/src/main/groovy/com/github/jrubygradle/jar/JRubyJarConfigurator.groovy#L213 does not see path which the file will have inside the jar - in same cases yes and other cases no
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:32
Ah from projectDir, { include 'rakes' }
R. Tyler Croy
@rtyler
Jun 05 2015 18:32
why the comma?
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:34
Just looks better than () in this case
R. Tyler Croy
@rtyler
Jun 05 2015 18:34
hah, that includes the dir only
shouldn't it be include 'rakes/**'?
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:35
True
Pretty much what @mkristian said actually
R. Tyler Croy
@rtyler
Jun 05 2015 18:37
@mkristian interestingly the from/include approach results in the root .jrubydir being created properly, but none are created in the subdirs
but I believe that might unblock me enough for now
Christian Meier
@mkristian
Jun 05 2015 18:38
I hope so :)
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:42
are you trying to pack everything into the Jar and add .jrubydir folders
R. Tyler Croy
@rtyler
Jun 05 2015 18:42
yes
in order for the Ruby applications globs to work properly when packed into the jar, the jrubydir stuff is required, so @mkristian tells me
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:42
which part of the code is it?
R. Tyler Croy
@rtyler
Jun 05 2015 18:42
what do you mean? just normal ruby code :)
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:43
no, I mean which part of the plugin code is this in
R. Tyler Croy
@rtyler
Jun 05 2015 18:44
I'm adding my own dirs to the jar
I might not be understanding what you're asking properly
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:45
what I mean is where in the ruby-gradle code you are trying to do this, I could have a look. Otherwise if you are trying to do this in your build.gradle file I might have an idea
R. Tyler Croy
@rtyler
Jun 05 2015 18:47
it's just:
jrubyJar {
  from projectDir, { include 'rakes/**' }
}
it's really nothing more than that :)
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:49
are there any .jrubydir files in ‘rakes’ or are you adding them yourself?
R. Tyler Croy
@rtyler
Jun 05 2015 18:49
there aren't any there, and there needs to be
when it's packed in the jar
Schalk W. Cronjé
@ysb33r
Jun 05 2015 18:50
This message was deleted
Christian Meier
@mkristian
Jun 05 2015 18:58
@ysb33r so the problem is: there is Jar task which is basically a Copy tasks under the hood. before packing the jar I need to iterate of teh content of the jar to produce those .jrubydir files. currently I iterate over the "source" here: https://github.com/jruby-gradle/jruby-gradle-jar-plugin/blob/master/src/main/groovy/com/github/jrubygradle/jar/JRubyJarConfigurator.groovy#L213
but his FileVisitDetails does not have enough info to perform this task properly - ti misses directory info depending on how you added it to you jar task
rtyler @rtyler nods
Schalk W. Cronjé
@ysb33r
Jun 05 2015 19:08
Something roughly like
doFirst {
  FileCollection fc = fileTree(‘rakes’)
  File output = new File(buildDir,’foo/rakes’)
  fc.files.findAll {  it.isFile() }. each {
    File dest = new File(output,it.parentFile.path + ‘/‘ + ‘.dirinfo’ )
    // Can be done better than this
    dest.text = dest.text  + “\n” + it.name
  }
}

from projectDir, { include ‘rakes/**’ }
from new File(buildDir,’foo’) { include ‘rakes/**’}
Schalk W. Cronjé
@ysb33r
Jun 05 2015 19:17
sorry cannot test it properly now, but that is roughly the idea
R. Tyler Croy
@rtyler
Jun 05 2015 21:36
@/all FYI, jruby-gradle base plugin v0.2.2 released
\o/
R. Tyler Croy
@rtyler
Jun 05 2015 22:13
@ysb33r so can I go multiproject? :)
Schalk W. Cronjé
@ysb33r
Jun 05 2015 22:20
We probably can - will make life easier I think, but we’ll need to have a strategy as how to cope with the old repoS.
R. Tyler Croy
@rtyler
Jun 05 2015 22:21
that's easy, just push a new commit with a link to the new repo
rtyler @rtyler has done that plenty
Schalk W. Cronjé
@ysb33r
Jun 05 2015 22:22
What about stuff like Bintray READMEs? they only point to toplevel READMEs.
R. Tyler Croy
@rtyler
Jun 05 2015 22:26
those I think can be configured/published from the bintray gradle plugin IIRC
like, you can push a readme file or refer to a GH repo
Schalk W. Cronjé
@ysb33r
Jun 05 2015 22:29
ok
I cannot remember seeing a file push in the REST API