Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

Upgrade to grails 339 and use shipkit, add circleci #12

Merged
merged 2 commits into from
Apr 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
85 changes: 85 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@

version: 2
jobs:
build:
docker:
# docker image with python and mkdocs on it already as well, based on gradle:4.6-alpine
- image: dock9/gradle:4.6

# Specify service dependencies here if necessary
# CircleCI maintains a library of pre-built images
# documented at https://circleci.com/docs/2.0/circleci-images/
# - image: circleci/postgres:9.4

# branches:
# only:
# - master

# working_directory: ~/repo

environment:
# Customize the JVM maximum heap limit
# JVM_OPTS: -Xmx3200m
MALLOC_ARENA_MAX: 2
GRADLE_OPTS: "-Xmx3200m -Dorg.gradle.daemon=false" #daemon false doesn't seem to get picked up by fork
TERM: dumb

parallelism: 1
# resource_class: large

steps:
- checkout

# Download and cache dependencies
- restore_cache:
keys:
- v3-gradle-{{ checksum "build.gradle" }}

# see https://github.com/palantir/gradle-configuration-resolver-plugin
- run: ./gradlew resolveConfigurations
#- run: ./gradlew test-app:dependencies

- save_cache:
paths:
- /home/gradle # the https://hub.docker.com/_/gradle/ containter does wierd stuff for cache
- ~/.m2
- ~/.gradle
key: v3-gradle-{{ checksum "build.gradle" }}

# - add_ssh_keys:
# fingerprints:
# - "32:15:5c:47:98:e9:3f:09:f9:32:c9:22:00:cc:15:9a"

#- run: gradle build -s && gradle ciPublish
- run:
name: gradle check tests. skips if only docs were changed
command: |
commitRange=$(echo "$CIRCLE_COMPARE_URL" | rev | cut -d/ -f1 | rev)
if [[ -z "$commitRange" || $(git diff --name-only $commitRange | grep --invert-match -E "(README\.md|mkdocs\.yml|docs/)") ]]; then
./gradlew check
fi

- run: ./gradlew ciPublish

- store_artifacts:
path: plugin/build/reports/tests/test/
destination: test-reports/unit/

- store_artifacts:
path: plugin/build/reports/codenarc/
destination: codenarc/

- store_test_results:
path: plugin/build/test-results

# - run: gradle test-app:check --no-daemon --max-workers 2

- store_artifacts:
path: examples/test-app/build/reports/tests
destination: test-reports/integration

- store_test_results:
path: examples/test-app/build/test-results


# - run: ./.circleci/publish.sh
54 changes: 54 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
root = true

[*]
end_of_line = lf
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
max_line_length=100

[*.coffee]
indent_style = space
indent_size = 2

[*.js]
indent_style = space
indent_size = 2

[{*.yml,*.yaml}]
indent_style = space
indent_size = 2

[*.css]
indent_style = space
indent_size = 2

[*.styl]
indent_style = space
indent_size = 2

[*.html]
indent_style = space
indent_size = 4

[*.groovy]
indent_style = space
indent_size = 4

[*.gsp]
indent_style = space
indent_size = 4

[*.gradle]
indent_style = space
indent_size = 4

[*.md]
trim_trailing_whitespace = false

# Stylint - https://rosspatton.github.io/stylint/
[{package.json,.stylintrc}]
indent_size = 2

[*.json]
indent_size = 2
145 changes: 40 additions & 105 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,124 +1,59 @@
buildscript {
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.grails:grails-docs:$grailsVersion"
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'io.github.groovylang.groovydoc:groovydoc-gradle-plugin:1.0.1'
classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.8.2"
}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}
dependencies {
classpath "org.grails:grails-gradle-plugin:$grailsVersion"
classpath "org.yakworks:gradle-plugins:0.1.45"
}
}

apply plugin: 'idea'
apply plugin:'groovy'
apply plugin: 'yakworks.shipkit'

repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "http://repo.9ci.com/oss-snapshots" }
}

//Root project and view-tools plugin uses same version.
version project.projectVersion

project(':jasper-reports') {
version = project.projectVersion
}

ext {
commonBuild = new File(project.rootDir, "gradle").absolutePath
grailsApps = ['test-app', 'dynamic-jasper']
grailsPlugins = ['jasper-reports']
}


subprojects {
apply plugin: 'groovy'
plugins.withId('java') {

boolean isGrailsApp = grailsApps.contains(project.name)
boolean isGrailsPlugin = grailsPlugins.contains(project.name)
boolean isGrailsProject = isGrailsApp || isGrailsPlugin
boolean isBuildSnapshot = version.toString().endsWith("-SNAPSHOT")

println project.name + ":" + version.toString()

ext {
userOrg = "grails"
set "tomcat.version", "8.5.5"
isSnapshot = isBuildSnapshot
}

apply plugin:'groovy'

sourceCompatibility = '1.8'
targetCompatibility = '1.8'

repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
}

dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"

runtime "com.h2database:h2"

testCompile "org.grails:grails-plugin-testing"

testCompile "org.grails:grails-gorm-testing-support:1.1.4"
testCompile "org.grails:grails-web-testing-support:1.1.4"
}


