From b88207175e04aa38a8a4413e9a75a2ed21fa7cb9 Mon Sep 17 00:00:00 2001 From: aNNiMON Date: Sun, 27 Aug 2023 17:32:13 +0300 Subject: [PATCH] Configure run tasks --- ownlang-desktop/build.gradle | 18 ++++++++++++------ program.own | 3 --- visitor.own | 5 ----- 3 files changed, 12 insertions(+), 14 deletions(-) delete mode 100644 visitor.own diff --git a/ownlang-desktop/build.gradle b/ownlang-desktop/build.gradle index 87751b5..ae54add 100644 --- a/ownlang-desktop/build.gradle +++ b/ownlang-desktop/build.gradle @@ -7,8 +7,9 @@ plugins { group = 'com.annimon' version = '2.0-SNAPSHOT' +ext.mainClassName = 'com.annimon.ownlang.Main' application { - mainClass ='com.annimon.ownlang.Main' + mainClass = project.mainClassName } dependencies { @@ -25,18 +26,23 @@ test { useJUnitPlatform() } -/*tasks.register('run', JavaExec) { +tasks.register('runProgram', JavaExec) { + group = "application" + description = "Run sample program" dependsOn classes - mainClass = project.mainClass + mainClass = project.mainClassName classpath = sourceSets.main.runtimeClasspath standardInput = System.in ignoreExitValue true + args '-f ../program.own'.split(' ') } tasks.register('runOptimizing', JavaExec) { + group = "application" + description = "Run sample program with optimizations and measurements" dependsOn classes - mainClass = project.mainClass + mainClass = project.mainClassName classpath = sourceSets.main.runtimeClasspath ignoreExitValue true - args '-o 9 -m -a -f program.own'.split(' ') -}*/ \ No newline at end of file + args '-o 9 -m -a -f ../program.own'.split(' ') +} \ No newline at end of file diff --git a/program.own b/program.own index 239b839..fb6e712 100644 --- a/program.own +++ b/program.own @@ -242,9 +242,6 @@ println 1 :: 2 :: 3 println "\u042a" -include "visitor.own" - - use "date" d = newDate(); println d diff --git a/visitor.own b/visitor.own deleted file mode 100644 index e9548e6..0000000 --- a/visitor.own +++ /dev/null @@ -1,5 +0,0 @@ -function() -def function() print "function\n" - -a = 2 + 3 * 4 -print a \ No newline at end of file