Commit Graph

222 Commits

Author SHA1 Message Date
Christian Dupuis
703d7d3fd9 Prevent EmptyStackException in case no stack of prompts is empty 2014-02-16 14:05:58 +01:00
Phillip Webb
e4376bc4a6 Update READMEs to 1.0.0.RC3 2014-02-13 13:37:12 -08:00
Spring Buildmaster
1367d57e8c Next development version 2014-02-13 13:19:12 -08:00
Spring Buildmaster
eaff1677a7 Release version 1.0.0.RC3 2014-02-13 13:18:56 -08:00
Phillip Webb
eaa05c6b6d Update READMEs to 1.0.0.RC2 2014-02-12 20:56:00 -08:00
Phillip Webb
af93ae2dac Ignore failing JMS tests for now
Ignore JMS sample which intermittently fails to run on CI.

See gh-323
2014-02-07 10:30:19 -08:00
Phillip Webb
2d8f66e3c5 Add more JMS sample log output 2014-02-06 15:30:32 -08:00
Phillip Webb
ed9735361e Apply source cleanup and formatting 2014-02-05 22:53:28 -08:00
Phillip Webb
0f083c2f9d Fix CLI class tangle 2014-02-03 21:25:12 -08:00
Phillip Webb
1061d582dc Fix CLI package tangles 2014-02-03 21:25:12 -08:00
Phillip Webb
70cb8cfed6 Fix CLI package and class tangles 2014-02-03 21:25:04 -08:00
Phillip Webb
c65dc9063c Don't expose URLs from InnerLoader
Update the CLI Groovy InnerLoader to not expose URLs. This prevents the
'TLD skipped' log messages from Tomcat that occurred previously due to
the InnerLoader and parent returning the same URLs.

Fixes gh-277
2014-01-30 14:32:16 -08:00
Phillip Webb
208bf8fc96 Polish CLI Jar generation 2014-01-29 22:46:31 -08:00
Phillip Webb
d648603634 Exclude *.jar and *.groovy from generated JARs
Update `JarCommand` to exclude `**/*.groovy` and `**/*.jar` by default.
2014-01-29 16:10:14 -08:00
Phillip Webb
c852fb5a79 Update packaged JARs to use standard JarLauncher
Change CLI generated JARs to use the standard `JarLauncher` instead of
a custom `JarRunner`. The `PackagedSpringApplicationLauncher` is used
as the `Start-Class` which in turn calls `SpringApplication.run()`.
2014-01-29 16:01:50 -08:00
Andy Wilkinson
96e10104e4 Add a command to produce a self-contained executable JAR for a CLI app
A new command, jar, has been added to the CLI. The command can be
used to create a self-contained executable JAR file from a CLI app.

Basic usage is:

spring jar <jar-name> <source-files>

For example:

spring jar my-app.jar *.groovy

The resulting jar will contain the classes generated by compiling the
source files, all of the application's dependencies, and entries
on the application's classpath.

