Commit Graph

41 Commits

Author SHA1 Message Date
Phillip Webb
7e3c158f3a Polish 2013-05-31 12:26:30 -07:00
Dave Syer
969c7d6fa1 Make sure ThymeleafAutoConfiguration works if imported directly
Before this change if Layout dialect not available then the nested class is
loaded and barfs because it depended on the layout dialect (in a
@ConditionalOnClass annotation).
2013-05-31 16:18:03 +01:00
Dave Syer
bf30e2de90 [bs-135] Add support for closure-style options declarations
E.g.

    options {
	option "foo", "Foo set"
	option "bar", "Bar has an argument of type int"
          withOptionalArg() ofType Integer
    }

    println "Hello ${options.nonOptionArguments()}: " +
      "${options.has('foo')} ${options.valueOf('bar')}"

[#50427095] [bs-135] Plugin model for spring commands
2013-05-28 17:03:01 +01:00
Dave Syer
dcdf2d00b8 [bs-135] Simplify Command interface a bit more 2013-05-28 17:03:01 +01:00
Dave Syer
fc1012e77d [bs-135] Remove support for option commands
Command names stating with "--" work just as well.

[#50427095]
2013-05-28 17:03:01 +01:00
Dave Syer
d950d15f9b [bs-135] Plugin model for spring commands
* Added CommandFactory and a ServiceLoader model for providing
implementations
* Added ScriptCommand (wrapping groovy script). Service providers
are recommended to implement OptionHandler in their script, but a
regulare Script or a Runnable will also work.

[#50427095]
2013-05-28 17:03:01 +01:00
Greg Turnquist
6c4e39d4c1 Fixed name of annotation and a typo in the code. 2013-05-27 18:37:56 -07:00
Dave Syer
25f68404f3 [bs-137] "spring help" prints "Unexpected error" (when it isn't)
[#50523561]
2013-05-24 16:44:42 +01:00
Dave Syer
750b193fe4 Packaging: ensure executable bit is set 2013-05-24 14:27:56 +01:00
Dave Syer
a112717fd3 [bs-136] Add 'spring run --local ...'
Use this to download and cache the dependencies to ./grapes.
Good for running on virgin system (like PaaS).

[Fixes #50511883] Add --local to RunCommand
2013-05-24 13:51:10 +01:00
Dave Syer
6e52d7dd39 [bs-134] CLI app cannot resolve snapshot jars
Moved the Grab.addResolver() call to before any other compiler
customizations.

That got it working locally (removed ~/.m2 and ~/.groovy/grapes)
but still not working on cloudfoundry for some reason.  We need
more help from buildpacks there (to get a cache going for the
grapes), but there seems to be more than just that stopping it
(maybe just timeouts?).

[#50351963]
2013-05-22 11:36:54 +01:00
Dave Syer
a71bb1c972 [bs-120] Support for groovy templates
* Added GroovyTemplate.template() utility and static import in webapp CLI, so

        @RequestMapping("/")
        @ResponseBody
        String home(Model model) {
           template "home.html", model
        }

    renders the template in /templates/home.html

[Fixes #49832753]
2013-05-21 15:28:00 +01:00
Dave Syer
09cb2f8436 [bs-76] Implement plugin model for cli support
* Because Spring is not on the classpath we don't particularly
want to use SpringFactoriesLoader
* Adopted the JDK (>=6) ServiceLoader model instead

[Fixes #48789783]
2013-05-18 19:54:20 +01:00
Dave Syer
10573d2c74 Remove dependency-reduced-pom.xml 2013-05-17 16:10:59 +01:00
Dave Syer
c65a224f4d [bs-85] Change name of groovy sample script 2013-05-09 13:14:21 +01:00
Phillip Webb
7624b6a9f6 Include jcl-over-slf4j with autoconfigure 2013-05-08 14:46:43 -07:00
Phillip Webb
589ef1868d Update hardcoded bootstrap references to 0.5.0 2013-05-08 14:41:52 -07:00
Phillip Webb
a8d6b435a4 Minor Javadoc polish 2013-05-08 14:41:51 -07:00
Dave Syer
8231377113 [bs-85] Move round and rename some actuator packages
[#49047535]
2013-05-08 11:04:24 +01:00
Dave Syer
a5810af882 Add mvn deployment gumf 2013-05-08 10:53:37 +01:00
Dave Syer
694a1dd408 Bump version to 0.5.0.BUILD-SNAPSHOT 2013-05-08 10:07:22 +01:00
Dave Syer
98d48a3cc1 Add @CopmonentScan to default imports in CLI 2013-05-07 17:01:42 +01:00
Dave Syer
b462bc6e6c [bs-96] Switch off m2e errors about /eclipse path
* Uploaded m2e eclipse baggage to http://static.springsource.org
* Changed location in parent pom
* Removed all main.basedir properties from poms

[Fixes #49285987]
2013-05-07 07:37:47 +01:00
Dave Syer
ec0e9b17ad More ordering issues in service apps
* The TraceAutoConfiguration in the service project
was loading too early because it contains a BPP
* It also had a Spring Security dependency without any
@Conditional* configuration
* Fixed by nesting the BPP in a class with @Conditional*
2013-04-30 17:37:08 +01:00
Dave Syer
0a58e560b3 Fix ordering snafu with container properties and shutdown 2013-04-30 17:05:30 +01:00
Dave Syer
e3d5bf2e21 [bs-29] Support for XML configuration in groovy apps
Mixed .groovy and .xml now supported bia spring CLI, e.g.

$ spring samples/runner.groovy samples/runner.xml

[Fixes #48059037]
2013-04-29 16:12:29 +01:00
Dave Syer
bb62ca835e [bs-24] Support multi-file compile from command line
* Each non-option arg is tested to see if it is a file
* If it is .groovy (or .java) it is compiled

[#48127661]
2013-04-29 15:54:09 +01:00
Dave Syer
628a8c79aa [bs-19] Medley of changes supporting integration apps
* Use file adapters in sample instead of internal flow
* Add Exception to signature of CommandLineRunner for
implementation convenience
* Updates for Security snapshots
2013-04-29 08:35:01 +01:00
Dave Syer
10c333ea10 [bs-73] Tweak algorithm for detecting anonymous classes
@Bean definitions in Groovy that contain closures have the bean name in
the class name.  Ugh.  Added regex match to catch that.

[#48718891]
2013-04-26 12:02:49 +01:00
Dave Syer
61fa55b524 [bs-62] Add assertions to CLI integration tests
[Fixes #48658503]
2013-04-26 08:22:30 +01:00
Dave Syer
bcf86b320e [bs-72], [bs-75] Add Batch plugin features
* Auto config in main bootstrap jar
* Compiler enhancements in groovy cli
* Sample script in cli samples

[Fixes #48716881], [Fixes #48788313]
2013-04-26 07:01:37 +01:00
Dave Syer
83e0ea22c1 [bs-19] Add samples and CLI support for Spring Integration
$ cd spring-bootstrap-cli
    $ export SPRING_HOME=target
    $ src/main/scripts/spring run samples/integration.groovy

The big disadvantage at the moment is that there is no goo way to
detect Spring Integration in the AST (at least not as good as @Enable*).
So for now we are looking for @MessageEndpoint or a class name with
SpringIntegration in it.

[#48151147]
2013-04-25 17:15:05 +01:00
Dave Syer
a2d328ae3a [bs-73] Anonymous classes cannot be used in @Bean definitions in .groovy scripts
* Added a test for each of the classes loaded by the SpringApplication
* If it's an anonymous class or looks like a Groovy closure we ignore it
* The CLI sample job.groovy also modified to take advantage

[Fixes #48718891]
2013-04-25 16:02:44 +01:00
Dave Syer
737886e4da Fix help and extend clean command
Examples:

    $ spring clean --all org.springframework commons-logging
    $ spring clean --all org.springframework:spring-tx
2013-04-25 11:25:13 +01:00
Dave Syer
ca99e4d7b9 Remove unnecessary explicit FQCN 2013-04-25 10:18:32 +01:00
Dave Syer
c9a8cb9341 [bs-72] Add Batch compiler by default
We could take this out again when we decide what to do about plugins
but it's good to have it in for now because it shows how to do it,
and exposes some holes.  The job.groovy script now works, but
a lot of it should be defaulted through auto-configuration.

(See also [bs-73] for a non-Batch related bug.)

[#48716881]
2013-04-25 09:36:32 +01:00
Dave Syer
214b3a28db [bs-71] "spring run app.groovy" stalls at end (non-daemon thread)
* Change default so that file is not watched (add --watch to watch it)
* The runner thread is set to daemon mode

[Fixes #48716955]
2013-04-25 09:06:54 +01:00
Dave Syer
a91b482849 Improve readability of SpringBootstrapCompilerAutoConfiguration 2013-04-25 08:42:22 +01:00
Dave Syer
38f0cf1ed2 [bs-62] Add integration tests for CLI samples
[Fixes #48658503]
2013-04-24 16:09:17 +01:00
Dave Syer
c91e83c7d2 [bs-59] Add zip packaging for cli module
* Also added "spring" shell script (in zip), so you can
unzip it and run out of the box
* To run in developer mode use SPRING_HOME, e.g.

        $ cd spring-bootstrap-cli
        $ SPRING_HOME=target src/main/scripts/spring run samples/web.groovy
* Also added "clean" command to remove spring bootstrap grapes
(useful to force a refresh of snapshot jars)

[#48644271]
2013-04-24 11:38:57 +01:00
Dave Syer
fb6b224470 Fast forward existing prototype work 2013-04-24 10:02:07 +01:00