Skip to content

Commit 2a6a6c2

Browse files
authored
Version 1.1.0: Upgrade Gradle conf removing support to old versions and typo fixes (#7)
Upgrade building conf, README notes and Bump → 1.1.0 - Remove support to old Gradle versions where it's unlikely Java 9+ is used - Use ~compile~ → implementation (compile is deprecated) - Remove unused and deprecated JCenter repo - Upgrade publishing repo plugin - Bump → 1.1.0 - Remove note about the plugin not working with Java 12+ fixed in #6 - Typo fixes - Add trick to overcome autocompletion in the README
1 parent b6aebbb commit 2a6a6c2

File tree

3 files changed

+29
-41
lines changed

3 files changed

+29
-41
lines changed

README.md

Lines changed: 24 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
JShell Plugin
22
=============
33

4-
> :warning: the plugin is not working properly with Java 12+, check this
5-
> [section](#the-console-is-exited-once-started), although it works with
6-
> Java 9 to 11 (version 11 is LTS, use it! :point_left:), check also how to deal with
7-
> different versions of Java [here](#i-have-a-jdk-9-installation-but-my-default-jdk-is-the-jdk-8-or-below).
8-
9-
This **Gradle plugin** helps you to explore your code and dependencies in your gradle project
4+
**Gradle plugin** that helps you to explore your code and dependencies in your gradle project
105
with in [jshell](https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm),
11-
the official Java REPL tool.
6+
the official Java REPL tool (Java 9+).
127

138
Hosted in the **Gradle plugins** site: https://plugins.gradle.org/plugin/com.github.mrsarm.jshell.plugin
149

@@ -28,28 +23,11 @@ To use this plugin, add the following to your `build.gradle`:
2823

2924
```groovy
3025
plugins {
31-
id "com.github.mrsarm.jshell.plugin" version "1.0.0"
32-
}
33-
```
34-
35-
or in Gradle < 2.1:
36-
37-
```groovy
38-
buildscript {
39-
repositories {
40-
maven {
41-
url "https://plugins.gradle.org/m2/"
42-
}
43-
}
44-
dependencies {
45-
classpath "gradle.plugin.com.github.mrsarm:jshell-plugin:1.0.0"
46-
}
26+
id "com.github.mrsarm.jshell.plugin" version "1.1.0"
4727
}
48-
49-
apply plugin: "com.github.mrsarm.jshell.plugin"
5028
```
5129

52-
Task `jshell` is now enabled, which execute jshell with your classes and
30+
Task `jshell` is now enabled, which execute the jshell with your classes and
5331
dependencies after compiling your code.
5432

5533
You need to run the task `jshell` with the option `--console plain`.
@@ -103,7 +81,7 @@ at the beginning of the session.
10381
You can override the startup script path with the project
10482
property `jshell.startup` in the `gradle.properties` file,
10583
or set the same property directly in the command line
106-
arguments:
84+
arguments:
10785

10886
$ gradle --console plain jshell -Pjshell.startup=/path/to/run.jsh
10987

@@ -280,7 +258,7 @@ the JDK installation, eg:
280258

281259
The export will live just whiting the session where is defined,
282260
it does not change your system configuration globally, and calling
283-
to `unset JAVA_HOME` or opening a new session the export will
261+
`unset JAVA_HOME` or opening a new session the export will
284262
not have effect anymore.
285263

286264
You can even create an alias in your `~/.profile` / `~/.bashrc`
@@ -311,6 +289,15 @@ weird characters in the console. Unfortunately, with the
311289
current console support from Gradle, there is no
312290
solution for this [bug](https://github.com/mrsarm/jshell-plugin/issues/2).
313291

292+
However, the JShell task can be invoked with the command **rlwrap** from the
293+
console to overcome the issue:
294+
295+
$ rlwrap ./gradlew --console plain jshell
296+
297+
`rlwrap` takes care of the autocompletion, and the arrow keys management.
298+
Just remember to check you have installed it before invoking the JShell with
299+
the command the first time.
300+
314301

315302
System Requirements
316303
-------------------
@@ -322,6 +309,9 @@ System Requirements
322309
Build and Publish
323310
-----------------
324311

312+
> :information_source: Only for developers that want to make
313+
> changes to this source code.
314+
325315
To compile this plugin and build the .jar locally, checkout the
326316
source code and execute:
327317

@@ -351,7 +341,7 @@ buildscript {
351341
}
352342
}
353343
dependencies {
354-
classpath "com.github.mrsarm:jshell-plugin:1.0.0"
344+
classpath "com.github.mrsarm:jshell-plugin:1.1.0"
355345
}
356346
}
357347
@@ -366,11 +356,11 @@ This is a fork of the project https://github.com/bitterfox/jshell-gradle-plugin
366356
I forked it because the original project is not receiving patches
367357
and this version solves some issues and adds the following features:
368358

369-
- It works with **multi-module projects**
359+
- It works with **multi-module projects**.
370360
- There is no need to set the env variable `JAVA_OPTS` with a bunch
371-
of arguments _"--add-exports jdk.jshell/jdk.intern..."_
372-
- It allows to run at the beginning of the session a _.jsh_ startup script
373-
- Special support to the **Spring Framework**
361+
of arguments _"--add-exports jdk.jshell/jdk.intern..."_.
362+
- It allows to run at the beginning of the session a _.jsh_ startup script.
363+
- Special support to the **Spring Framework**.
374364

375365
**Project**: https://github.com/mrsarm/jshell-plugin
376366

@@ -382,4 +372,4 @@ and this version solves some issues and adds the following features:
382372

383373
### License
384374

385-
- (2020) [Apache Software License 2.0](https://www.apache.org/licenses/LICENSE-2.0).
375+
- (2020-2021) [Apache Software License 2.0](https://www.apache.org/licenses/LICENSE-2.0).

build.gradle

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
11
plugins {
2-
id 'com.gradle.plugin-publish' version '0.11.0'
2+
id 'com.gradle.plugin-publish' version '0.15.0'
33
id 'maven-publish'
44
id 'groovy'
55
id 'java-library'
66
}
77

88
group 'com.github.mrsarm'
9-
version '1.0.0'
9+
version '1.1.0'
1010

1111
sourceCompatibility = 9
1212
targetCompatibility = 9
1313

1414
repositories {
1515
mavenCentral()
16-
jcenter()
1716
}
1817

1918
dependencies {
20-
compile gradleApi()
21-
compile localGroovy()
19+
implementation gradleApi()
20+
implementation localGroovy()
2221
}
23-
jar.baseName = 'jshell-plugin'
2422

2523
tasks.withType(GroovyCompile) {
2624
options.fork = false

src/main/groovy/com/github/mrsarm/jshell/plugin/JShellPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020 the original author or authors.
2+
* Copyright 2020-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.

0 commit comments

Comments
 (0)