By default a CLI application has the current working directory on
its classpath. This can be overridden using the --classpath option.
Any file that is referenced directly by the classpath is always
included in the jar. Any file that is found a result of being
contained within a directory that is on the classpath is subject to
filtering to determine whether or not it should be included. The
default includes are public/**, static/**, resources/**,
META-INF/**, *. The default excludes are .*, repository/**, build/**,
target/**. To be included in the jar, a file must match one of the
includes and none of the excludes. The filters can be overridden using
the --include and --exclude options.

Closes #241
2014-01-29 14:05:15 +00:00
Ben Hale
f2951b38d9 Ruby indentation conventions
By convention, Ruby code is indented using two spaces (  ) per-level.
The code used tabs (\t) previously and therefore wasn't idiomatic.
This change updates the indenting to use two spaces.
2014-01-28 07:18:37 +00:00
Ben Hale
a3c398ca0a Add --HEAD support to Homebrew formula
This change adds support for --HEAD builds to the Homebrew formula. It
defines a conditional dependency on Maven and builds the -cli project
during install.  The location to install from is abstracted out so
that code is identical regardless of whether the build is --HEAD or
mainline.
2014-01-28 07:18:10 +00:00
Phillip Webb
a624245b78 Remove dead code
Remove what appears to be unused CLI code.
2014-01-27 16:25:41 -08:00
Phillip Webb
ac0ff3c0b8 Upgrade to Spring Framework 4.0.1 SNAPSHOT
Upgrade to the latest 4.0.x SNAPSHOT of the Spring Framework in
preparation for the 4.0.1 release.
2014-01-27 14:41:03 -08:00
Phillip Webb
49ef1cd236 Update CLI to use spring-boot-dependency-tools
Update `GroovyCompiler` and `AetherGrapeEngineFactory` to use the
recently added `spring-boot-dependency-tools` in favor of loading
dependency information from a generated properties file.
2014-01-24 22:51:40 -08:00
Dave Syer
c5584b490a Add some more smarts around --debug
--verbose seems to be only for CLI logging (so really only
for dependency resolution). --debug is interpreted by SpringApplication
but up to now has been extracted and deleted from the command line
by the CommandRunner. This change makes --debug set a System property
*and* pass it down to the application (if used with -- separator).

Fixes gh-266
2014-01-24 12:35:25 +00:00
Phillip Webb
4a0ef9720b Update READMEs to reference latest version number 2014-01-22 00:13:49 -08:00
Phillip Webb
595cb6d55b Fix version-type logic to deal with RCx form 2014-01-21 22:15:11 -08:00
Phillip Webb
f500e48e2c Fix version replacement in homebrew generation 2014-01-21 21:05:23 -08:00
Phillip Webb
d0f3e33f21 Remove unused test dependency 2014-01-21 21:05:06 -08:00
Phillip Webb
43e54d38f7 Make fields private where possible 2014-01-21 16:29:07 -08:00
Phillip Webb
0160760568 Apply latest eclipse cleanup rules 2014-01-21 16:28:26 -08:00
Phillip Webb
ac54d7fe3c Final polish before 1.0.0.RC1 2014-01-21 16:28:17 -08:00
Phillip Webb
cdda330acd Update copyright header for files changed in 2014 2014-01-21 10:27:10 -08:00
Phillip Webb
7bb6bf6a54 Polish 2014-01-21 00:44:02 -08:00
Phillip Webb
68293f34af Upgrade version to 1.0.0.BUILD-SNAPSHOT
Fixes fg-243
2014-01-21 00:43:54 -08:00
Phillip Webb
18cecd077d Move CLI integration tests into spring-boot-cli
Use `maven-failsafe-plugin` to run CLI integration tests as part of
the `spring-boot-cli` project, removing the need for
`spring-boot-cli-integration-tests`.
2014-01-20 12:12:10 -08:00
Dave Syer
5627caa724 Move spring-boot tests utilities to main spring-boot.jar
Fixes gh-233
2014-01-17 18:31:08 +00:00
Phillip Webb
28a92d22dc Prevent CTRL-D from causing NPE in shell
Update the integrated shell to deal with a null line which can be
triggered with CTRL-D.

Fixes gh-229
2014-01-16 09:31:54 -08:00
Dave Syer
796816e8c3 Remove CleanCommand
Fixes gh-230
2014-01-16 17:29:52 +00:00
Phillip Webb
c8a1d8830c Refactor CLI internals for REPL shell
Numerous updates to the Spring CLI, primarily for better embedded REPL
shell support:

* Refactor the CLI application to help separate concerts between the
  main CLI and the embedded shell. Both the CLI and embedded shell now
  delegate to a new `CommandRunner` to handle running commands. The
  runner can be configured differently depending depending on need.
  For example, the embedded shell adds the 'prompt' and 'clear'
  commands.

* Most `Command` implementations have been moved to sub-packages so that
  they can be co-located with the classes that they use.

* Option commands are now only used in the CLI, the embedded shell
  does not user them and details have been removed from the Command
  interface.

* The REPL shell has been significantly refactored to:
    - Support CTRL-C to cancel the running process. This is supported
      when running external commands and most internal commands.
    - Fork a new JVM when running commands (primarily for CTRL-C support
      but also for potential memory and classpath issues)
    - Change the "continue" trigger from `<<` to `\`
    - Support command completion of files
    - Add ANSI color output
    - Provide 'help' support for internal commands (such as 'clear')
    - Remove the now redundant `stop` command

Fixes gh-227
2014-01-15 14:03:18 -08:00
Phillip Webb
cad9fbfdf0 Fix CLI help formatting issue with '-cp'
Ensure that '--cp' is replaced with a same length string to prevent
odd help text formatting.
2014-01-15 13:29:32 -08:00
Phillip Webb
3b259bc865 Polish 2014-01-15 10:31:08 -08:00
Andy Wilkinson
5fb42c3c33 Support @Grab when app has multiple groovy scripts
The AST transformation that processes @Grab annotations is driven once
per source file. Previously, this meant that if an app consisted of
multiple source files then multiple, discrete dependency resolutions
would be performed.

This commit updates AetherGrapeEngine to cache a previous resolution's
outcome and use its dependency to influence the outcome of subsequent
resolutions. For example if a one resolution results in spring-core
4.0.0.RELEASE being added to the classpath, subsequent resolutions
that depend upon spring-core will always get the 4.0.0.RELEASE
version. This is achieved by using the dependencies found by earlier
resolutions as dependency management configuration of the current
resolution. This removes the possibility of multiple versions of the
same dependency ending up on the classpath.

In addition to using the results of earlier resolutions to provide
dependency management configuration, default dependency management
configuration is also provided. This configuration is specified by
the springcli.properties file and ensures that, where Boot prescribes
certain versions of a dependency, that is the version that will be
resolved. For example, this ensures that spring-data-redis, which
depends upon Spring 3.1.4, pulls in the version of Spring that Boot
requires instead.

Fixes #224
2014-01-15 10:51:42 +00:00
Dave Syer
57ba6a40b6 Divert out/err streams while command runs
Actually System.in works fine, it's the output streams that get buffered.
We can fix it by diverting them for the duration of the command.

Fixes gh-217
2014-01-14 17:44:29 +00:00
Dave Syer
6b6bd37924 Add hint to user about 'stop' command
Improves gh-218
2014-01-14 17:43:50 +00:00
Dave Syer
1f5cba9e32 Clear prompt before clearing screen
Fixes gh-219
2014-01-14 17:26:13 +00:00
Dave Syer
fa8e4768b9 Prevent JLine from expanding !history events
We might also want to rethink "!" as a shell exec command (since it means
something in a real shell and in JLine). E.g. use "exec" or something.

Partial fix for gh-220 (ideally we'd process the events and catch
and handle exceptions).
2014-01-14 15:39:13 +00:00
Dave Syer
b07a1998df Remove InitCommand altogether
Related to gh-212
2014-01-14 14:49:00 +00:00
Dave Syer
8ff2a88712 Fix counting error in SourceOptions 2014-01-14 14:44:20 +00:00
Dave Syer
a5f16d46fe Remove ScriptCommand support
InitCommand remains for now, so that you can @Grab a jar with
custom commands if you so choose.

Contributes to gh-212
2014-01-14 14:44:20 +00:00
Dave Syer
3e6eb6fec8 Remove support for InitCommand outside REPL
In this commit we retain "init" as a command inside the ShellCommand
but not on the bash command line.

Seems to have an impact on performance so relevant to gh-212.
2014-01-14 13:27:40 +00:00
Dave Syer
5b90e18564 More performance tweaks for SpringCli 2014-01-14 13:04:00 +00:00
Andy Wilkinson
895daacde9 Roll spring-boot-maven-settings into the CLI 2014-01-14 10:06:45 +00:00