diff options
author | 2020-05-19 21:22:01 +0200 | |
---|---|---|
committer | 2020-05-19 22:11:37 +0200 | |
commit | 167e0470bc4562f77d46d8af8c0ef6794dfee693 (patch) | |
tree | 8f647b4a6d6b412b9e912a4e0841a2898e830b13 /Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend | |
parent | Config language WIP (diff) | |
parent | Merge branch 'master' of https://github.com/viatra/VIATRA-Generator (diff) | |
download | VIATRA-Generator-167e0470bc4562f77d46d8af8c0ef6794dfee693.tar.gz VIATRA-Generator-167e0470bc4562f77d46d8af8c0ef6794dfee693.tar.zst VIATRA-Generator-167e0470bc4562f77d46d8af8c0ef6794dfee693.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend index c9ec68bb..04449a74 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/ScriptExecutor.xtend | |||
@@ -4,6 +4,7 @@ import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigRef | |||
4 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigSpecification | 4 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigSpecification |
5 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | 5 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript |
6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.CustomEntry | 6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.CustomEntry |
7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.DocumentLevelSpecification | ||
7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.DocumentationEntry | 8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.DocumentationEntry |
8 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport | 9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.EPackageImport |
9 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.FileReference | 10 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.FileReference |
@@ -24,11 +25,10 @@ import hu.bme.mit.inf.dslreasoner.application.execution.util.ApplicationConfigur | |||
24 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel | 25 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.DocumentationLevel |
25 | import java.util.LinkedHashMap | 26 | import java.util.LinkedHashMap |
26 | import java.util.Optional | 27 | import java.util.Optional |
27 | import org.eclipse.emf.common.util.URI | ||
28 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.DocumentLevelSpecification | ||
29 | import org.eclipse.core.runtime.jobs.Job | ||
30 | import org.eclipse.core.runtime.IProgressMonitor | 28 | import org.eclipse.core.runtime.IProgressMonitor |
31 | import org.eclipse.core.runtime.Status | 29 | import org.eclipse.core.runtime.Status |
30 | import org.eclipse.core.runtime.jobs.Job | ||
31 | import org.eclipse.emf.common.util.URI | ||
32 | 32 | ||
33 | class ScriptExecutor { | 33 | class ScriptExecutor { |
34 | val parser = new ApplicationConfigurationParser | 34 | val parser = new ApplicationConfigurationParser |
@@ -56,8 +56,12 @@ class ScriptExecutor { | |||
56 | public def executeScript(ConfigurationScript script, IProgressMonitor monitor) { | 56 | public def executeScript(ConfigurationScript script, IProgressMonitor monitor) { |
57 | script.activateAllEPackageReferences | 57 | script.activateAllEPackageReferences |
58 | val tasks = script.commands.filter(Task) | 58 | val tasks = script.commands.filter(Task) |
59 | val intermediateScriptConsole = new ScriptConsole(true,false,null,null,null) | ||
59 | 60 | ||
60 | for(taskIndex : 0..<tasks.size) { | 61 | for(taskIndex : 0..<tasks.size) { |
62 | if(taskIndex>0) { | ||
63 | restForMeasurements(intermediateScriptConsole) | ||
64 | } | ||
61 | val task = tasks.get(taskIndex) | 65 | val task = tasks.get(taskIndex) |
62 | monitor.beginTask('''Executing task«IF tasks.size>1» «taskIndex+1»«ENDIF»: «task.name»''',task.totalWork) | 66 | monitor.beginTask('''Executing task«IF tasks.size>1» «taskIndex+1»«ENDIF»: «task.name»''',task.totalWork) |
63 | task.execute(monitor) | 67 | task.execute(monitor) |
@@ -234,4 +238,14 @@ class ScriptExecutor { | |||
234 | } | 238 | } |
235 | } | 239 | } |
236 | } | 240 | } |
241 | static val boolean measuring = true | ||
242 | static def restForMeasurements(ScriptConsole console) { | ||
243 | if(measuring) { | ||
244 | if(console !== null) { | ||
245 | console.writeMessage('''Cleaning memory.''') | ||
246 | } | ||
247 | System.gc System.gc System.gc | ||
248 | Thread.sleep(2500) | ||
249 | } | ||
250 | } | ||
237 | } \ No newline at end of file | 251 | } \ No newline at end of file |