Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore Grails Shell + add Spring Boot CLI classes that were removed in Spring Boot 3.0.0 #13585

Merged
merged 19 commits into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
bb5ff09
chore(ci): Update renovate.json (#13488)
puneetbehl Apr 30, 2024
04b52f2
fix(deps): update apache-tomcat monorepo to v9.0.88 (#13500)
renovate[bot] May 2, 2024
92bba69
fix(deps): update dependency com.github.javaparser:javaparser-core to…
renovate[bot] May 3, 2024
26245fe
fix(deps): update grails-testing-support monorepo to v3.2.2 (#13504)
renovate[bot] May 3, 2024
cfd9515
Revert "chore(core): Deprecate the old grails-shell project (#13407)"
codeconsole Jul 27, 2024
4ed8b4e
Update logback and tomcat versions
jamesfredley Jul 29, 2024
521653b
Merge pull request #13575 from grails/6.2.1-dependency-updates
davydotcom Jul 29, 2024
7ee6ec4
ci: Fix SNAPSHOT publishing problem
matrei Jul 26, 2024
171eaea
Merge pull request #13576 from grails/matrei/fix-snapshot-publishing
jeffscottbrown Jul 30, 2024
49eb631
Temporary - Patch GROOVY_3_0_X until https://github.com/apache/groovy…
codeconsole Jul 30, 2024
44f46fd
Merge pull request #13578 from codeconsole/fix-groovy-joint-workflow
codeconsole Jul 30, 2024
fe58976
Merge branch '6.2.x' into revert-13407-13399-deprecate-the-old-grails…
codeconsole Jul 30, 2024
624c421
Merge pull request #13570 from grails/revert-13407-13399-deprecate-th…
codeconsole Jul 30, 2024
1e288a7
fix(deps): update spring-framework to v5.3.37
renovate[bot] Jul 30, 2024
f3b36a3
Merge pull request #13505 from grails/renovate/spring-framework
codeconsole Jul 30, 2024
7c24cb8
Revert "Temporary - Patch GROOVY_3_0_X until https://github.com/apach…
matrei Aug 16, 2024
db126c1
Merge branch '6.2.x' into jamesfredley/merge6.2.xInto7.0.x
jamesfredley Aug 19, 2024
94e3357
New jansi version was breaking tests
jamesfredley Aug 20, 2024
d8d6ea9
Import Spring Boot CLI classes removed prior to Spring Boot 3: https:…
jamesfredley Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@
"^org\\.apache\\.maven\\.resolver"
],
"groupName": "apache-maven-resolver monorepo"
},
{
"matchPackagePatterns": [
"^org\\.springframework\\:",
"^org\\.springframework\\.boot\\:"
],
"groupName": "spring-framework"
}
]
}
8 changes: 4 additions & 4 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ h2Version=2.2.224
jacksonVersion=2.17.2
hibernateDatastoreVersion=8.1.0
jakartaAnnotationApiVersion=2.0.0
jansiVersion=2.4.1
javaParserCoreVersion=3.25.9
jansiVersion=1.18
javaParserCoreVersion=3.25.10
javaxAnnotationApiVersion=1.3.2
jaxbApiVersion=2.3.1
jaxbImplVersion=4.0.5
jlineVersion=2.14.6
jnaVersion=5.14.0
junitVersion=4.13.2
logbackVersion=1.2.7
legacyConvertersVersion=5.0.0
logbackVersion=1.2.13
legacyConvertersVersion=6.0.0-SNAPSHOT
methvinDirectoryWatcherVersion=0.18.0
micronautCacheVersion=4.3.0
micronautRuntimeGroovyVersion=4.3.0
Expand Down
48 changes: 46 additions & 2 deletions gradle/assemble.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ def libsConfigurations = []
subprojects { subproject ->
if(subproject.name == 'grails-dependencies') return
if(subproject.name == 'grails-bom') return
if(subproject.name == 'grails-core') {
if(subproject.name == 'grails-shell' || subproject.name == 'grails-core') {

configurations {
libsConfigurations << libs {
Expand Down Expand Up @@ -100,13 +100,57 @@ task sourcesJars(type: Sync) {
from { sourcesFor(libsConfigurations*.copyRecursive { it.name.startsWith('grails-datastore') }.collect { it.transitive = false; it }) }
}

task install(dependsOn: [populateDependencies]) { task ->
task grailsCreateStartScripts(type: GrailsCreateStartScripts) {
description = "Creates OS specific scripts to run grails-shell as a JVM application."
mainClass.set('org.grails.cli.GrailsCli')
applicationName = 'grails'
defaultJvmOpts = ["-XX:+TieredCompilation", "-XX:TieredStopAtLevel=1", "-XX:CICompilerCount=3"]
outputDir = file('bin')
classpath = rootProject.childProjects['grails-shell'].configurations.runtimeClasspath
projectArtifacts = rootProject.childProjects['grails-shell'].tasks['jar'].outputs.files.collect { "dist/${it.name}" }
doLast {
ant.replace(file: file('bin/grails'), token: 'media/gradle.icns', value: 'media/icons/grails.icns')
ant.chmod(file: file('bin/grails'), perm: 'ugo+rx')
}
}

class GrailsCreateStartScripts extends org.gradle.api.tasks.application.CreateStartScripts {

@Input
Collection<String> projectArtifacts=[]

@org.gradle.api.tasks.TaskAction
void generate() {
def generator = new org.gradle.api.internal.plugins.StartScriptGenerator()
generator.unixStartScriptGenerator.template = project.rootProject.childProjects['grails-shell'].resources.text.fromFile('src/main/resources/unixStartScript.txt')
generator.applicationName = getApplicationName()
generator.mainClassName = getMainClassName()
generator.defaultJvmOpts = getDefaultJvmOpts()
generator.optsEnvironmentVar = getOptsEnvironmentVar()
generator.exitEnvironmentVar = getExitEnvironmentVar()
generator.classpath = projectArtifacts + getClasspath().resolvedConfiguration.resolvedArtifacts.collect { artifact ->
def dependency = artifact.moduleVersion.id
String installedFile = "lib/$dependency.group/$dependency.name/jars/$artifact.file.name"
if(dependency.group=='org.grails' && !project.file(installedFile).exists()) {
installedFile = "dist/$artifact.file.name"
}
installedFile
}
generator.scriptRelPath = "bin/${getUnixScript().name}"
generator.generateUnixScript(getUnixScript())
generator.generateWindowsScript(getWindowsScript())
}
}

task install(dependsOn: [populateDependencies, grailsCreateStartScripts]) { task ->
subprojects { Project project ->
if(!project.name.startsWith('grails-test-suite')) {
task.dependsOn("$project.name:publishToMavenLocal")
}
}
}
//task install(dependsOn: [populateDependencies, grailsCreateStartScripts] + subprojects.findAll { !it.name.startsWith('grails-test-suite') }
// *.collect { Project p -> p.tasks.withType(PublishToMavenLocal)})

task zipDist(type: Zip, dependsOn: [sourcesJars, install]) {
destinationDirectory = project.layout.buildDirectory.dir("distributions")
Expand Down
3 changes: 3 additions & 0 deletions grails-shell/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## grails-shell

This subproject provides code related to the Grails CLI and plugin commands.
83 changes: 83 additions & 0 deletions grails-shell/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
apply plugin:'application'

mainClassName = "org.grails.cli.GrailsCli"

repositories {
mavenCentral()
}

ext {
gradleToolingApiVersion = '7.3-20210825160000+0000'
}

dependencies {
api project(":grails-bootstrap")
api project(":grails-gradle-model")
api "org.apache.ant:ant:$antVersion"
api "org.codehaus.groovy:groovy-ant:$groovyVersion"
api "org.codehaus.groovy:groovy-json:$groovyVersion"
api "org.codehaus.groovy:groovy-jmx:$groovyVersion"
api "org.fusesource.jansi:jansi:$jansiVersion"
api "jline:jline:$jlineVersion"
api "org.gradle:gradle-tooling-api:$gradleToolingApiVersion"
compileOnly "org.apache.groovy:groovy-templates:$groovyVersion"
compileOnly "org.apache.groovy:groovy-xml:$groovyVersion"

compileOnly "org.springframework.boot:spring-boot:$springBootVersion"
compileOnly "org.springframework.boot:spring-boot-loader-tools:$springBootVersion"
compileOnly "org.springframework:spring-web:$springVersion"
api "org.springframework.boot:spring-boot-cli:$springBootVersion", {
exclude group: "org.codehaus.groovy", module: "groovy"
}
compileOnly "jakarta.servlet:jakarta.servlet-api:$servletApiVersion"
implementation("org.apache.maven:maven-resolver-provider:3.9.6") {
exclude group: "com.google.guava", module: "guava"
}
compileOnly "net.sf.jopt-simple:jopt-simple:5.0.4"

implementation("org.apache.maven:maven-settings-builder:3.6.3") {
exclude group: "javax.inject", module: "javax.inject"
}

implementation("org.sonatype.plexus:plexus-sec-dispatcher:1.4")
implementation("org.sonatype.sisu:sisu-inject-plexus:2.6.0") {
exclude group: "javax.enterprise", module: "cdi-api"
exclude group: "org.sonatype.sisu", module: "sisu-inject-bean"
}

implementation("org.apache.maven.resolver:maven-resolver-connector-basic:1.9.18")
implementation("org.apache.maven.resolver:maven-resolver-impl:1.9.18")
implementation("org.apache.maven.resolver:maven-resolver-transport-file:1.9.18")
implementation("org.apache.maven.resolver:maven-resolver-transport-http:1.9.18") {
exclude group: "org.slf4j", module:"jcl-over-slf4j"
exclude group: "commons-codec", module:"commons-codec"
}
implementation("commons-codec:commons-codec:1.16.0")

testImplementation "net.sf.expectit:expectit-core:0.9.0"
testImplementation "com.github.jnr:jnr-posix:3.1.18"

runtimeOnly "org.slf4j:slf4j-simple:$slf4jVersion"
runtimeOnly "org.codehaus.plexus:plexus-component-api:1.0-alpha-33"

}

eclipse {
classpath {
file {
whenMerged { classpath ->
classpath.entries.find { entry -> entry.kind == 'src' && entry.path == "src/test/resources" }?.excludes=["profiles-repository/**", "gradle-sample/**"]
}
}
}
}

apply from: "../gradle/integration-test.gradle"

integrationTest {
// jline doesn't use jline.terminal system property when TERM is dumb so use different TERM value for tests
// https://github.com/jline/jline2/blob/6a1b6bf/src/main/java/jline/TerminalFactory.java#L54-L57
environment 'TERM', 'xterm'
// execute in single thread
maxParallelForks = 1
}
Loading
Loading