title: Changing properties in Grails 3 application yml file through gradle
body: <p>There are some properties that I have in the default generated application.yml file in Grails 3. Take for example this property</p>
  
  <pre><code>test:
      network:
          path: '/home/cool/testing_data'
  </code></pre>
  
  <p>Now, the part that I want to do is change this property when I invoke the build script, so that it is different for the various OS that it might be executed on. I.e: On windows, that path should be 'E:/shared/testing_data', and on solaris, something different.</p>
  
  <p>Using this post <a href="https://stackoverflow.com/questions/11235614/how-to-detect-the-current-os-from-gradle">here</a>, I can conclude that I can identify which OS I am currently on, so that I can potentially make some changes. Ex:</p>
  
  <pre><code>import org.apache.tools.ant.taskdefs.condition.Os
  task checkWin() &lt;&lt; {
      if (Os.isFamily(Os.FAMILY_WINDOWS)) {
          // it is windows, lets change the path to not be linux like
      }
  }
  </code></pre>
  
  <p>So my question is, using gradle or any other means as necessary, can I change the properties in application.yml file to accommodate the different OS systems that the application might be deployed on? I am considering reading the application.yml file line by line and doing a string replacement, but I will resort to this only if there are no cleaner solutions.</p>
  
  <p>Maybe am I using the wrong tool to solve this problem as is, so a good question to ask is, is there an easier way that I am missing here, possibly a similar approach to different "environments" like :test, dev, prod, for operating systems, already built into the core functionality of grails that I can re-use?</p>