Still Trying to Upgrade to 2.6 - Now TridentBuilder

classic Classic list List threaded Threaded
23 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
After multiple failed attempts to upgrade my application from 0.9 to 2.6 over the last 8 months, I have my application mostly running and passing most tests.  I'm now down to trying to get TridentBuilder to bring in the Steel gauges.  If I treat it like the old plugin (by adding the config file entry) that breaks with a lot of stack traces with many root causes.  Here is the line I can't bring in:

//root.'griffon.builder.trident.TridentBuilder'.view = '*'

I noticed that the TridentBuilder class is a FactoryBuilderSupport just like the builder in my view.  I can't replace the main builder with the TridentBuilder because it won't recognize my Swing stuff and the other plugins like the Glazed Lists.  I was wondering if there was a way I could chain them or link them up in the code so that the appropriate one is used at the right place in the DSL.  I tried separating out the DSL for the gauge into a separate method and then used  builder.withBuilder(new TridentBuilder(true)) { //gauge here } but it didn't like that because the definition of the gauge had a "bind" in one of its parameters and that is part of the main builder rather than Trident.  For instance:

lcdValue: bind { (model.currentDayInvestment).round(0)},

Is there any way to merge that TridentBuilder in with the builder that already has the Swing, Glazed Lists, and MigLayout stuff already in it?

Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

aalmiray
Administrator
I'm afraid that the previous configuration option as you posted will not work with Griffon 2.x. I think the safest solution would be to create a BuilderCustomizer that delivers the nodes as Griffon's new CompositeBuilder expects them.

To be honest I though no one was using Trident. This is the reason why some old plugins were not ported to the new API. However I can create a new compatible plugin, it should be a matter of 1 or 2 days.

Is there any other plugin that you would need to finish the migration?

Cheers,
Andres
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
I was actually looking at the BuilderCustomizer and a Module to register it.  However, I would need the knowledge of what the TridentBuilder was actually doing and I can't find the source to that thing anywhere on the internet.  I'm willing to do the work myself but I'd need that source or at least some hints on what it was doing.  I can look at de-compiled versions and get a bit of a hint but I'm not sure of the parameters I would need when registering the factories.

Thanks, Mike
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

aalmiray
Administrator
Unfortunately TridentBuilder went the way of the Dodo when Codehaus Closed its doors. Fortunately I have a copy of the sources. you can find the new version of the Trident plugin at https://github.com/griffon-plugins/griffon-trident-plugin

The binaries have been released on Bintray. It may take a few hours for the binaries to be synced with JCenter.

Cheers,
Andres
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
Thanks so much.  I was actually refering to TridentBuilder itself rather than the plugin (for the source code) as I was willing to duplicate what TridentBuilder did.  However, if the plugin gets me there, even better.

Here are the dependencies I have in my build.gradle:

    compile group: 'com.github.insubstantial', name: 'trident', version: '7.3'
    compile group: 'org.codehaus.griffon', name: 'tridentbuilder', version: '0.6'
    compile 'org.codehaus.griffon.plugins:griffon-trident-plugin:1.0.0'
    compile group: 'org.bidib.jbidib.eu.hansolo', name: 'SteelSeries', version: '3.9.31.1'

Now with the griffon-trident-plugin, should I remove any of the others or leave them?

Mike
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
I tried various combinations of the dependencies and generally got errors.  Here is the latest I tried and it wouldn't compile:

    griffon 'org.codehaus.griffon.plugins:griffon-trident-plugin:1.0.0'
    compile 'org.codehaus.griffon.plugins:griffon-trident-swing-groovy:1.0.0'
    compile group: 'org.bidib.jbidib.eu.hansolo', name: 'SteelSeries', version: '3.9.31.1'

:compileGroovy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> org/codehaus/griffon/runtime/groovy/view/AbstractGriffonViewScript

Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
I see one major problem right away.  I've been working for almost 10 months to move up to 2.6 and when I added this dependency it grabbed Griffon 2.9.  Is there any possible way to make it work with 2.6?  I just don't have any more time to make this upgrade (to 2.6) work much less trying to move to 2.9.  There are too many breaking changes.
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
Is there any way I could get the source code to the TridentBuilder class itself?  If I could I could make my own plugin that works with Griffon 2.6.

Thanks, Mike
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

aalmiray
Administrator
AFAIK Griffon 2.9.1 does not change too much in terms of runtime features based on what you need from 2.6.0. Most of the changes are in the JavaFX space. What's important is the build time. Griffon 2.6.0 requires Gradle 2.11 or less. Griffon 2.7.0 requires Gradle 2.12 or greater. The difference is that Gradle 2.12 added support for `compileOnly` and `testCompileOnly` in an incompatible way as Griffon expected it.

Also, I found the source code for TridentBuilder, it's found at https://github.com/griffon/tridentbuilder

I don't recommend adding a binary dependency to it directly as the binaries were compiled with Groovy 1.8.x and it may not be fully binary compatible with Groovy 2.x which is what Griffon 2.6.0 expects.

This means you have the following options:

1. clone https://github.com/griffon-plugins/griffon-trident-plugin; modify the build so that it compiles against Griffon 2.6.0. You only need to change one variable value in `gradle.properties`.
2. clone https://github.com/griffon/tridentbuilder; make any changes you need and build it. Include only this dependency. You'll need your own BuilderCustomizer to make TridentBuilder work. This is what #1 does.

Cheers,
Andres

Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
So I tried changing all the versions in build.gradle to 2.9.1 instead of 2.6 and I changed the gradle wrapper version to 2.12.  It died as expected here:FAILURE: Build failed with an exception.

* Where:
Script 'C:\projects\Trader\gradle\integration-test.gradle' line: 20

* What went wrong:
A problem occurred evaluating script.
> Could not find property 'compileOnly' on configuration container.

So if 2.12 is required but breaks this feature, how do I use it?  It seems like 2.9.1 is not possible to use at all.  It doesn't work with 2.11 or 2.12.  Is there a version of Gradle that works with 2.9.1?
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
Still trying to see if it is possible to get 2.9.1 to work at all.  I created a sample project with lazybones with 2.9.1 - then went through my project making everything match all the config and scripting exactly.  I also installed Gradle 3.2.1 and from a command line, tried to run: gradle wrapper

I got a similar error:

FAILURE: Build failed with an exception.

* Where:
Script 'C:\projects\Trader\gradle\integration-test.gradle' line: 20

* What went wrong:
A problem occurred evaluating script.
> Could not find property 'compileOnly' on configuration container.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Did you try to get me to upgrade to a version of Griffon and Gradle that doesn't work at all?  I don't get it.  Why go through the trouble of updating that trident builder plugin if 2.9.1 is a non-functional version of Griffon?  

?
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
Just to be sure, I tried the same thing with the /sample project that lazybones creates from scratch.  Same error:
C:\projects\sample>gradle wrapper

FAILURE: Build failed with an exception.

* Where:
Script 'C:\projects\sample\gradle\integration-test.gradle' line: 20

* What went wrong:
A problem occurred evaluating script.
> Could not find property 'compileOnly' on configuration container.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Any ideas?
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
I finally messed around enough to make it work.  I had to have 3.2.1 of Gradle installed and then have the wrapper specify 3.2.  Other combinations (like having 3.0 of Gradle and having the wrapper at 3.2) didn't work.  

My next issue is figuring out how to get the griffon-trident-plugin to actually download into my gradle caches.  With Gradle 2.11 or 2.12 (even though those versions won't work at all), they at least downloaded both the POM and Jar files.  However, once I started messing around with Gradle 3.0 and beyond, it refuses to download the jar.  So for this new griffon-trident-plugin, I only get a POM and no jar file and no dependencies.  Is there something wrong with the way it is set up at JCenter to where it can only be downloaded with the older Gradle 2.x?
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

aalmiray
Administrator
I see. The problem lies in the `build.gradle` file created by Lazybones. As mentioned earlier, Griffon 2.6 and previous added their own `compileOnly` and `testCompileOnly` configurations. Since Gradle 2.12 you don't need those explicit configurations, which means you must edit `build.gradle` to remove the following

        configurations {
            compileOnly
            testCompileOnly
        }

        sourceSets {
            main {
                compileClasspath += [configurations.compileOnly]
            }
            test {
                compileClasspath += [configurations.testCompileOnly]
            }
        }

        javadoc {
            classpath += [configurations.compileOnly]
        }

        idea {
            module {
                scopes.PROVIDED.plus += [configurations.compileOnly]
                scopes.PROVIDED.plus += [configurations.testCompileOnly]
            }
        }

Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

aalmiray
Administrator
Btw, the last comment applies to the project created with older versions of the lazybones templates (1.6.0 or earlier). You don't get this problem If you create an application with the latest versions or if you remove the custom `compileOnly`/`testCompileOnly` configurations.

$ lazybones create griffon-swing-groovy 1.9.0 foo
$ cd foo
$ ./gradlew --version

------------------------------------------------------------
Gradle 3.2
------------------------------------------------------------

Build time:   2016-11-14 12:32:59 UTC
Revision:     5d11ba7bc3d79aa2fbe7c30a022766f4532bbe0f

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_112 (Oracle Corporation 25.112-b16)
OS:           Mac OS X 10.10.5 x86_64

$ ./gradlew run
Starting a Gradle Daemon (subsequent builds will be faster)
:compileJava UP-TO-DATE
:compileGroovy
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
:processResources
:classes
:run
[main] INFO org.codehaus.griffon.runtime.core.DefaultApplicationBootstrapper - Griffon 2.9.0
[main] INFO org.codehaus.griffon.runtime.core.DefaultApplicationBootstrapper - Build: 2016-12-01T10:30:43.837+0100
[main] INFO org.codehaus.griffon.runtime.core.DefaultApplicationBootstrapper - Revision: 72da1abd8221c731d25259e412d1fa21f7064e2c
[main] INFO org.codehaus.griffon.runtime.core.DefaultApplicationBootstrapper - JVM: 1.8.0_112 (Oracle Corporation 25.112-b16)
[main] INFO org.codehaus.griffon.runtime.core.DefaultApplicationBootstrapper - OS: Mac OS X 10.10.5 x86_64
[main] INFO griffon.swing.SwingGriffonApplication - Initializing all startup groups: [foo]
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
In reply to this post by aalmiray
I don't have any of that in my build.gradle or in any of the ones that are copied in from the /gradle directory.
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
The closest thing I can find to any of that is in the integration-test.gradle file in the /gradle directory.  Here is mine (as generated by lazybones - although I cut out a few things I'm not using):

configurations {
    integrationTestCompile {
        extendsFrom testCompile
    }
    integrationTestRuntime {
        extendsFrom integrationTestCompile, testRuntime
    }
}

sourceSets {
    integrationTest {
        if (file('src/integration-test/java').exists()) {
            java.srcDirs file('src/integration-test/java')
        }
        if (file('src/integration-test/groovy').exists()) {
            groovy.srcDirs file('src/integration-test/groovy')
        }
        resources.srcDir file('src/integration-test/resources')
        compileClasspath += sourceSets.main.output
        compileClasspath += configurations.compileOnly
        compileClasspath += configurations.testCompileOnly
        runtimeClasspath += compileClasspath
    }
}

idea {
    module {
        scopes.TEST.plus += [configurations.integrationTestCompile]
        scopes.TEST.plus += [configurations.integrationTestRuntime]
        testSourceDirs += sourceSets.integrationTest.allSource.srcDirs
    }
}

task integrationTest(type: Test, dependsOn: jar) {
    testClassesDir = sourceSets.integrationTest.output.classesDir
    classpath = sourceSets.integrationTest.runtimeClasspath
    reports.html.enabled = false
}

task integrationTestReport(type: TestReport) {
    destinationDir = file("${buildDir}/reports/integration-tests")
    reportOn integrationTest.binResultsDir
}

integrationTest.mustRunAfter test
integrationTest.finalizedBy integrationTestReport
integrationTestReport.dependsOn integrationTest
check.dependsOn integrationTestReport

task jacocoIntegrationTestReport(dependsOn: integrationTest, type: JacocoReport) {
    group = 'Reporting'
    description = 'Generate Jacoco coverage reports after running integration tests.'
    executionData file("${buildDir}/jacoco/integrationTest.exec")
    sourceDirectories = files(sourceSets.main.allSource.srcDirs)
    classDirectories = files(sourceSets.main.output)
    reports {
        csv.enabled = false
        xml.enabled = true
        html.enabled = true
        html.destination = "${buildDir}/reports/jacoco/integration-test/html"
        xml.destination = "${buildDir}/reports/jacoco/integration-test/jacocoIntegrationTestReport.xml"
    }
}
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
In reply to this post by aalmiray
I did this:

 lazybones create griffon-swing-groovy 1.9.0 foo

Then I made my project match the build.gradle and other gradle files in /gradle exactly.  Still no luck.  Since I can't get the griffon-trident-plugin to download the jar, I can't go any further.  Trying the 1.0.1 version didn't help.
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
So as a final attempt, I deleted all my caches 100%.  I deleted my .m2, my ivy and all my gradle caches as well as IntelliJ.  I had my program re-download everything.  Everything EXCEPT for griffon-trident-plugin came down perfectly with Gradle 3.2.  I'm now convinced that there is something about the way this plugin is set up at the repo that doesn't work with Gradle 3.x.  

Here is the line in my build.gradle (from the documentation page) for the plugin:

    griffon 'org.codehaus.griffon.plugins:griffon-trident-plugin:1.0.1'

As an aside I also tried the --refresh-dependencies and the "changing = true" along with the

resolutionStrategy.cacheChangingModulesFor 0, 'seconds'

None of that helped.  Is it possible to provide the jar some other way?  Gradle can't do it.
Reply | Threaded
Open this post in threaded view
|

Re: Still Trying to Upgrade to 2.6 - Now TridentBuilder

mecorusfc
I've now begun thinking that this plugin doesn't actually have a jar but only brings in the dependencies for other modules (griffon-trident-swing and griffon-trident-swing-groovy).  If that is the case, the dependency management has been working all along even though my program doesn't work.  

In the past, the one gauge I was using was mapped to something called linearLcdGauge.  Looking at the bottom of this page (https://griffon-plugins.github.io/griffon-trident-plugin/#_introduction), it appears that none of the gauges are mapped through any more.  I'm not sure how I would use this thing to get at the hansolo steelseries gauges now.  Do any of those nodes in table 3.1.1 have any relationship to the old mappings such as linearLcdGauge and linear?  
12