Skip to content

Instantly share code, notes, and snippets.

View gabehamilton's full-sized avatar

Gabe Hamilton gabehamilton

View GitHub Profile
@gabehamilton
gabehamilton / wrapGroovyScriptInGradle.sh
Last active December 16, 2015 12:59
Full gradle setup to wrap a groovy script.
# 1. Install gvm
curl -s get.gvmtool.net | bash
source "~/.gvm/bin/gvm-init.sh" # will vary depending on your Operating System, read the output of gvm for the exact command
# 2. Install gradle
gvm install gradle
# 3. Grab a gradle project template
echo "apply from: 'http://www.tellurianring.com/projects/gradle-plugins/gradle-templates/apply.groovy'" > build.gradle
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Your Application Name</title>
<!-- Optionally hard code theme and remove deviceTheme below
<link href="//ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojox/mobile/themes/iphone/iphone.css"
<!DOCTYPE html>
<html>
<head>
<meta name="viewport"
content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<title>Your Application Name</title>
<!-- Optionally hard code theme and remove deviceTheme below
<link href="//ajax.googleapis.com/ajax/libs/dojo/1.9.0/dojox/mobile/themes/iphone/iphone.css"

External configuration in Grails 3


Working on Grails 3 I realized that I no longer can specify external configuration using the standard grails.config.locations property in Config.groovy file.

Reason is obvious! There is no Config.groovy now in Grails 3. Instead we now use application.yml to configure the properties. However, you can't specify the external configuration using this file too!

What the hack?

Now Grails 3 uses Spring's property source concept. To enable external config file to work we need to do something extra now.