Re: svn commit: r1783852 - /ofbiz/ofbiz-framework/trunk/build.gradle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: svn commit: r1783852 - /ofbiz/ofbiz-framework/trunk/build.gradle

Jacques Le Roux
Administrator
Good idea Taher!

Thanks

Jacques


Le 21/02/2017 à 10:21, [hidden email] a écrit :

> Author: taher
> Date: Tue Feb 21 09:21:01 2017
> New Revision: 1783852
>
> URL: http://svn.apache.org/viewvc?rev=1783852&view=rev
> Log:
> Disable the gradle daemon on embedded plugin tasks
> (OFBIZ-9182)
>
> In prepartion to update our buildbot scripts, we disable the daemon from
> running in the plugin API calls. This substantially improves memory consumption.
> The change applies to both installPlugin function as well as the
> ofbizBackground task design
>
> Modified:
>      ofbiz/ofbiz-framework/trunk/build.gradle
>
> Modified: ofbiz/ofbiz-framework/trunk/build.gradle
> URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/build.gradle?rev=1783852&r1=1783851&r2=1783852&view=diff
> ==============================================================================
> --- ofbiz/ofbiz-framework/trunk/build.gradle (original)
> +++ ofbiz/ofbiz-framework/trunk/build.gradle Tue Feb 21 09:21:01 2017
> @@ -606,10 +606,6 @@ task installPlugin(group: ofbizPlugin, d
>                   doLast { println "No install task defined for plugin ${pluginId}" }
>               }
>           } else {
> -            /* if the plugin is not added to component-load.xml, then add
> -             * it to the file and call gradle again to load the new plugin
> -             * as a gradle subproject and install it i.e. gradle calling gradle
> -             */
>               doLast {
>                   installPlugin pluginId
>               }
> @@ -923,18 +919,18 @@ def createOfbizCommandTask(taskName, arg
>   def createOfbizBackgroundCommandTask(taskName) {
>       def sourceTask = taskName.tokenize().first()
>       def arguments = (taskName - sourceTask)
> -
> +    def serverCommand = "ofbiz ${arguments}".toString()
>       def gradleRunner = os.contains('windows') ? 'gradlew.bat' : './gradlew'
>  
>       task (taskName) {
>           doLast {
> -            spawnProcess(gradleRunner, "ofbiz ${arguments}")
> +            spawnProcess([gradleRunner, "--no-daemon", serverCommand])
>           }
>       }
>   }
>  
> -def spawnProcess(command, arguments) {
> -    ProcessBuilder pb = new ProcessBuilder(command, arguments)
> +def spawnProcess(command) {
> +    ProcessBuilder pb = new ProcessBuilder(command)
>       File consoleLog = file("${rootDir}/runtime/logs/console.log");
>  
>       pb.directory(file("${rootDir}"))
> @@ -1022,5 +1018,5 @@ def taskExistsInproject(fullyQualifiedPr
>  
>   def installPlugin(pluginId) {
>       def gradleRunner = os.contains('windows') ? 'gradlew.bat' : './gradlew'
> -    exec { commandLine gradleRunner, 'installPlugin', "-PpluginId=${pluginId}" }
> +    exec { commandLine gradleRunner, '--no-daemon', 'installPlugin', "-PpluginId=${pluginId}" }
>   }
>
>
>