Skip to content

Commit eec12fc

Browse files
committed
Initital source
0 parents  commit eec12fc

11 files changed

Lines changed: 504 additions & 0 deletions

File tree

.editorconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# top-most EditorConfig file
2+
root = true
3+
4+
[*]
5+
# Unix-style newlines
6+
end_of_line = lf
7+
insert_final_newline = true
8+
charset = utf-8
9+
indent_style = space
10+
indent_size = 4

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.gradle/
2+
build/
3+
.idea/
4+
*.swp

README.md

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
JShell Plugin
2+
=============
3+
4+
This Gradle plugin helps you to explore your code and dependencies in your gradle project
5+
with in [jshell](https://docs.oracle.com/javase/9/jshell/introduction-jshell.htm),
6+
the official Java REPL tool.
7+
8+
Hosted on (NOT published yet): https://plugins.gradle.org/plugin/com.github.mrsarm.jshell.plugin
9+
10+
11+
Getting started
12+
---------------
13+
14+
To use this plugin, add the following to your `build.gradle`:
15+
16+
```groovy
17+
plugins {
18+
id "com.github.mrsarm.jshell.plugin" version "1.0.0-RC1"
19+
}
20+
```
21+
22+
or for Gradle < 2.1:
23+
24+
```groovy
25+
buildscript {
26+
repositories {
27+
maven {
28+
url "https://plugins.gradle.org/m2/"
29+
}
30+
}
31+
dependencies {
32+
classpath "com.github.mrsarm:jshell-plugin:1.0.0-RC1"
33+
}
34+
}
35+
36+
apply plugin: "com.github.mrsarm.jshell.plugin"
37+
```
38+
39+
Task `jshell` is now enabled, which execute jshell with your classes and
40+
dependencies after compiling your code.
41+
42+
You need to run the task `jshell` with the options `--no-daemon --console plain`.
43+
Following is an example:
44+
45+
$ gradle --no-daemon --console plain jshell
46+
47+
If you see this warning and the jshell console does not detect your classes:
48+
49+
> :jshell task :classes not found, be sure to compile the project first
50+
51+
Means the `classes` task needed to compile your project before launch `jshell`
52+
does not exist, just append the task needed to compile the project,
53+
some times is the same `classes` task but is not detected in multi-modules
54+
projects, so you need to add it explicitly in the Gradle command:
55+
56+
$ gradle --no-daemon --console plain classes jshell
57+
58+
59+
System Requirements
60+
-------------------
61+
62+
* JDK 9+
63+
* Gradle
64+
65+
66+
Build & Publish
67+
---------------
68+
69+
Compile and build the .jar locally with:
70+
71+
$ ./gradlew build
72+
73+
Publish to your local Maven repo:
74+
75+
$ ./gradlew publishToMavenLocal
76+
77+
About
78+
-----
79+
80+
This is a fork of the project https://github.com/bitterfox/jshell-gradle-plugin ,
81+
I forked it because the original project is not receiving patches
82+
and this version solve some issues and adds the following features:
83+
84+
- It works with **multi-module projects**
85+
- There is no need to set the env variable `JAVA_OPTS` with a bunch of
86+
of arguments _"--add-exports jdk.jshell/jdk.intern..."_
87+
- _Coming soon_: add special support to the **Spring Framework**
88+
89+
Project: https://github.com/mrsarm/jshell-plugin
90+
91+
Authors:
92+
93+
- Mariano Ruiz <mrsarm@gmail.com>
94+
- https://github.com/bitterfox
95+
(original [project](https://github.com/bitterfox/jshell-gradle-plugin))
96+
97+
License: (2020) [Apache Software License 2.0](https://www.apache.org/licenses/LICENSE-2.0).

build.gradle

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
plugins {
2+
id 'com.gradle.plugin-publish' version '0.11.0'
3+
id 'maven-publish'
4+
id 'groovy'
5+
}
6+
7+
group 'com.github.mrsarm'
8+
version '1.0.0-RC1'
9+
10+
sourceCompatibility = 9
11+
targetCompatibility = 9
12+
13+
repositories {
14+
mavenCentral()
15+
jcenter()
16+
}
17+
18+
dependencies {
19+
compile gradleApi()
20+
compile localGroovy()
21+
}
22+
jar.baseName = 'jshell-plugin'
23+
24+
tasks.withType(GroovyCompile) {
25+
options.fork = false
26+
groovyOptions.fork = false
27+
}
28+
29+
pluginBundle {
30+
website = 'https://github.com/mrsarm/jshell-plugin'
31+
vcsUrl = 'https://github.com/mrsarm/jshell-plugin'
32+
description = "JShell supports for your gradle project. Let's explore your classes and dependencies with jshell"
33+
tags = ['java9', 'jshell', 'repl']
34+
35+
plugins {
36+
jshellPlugin {
37+
id = 'com.mrsarm.jshell.plugin'
38+
displayName = 'JShell Plugin'
39+
}
40+
}
41+
}
42+
43+
publishing {
44+
publications {
45+
maven(MavenPublication) {
46+
artifactId = 'jshell-plugin'
47+
artifact jar
48+
}
49+
}
50+
}

gradle/wrapper/gradle-wrapper.jar

57.3 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sun Mar 29 19:53:15 ART 2020
2+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
3+
distributionBase=GRADLE_USER_HOME
4+
distributionPath=wrapper/dists
5+
zipStorePath=wrapper/dists
6+
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 183 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)