Skip to content

Commit

Permalink
Updated external-config plugin meta-data
Browse files Browse the repository at this point in the history
  • Loading branch information
sbglasius committed Jan 2, 2022
1 parent 2091e9b commit c4b0a34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea/
*.iml
6 changes: 3 additions & 3 deletions grails-plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -1828,16 +1828,16 @@
"Apache-2.0"
],
"issueTrackerUrl": "https://github.com/sbglasius/external-config/issues",
"latestVersion": "1.4.0",
"updated": "2019-07-17T10:39:49.954Z",
"latestVersion": "3.0.0",
"updated": "2022-01-02T10:39:49.954Z",
"systemIds": [
"dk.glasius:external-config"
],
"vcsUrl": "https://github.com/sbglasius/external-config"
},
"documentationUrl": null,
"mavenMetadataUrl": null,
"readme": "<h1>External-Config</h1>\n<p><a href=\"https://github.com/sbglasius/external-config/actions/workflows/gradle-check.yml\"><img src=\"https://github.com/sbglasius/external-config/actions/workflows/gradle-check.yml/badge.svg\" alt=\"Tests\" /></a></p>\n<p>This plugin will mimic the Grails 2 way of handling external configurations defined in <code>grails.config.locations</code>.</p>\n<p>It also provides scripts to convert between yml &amp; groovy config.</p>\n<h2>Versions</h2>\n<p>| Grails | external-config |\n|--|--|\n| 4.x.x | 2.0.1 |\n| 3.3.x | 1.4.0 |</p>\n<h2>Contributors</h2>\n<p>Major contributors</p>\n<ul>\n<li><a href=\"https://github.com/jespersm\">Jesper Steen M\ufffd\ufffd\ufffd\ufffdller</a></li>\n<li><a href=\"https://github.com/virtualdogbert\">Tucker J. Pelletier</a></li>\n<li><a href=\"https://github.com/tkvw\">Dennie de Lange</a></li>\n<li><a href=\"https://github.com/snimavat\">Sudhir Nimavat</a></li>\n<li><a href=\"https://github.com/andersaaberg\">Anders Aaberg</a></li>\n</ul>\n<p>Thank you!</p>\n<h2>Installation</h2>\n<p><strong>Note:</strong> New coordinates! Not published with <code>grails.org.plugins</code> coordinates since BinTray went out of business. Now published under <code>dk.glasius</code></p>\n<p>Add dependency to your <code>build.gradle</code>:</p>\n<pre><code class=\"language-groovy\">dependencies {\n compile 'dk.glasius:external-config:2.0.1' // or latest version\n}\n</code></pre>\n<h2>Usage</h2>\n<p>When you add this plugin to your Grails build, it will automatically look for the property <code>grails.config.locations</code>. Define this in either <code>application.yml</code> like this:</p>\n<pre><code class=\"language-yml\">grails:\n config:\n locations:\n - classpath:myconfig.groovy\n - classpath:myconfig.yml\n - classpath:myconfig.properties\n - file:///etc/app/myconfig.groovy\n - file:///etc/app/myconfig.yml\n - file:///etc/app/myconfig.properties\n - ~/.grails/myconfig.groovy\n - ~/.grails/myconfig.yml\n - ~/.grails/myconfig.properties\n - file:${catalina.base}/myconfig.groovy\n - file:${catalina.base}/myconfig.yml\n - file:${catalina.base}/myconfig.properties\n</code></pre>\n<p>or in <code>application.groovy</code> like this:</p>\n<pre><code class=\"language-groovy\">grails.config.locations = [\n &quot;classpath:myconfig.groovy&quot;,\n &quot;classpath:myconfig.yml&quot;,\n &quot;classpath:myconfig.properties&quot;,\n &quot;file:///etc/app/myconfig.groovy&quot;,\n &quot;file:///etc/app/myconfig.yml&quot;,\n &quot;file:///etc/app/myconfig.properties&quot;,\n &quot;~/.grails/myconfig.groovy&quot;,\n &quot;~/.grails/myconfig.yml&quot;,\n &quot;~/.grails/myconfig.properties&quot;,\n 'file:${catalina.base}/myconfig.groovy',\n 'file:${catalina.base}/myconfig.yml',\n 'file:${catalina.base}/myconfig.properties',\n]\n</code></pre>\n<p>It is also possible to define it in an environment specific block (yml):</p>\n<pre><code class=\"language-yml\">environments:\n test:\n grails:\n config:\n locations:\n - ... \n</code></pre>\n<p>or (groovy)</p>\n<pre><code class=\"language-groovy\">environments {\n test {\n grails {\n config {\n locations = [...]\n }\n }\n }\n} \n</code></pre>\n<p><code>~/</code> references the users <code>$HOME</code> directory.\nNotice, that using a system property you should use single quotes because otherwise it's interpreted as a Gstring.</p>\n<p>The plugin will skip configuration files that are not found.</p>\n<p>For <code>.groovy</code> and <code>.yml</code> files the <code>environments</code> blocks in the config file are interpreted the same way, as in <code>application.yml</code> or <code>application.groovy</code>.</p>\n<h3>Wildcard support</h3>\n<p>It is possible to use <code>*</code> as wildcards in the filename part of the configuration:</p>\n<pre><code class=\"language-yaml\">grails:\n config:\n locations:\n - file:/etc/app/myconfig*.groovy\n - ~/.grails/myconfig*.groovy\n</code></pre>\n<p>or</p>\n<pre><code class=\"language-groovy\">grails.config.locations = [\n &quot;file:/etc/app/myconfig*.groovy&quot;,\n &quot;~/.grails/myconfig*.groovy&quot;,\n]\n</code></pre>\n<p><strong>Note</strong>: that it only works for the <code>file:</code> and <code>~/</code> prefix.</p>\n<p><strong>Note</strong>: the wildcards are in the order they are found in the <code>locations</code> list, but the order of the expanded <code>locations</code> for each wildcard is not guaranteed, and is dependent on the OS used.</p>\n<h3>Getting configuration from another folder than /conf on classpath without moving it with Gradle script</h3>\n<p>If you wish to make your Grails application pull external configuration from classpath when running locally, but you do not wish to get it packed into the assembled war file (i.e. place the external configuration file in e.g. /external-config instead of /conf), then you can include the external configuration file to the classpath by adding the following line to build.gradle:dependencies</p>\n<pre><code class=\"language-groovy\">provided files('external-config') // provided to ensure that external config is not included in the war file\n</code></pre>\n<p>Alternatively, you can make a gradle script to move the external configuration file to your classpath (e.g. /build/classes)</p>\n<h2>Scripts</h2>\n<p>This plugin also includes two scripts, one for converting yml config, to groovy config,\nand one for converting groovy config to yml config. These scripts are not guaranteed to be\nperfect, but you should report any edge cases for the yml to groovy config here:\nhttps://github.com/virtualdogbert/GroovyConfigWriter/issues</p>\n<p><code>grails yml-to-groovy-config</code> has the following parameters:</p>\n<ul>\n<li>ymlFile - The yml input file.</li>\n<li>asClosure - An optional flag to set the output to be closure based or map based. The Default is closure based</li>\n<li>outputFile - The optional output file. If none is provided, then the output will go to System.out.</li>\n<li>indent - Optional indent. The default is 4 spaces</li>\n<li>escapeList - An optional CSV list of values to escape, with no spaces. The default is 'default'</li>\n</ul>\n<h3>Sample usage</h3>\n<pre><code>grails yml-to-groovy-config [ymlFile] [optional asClosure] [optional outputFile] [optional indent] [optional escape list]\n</code></pre>\n<p><code>grails groovy-to-yml-config</code> has the following parameters:</p>\n<ul>\n<li>groovy - The groovy input file.'</li>\n<li>outputFile - The optional output file. If none is provided, then the output will go to System.out.</li>\n<li>indent' - Sets the optional indent level for a file. The default is 4</li>\n<li>flow - Sets the optional style of BLOCK or FLOWS. The default is BLOCK.</li>\n</ul>\n<h3>Sample usage</h3>\n<pre><code>grails groovy-to-yml-config [ymlFile] [optional outputFile] [optional indent] [optinal flow]\n</code></pre>\n"
"readme": "<p><a href=\"https://github.com/sbglasius/external-config\">See the README</a> on GitHub</p>"
},
{
"bintrayPackage": {
Expand Down

0 comments on commit c4b0a34

Please sign in to comment.