GithubHelp home page GithubHelp logo

Implement custom tasks about gretty HOT 8 CLOSED

akhikhl avatar akhikhl commented on August 21, 2024
Implement custom tasks

from gretty.

Comments (8)

akhikhl avatar akhikhl commented on August 21, 2024

Custom tasks implemented on branch "grettyTasks", not merged to master yet, not documented.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Custom tasks merged to master, documented in wiki pages.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Gretty task classes were substantially reworked, now they should be much more useful. See documentation: https://github.com/akhikhl/gretty/wiki/Gretty-task-classes

There is one new feature that you might like: afterEvaluate handlers for gretty and farm extensions.
Syntax:

gretty {
  afterEvaluate {
    tasks.jettyRun.with {
      port = ...
      dependsOn ...
    }
  }
}

afterEvaluate handler is executed in afterEvaluate handler of gretty-plugin, right after initialization of all tasks. This is the right place for altering gretty tasks.

Note that you don't need afterEvaluate handler for creating your own tasks, so the following would work just fine:

gretty {
}

import org.akhikhl.gretty.JettyStartTask

task('MyJettyRun', JettyStartTask) {
  interactive = true
  port = 7070
}

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

In my project, I've used
buildscript dependency: classpath 'org.akhikhl.gretty:gretty-plugin:+'

apply from: 'https://raw.githubusercontent.com/akhikhl/gretty/master/pluginScripts/gretty9-0.0.19.plugin'
// global settings
gretty {
    port = 8080
    scanInterval = 1
    scanDir 'src/main/webapp'
    onScanFilesChanged { fileList -> println "Files were changed: $fileList" }
    fastReload = true
    consoleLogEnabled = true
    fileLogEnabled = true
    logFileName = project.name
    logDir = "${System.getProperty('user.home')}/logs"
}

After this recent change, the initial build fails with this:

FAILURE: Build failed with an exception.
* Where:
Script 'https://raw.github.com/akhikhl/gretty/master/pluginScripts/gretty9.plugin'
* What went wrong:
A problem occurred evaluating script.
> org.akhikhl.gretty9.GrettyPlugin

After changing to

apply from: 'https://raw.githubusercontent.com/akhikhl/gretty/master/pluginScripts/gretty9-0.0.19.plugin'
the build script the with jettyRun fails with this:

Exception in thread "Thread-14" groovy.lang.MissingPropertyException: No such property: absolutePath for class: java.lang.String

Full stacktrace and log at:
http://pastebin.com/kuspgtNm

Please help :)

from gretty.

bgaborg avatar bgaborg commented on August 21, 2024

The error:
Exception in thread "Thread-9" groovy.lang.MissingPropertyException: No such property: absolutePath for class: java.lang.String
is thrown even with the simplest settings.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

First problem (gretty9.plugin)

yes, it was an error in class file naming in gretty9.plugin. Now fixed, so it should work right away, without version upgrade. Attention: although github shows new formatted verson of file, when it still returns old raw version of file. I don't know the reason for this problem, may only guess that github aggressively caches files (or maybe it's their bug?).
Edit: now raw version is also up-to-date, so you can use gretty9.plugin right away.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Second problem (logback condig absolutePath)

It's a bug in Gretty. It appears only if "logback.xml" or "logback.groovy" file is found in folders projectDir, webAppDir/WEB-INF or in output (like buildDir/classes/main, buildDir/resources/main).
As soon as you remove (or rename) the file, the problem disappears. I know, this is bad workaround, but you can solve it that way for now.
I'll try to fix it ASAP and publish fixed version.

from gretty.

akhikhl avatar akhikhl commented on August 21, 2024

Please, don't hesitate opening new issues 😉

from gretty.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.