Skip to content

Commit

Permalink
Add Stimulus plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
rainboyan committed May 7, 2024
1 parent 277eb12 commit 5634bd1
Show file tree
Hide file tree
Showing 6 changed files with 188 additions and 0 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ dependencies {
developmentOnly('org.springframework.boot:spring-boot-devtools')
compileOnly "io.micronaut:micronaut-inject-groovy"
console "org.graceframework:grace-console"
implementation project(":plugins:stimulus")
implementation project(":plugins:turbo")
implementation "org.springframework.boot:spring-boot-starter-logging"
implementation "org.springframework.boot:spring-boot-starter-validation"
Expand Down
121 changes: 121 additions & 0 deletions plugins/stimulus/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
buildscript {
repositories {
mavenCentral()
}
}

ext."signing.keyId" = project.hasProperty("signing.keyId") ? project.getProperty('signing.keyId') : System.getenv('SIGNING_KEY')
ext."signing.password" = project.hasProperty("signing.password") ? project.getProperty('signing.password') : System.getenv('SIGNING_PASSPHRASE')
ext."signing.secretKeyRingFile" = project.hasProperty("signing.secretKeyRingFile") ? project.getProperty('signing.secretKeyRingFile') : ("${System.properties['user.home']}${File.separator}.gnupg${File.separator}secring.gpg")
ext.isReleaseVersion = !projectVersion.endsWith("SNAPSHOT")

ext {
springBootVersion = '2.6.6'
servletVersion = '4.0.1'
}

version projectVersion
group "org.graceframework.plugins"

apply plugin: "eclipse"
apply plugin: "idea"
apply plugin: "groovy"
apply plugin: "maven-publish"
apply plugin: "signing"

repositories {
mavenCentral()
}

dependencies {
compileOnly "org.springframework.boot:spring-boot-autoconfigure:$springBootVersion"
compileOnly "javax.servlet:javax.servlet-api:$servletVersion"
compileOnly "org.graceframework:grace-core:$graceVersion"
compileOnly "org.graceframework:grace-web-common:$graceVersion"
}

tasks.withType(Sign) {
onlyIf { isReleaseVersion }
}

tasks.withType(GroovyCompile) {
configure(groovyOptions) {
forkOptions.jvmArgs = ['-Xmx1024m']
}
}

tasks.withType(Test) {
useJUnitPlatform()
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}

jar {
duplicatesStrategy = DuplicatesStrategy.INCLUDE
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
"Implementation-Title": "Grace Stimulus Plugin",
"Implementation-Version": projectVersion,
"Implementation-Vendor": 'Grace Plugins')
enabled = true
archiveClassifier.set('')
includeEmptyDirs = false
}

publishing {
publications {
maven(MavenPublication) {
groupId = project.group
artifactId = projectName
version = project.version

versionMapping {
usage('java-api') {
fromResolutionOf('runtimeClasspath')
}
usage('java-runtime') {
fromResolutionResult()
}
}

from components.java

pom {
name = "Grace Stimulus Plugin"
description = "Grace Plugin for using Stimulus with Grace."
url = 'https://github.com/grace-plugins/grace-hotwire'
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'https://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'rainboyan'
name = 'Michael Yan'
email = '[email protected]'
}
}
scm {
connection = 'scm:git:git://github.com/grace-plugins/grace-hotwire.git'
developerConnection = 'scm:git:ssh://github.com:grace-plugins/grace-hotwire.git'
url = 'https://github.com/grace-plugins/grace-hotwire'
}
}
}
}
}

afterEvaluate {
signing {
required { isReleaseVersion && gradle.taskGraph.hasTask("publish") }
sign publishing.publications.maven
}
}
4 changes: 4 additions & 0 deletions plugins/stimulus/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
projectName=stimulus
projectVersion=0.0.1-SNAPSHOT
graceVersion=2020.0.0
groovyVersion=3.0.11
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*
* Copyright 2024 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.graceframework.plugins.stimulus

import grails.plugins.*

class StimulusGrailsPlugin extends Plugin {

def version = '0.0.1-SNAPSHOT'
// the version or versions of Grails the plugin is designed for
def grailsVersion = "3.0.0 > *"
// resources that are excluded from plugin packaging
def pluginExcludes = [
"grails-app/views/error.gsp"
]

def title = "Grace Stimulus Plugin"
def author = "Michael Yan"
def authorEmail = "[email protected]"
def description = '''\
Use Stimulus in your Grace app.
'''
def profiles = ['web']

// URL to the plugin's documentation
def documentation = "https://github.com/grace-plugins/grace-hotwire"

// Extra (optional) plugin metadata

// License: one of 'APACHE', 'GPL2', 'GPL3'
def license = "APACHE"

// Details of company behind the plugin (if there is one)
def organization = [ name: "Grace Plugins", url: "https://github.com/grace-plugins/" ]

// Any additional developers beyond the author specified above.
def developers = [ [ name: "Michael Yan", email: "[email protected]" ]]

// Location of the plugin's issue tracker.
def issueManagement = [ system: "GitHub", url: "https://github.com/grace-plugins/grace-hotwire/issues" ]

// Online location of the plugin's browseable source code.
def scm = [ url: "https://github.com/grace-plugins/grace-hotwire.git" ]

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<plugin name='stimulus'>
<type>org.graceframework.plugins.stimulus.StimulusGrailsPlugin</type>
</plugin>
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
rootProject.name = 'grace-hotwire'

include 'plugins:stimulus'
include 'plugins:turbo'

0 comments on commit 5634bd1

Please sign in to comment.