if (isGrailsPlugin) {
println "Grails plugin ###"
group "org.grails.plugins"

apply plugin:"org.grails.grails-plugin"
apply plugin:"org.grails.grails-gsp"

apply from: "${commonBuild}/common-publishing.gradle"

dependencies {
compile "org.springframework.boot:spring-boot-starter-actuator"
provided "org.springframework.boot:spring-boot-starter-tomcat"

profile "org.grails.profiles:web-plugin"
provided "org.grails:grails-plugin-services"
provided "org.grails:grails-plugin-domain-class"

console "org.grails:grails-console"
}
sourceCompatibility = '1.8'
targetCompatibility = '1.8'

}
repositories {
mavenLocal()
maven { url "https://repo.grails.org/grails/core" }
maven { url "http://repo.9ci.com/oss-snapshots" }
}

if (isGrailsApp) {
group "org.grails"
dependencies {
compile "org.springframework.boot:spring-boot-starter-logging"
compile "org.springframework.boot:spring-boot-autoconfigure"
compile "org.grails:grails-core"
compile "org.grails:grails-dependencies"
compile "org.grails:grails-web-boot"
compile "org.grails.plugins:cache"

runtime "com.h2database:h2"

apply plugin:"org.grails.grails-web"
apply plugin:"war"
apply plugin:"org.grails.grails-gsp"
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:$versionHibernate"
compile "org.hibernate:hibernate-ehcache:$versionHibernate"

dependencies {
profile "org.grails.profiles:web"
compile "org.springframework.boot:spring-boot-starter-actuator"
provided "org.springframework.boot:spring-boot-starter-tomcat"
testCompile "org.grails:grails-plugin-testing"

console "org.grails:grails-console"
}
testCompile "org.grails:grails-gorm-testing-support"
testCompile "org.grails:grails-web-testing-support"
}

bootRun {
jvmArgs('-Dspring.output.ansi.enabled=always')
addResources = true
}
test {
testLogging.exceptionFormat = 'full'
}

}
}

}
17 changes: 13 additions & 4 deletions examples/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@

version "0.1"

apply plugin: "org.grails.grails-web"
apply plugin: "war"
apply plugin: "org.grails.grails-gsp"

dependencies {
compile "org.grails.plugins:hibernate5"
compile "org.hibernate:hibernate-core:5.1.1.Final"
compile "org.hibernate:hibernate-ehcache:5.1.1.Final"
profile "org.grails.profiles:web"

provided "org.grails:grails-plugin-domain-class"
provided "org.grails:grails-plugin-services"

compile "org.springframework.boot:spring-boot-starter-actuator"
provided "org.springframework.boot:spring-boot-starter-tomcat"

provided "org.codehaus.groovy:groovy-ant"
}

Expand All @@ -19,4 +28,4 @@ grails {
println "Inside grails: $rootProject.name"
compile project(':jasper-reports')
}
}
}
2 changes: 1 addition & 1 deletion examples/app/grails-app/conf/application.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ jasper {
}

}
}
}
2 changes: 1 addition & 1 deletion examples/app/grails-app/conf/logback.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ if (Environment.developmentMode && targetDir) {
logger "grails.app.services.foobar", DEBUG,['STDOUT']
logger "org.grails.gsp.GroovyPageResourceLoader", DEBUG,['STDOUT']
logger "org.grails.gsp.io.DefaultGroovyPageLocator", DEBUG,['STDOUT']
}
}
3 changes: 3 additions & 0 deletions examples/app/grails-app/domain/foo/Bills.groovy
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package foo

import grails.compiler.GrailsCompileStatic

@GrailsCompileStatic
class Bills {

Customer customer
Expand Down
4 changes: 4 additions & 0 deletions examples/app/grails-app/domain/foo/Customer.groovy
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package foo

import grails.compiler.GrailsCompileStatic

/**
* Created by basejump on 10/15/16.
*/
@GrailsCompileStatic
class Customer {
String num
String name

static constraints = {
num nullable:true
}
Expand Down
3 changes: 3 additions & 0 deletions examples/app/grails-app/domain/foo/Product.groovy
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package foo

import grails.compiler.GrailsCompileStatic

/**
* Created by basejump on 10/15/16.
*/
@GrailsCompileStatic
class Product {
ProductGroup group
String num
Expand Down
3 changes: 3 additions & 0 deletions examples/app/grails-app/domain/foo/ProductGroup.groovy
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package foo

import grails.compiler.GrailsCompileStatic

/**
* Created by basejump on 10/15/16.
*/
@GrailsCompileStatic
class ProductGroup {
String name
}
Loading