Own-Programming-Language-Tu.../ownlang-desktop/build.gradle

72 lines
1.7 KiB
Groovy
Raw Permalink Normal View History

2023-08-26 15:59:36 +03:00
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
2023-08-26 15:59:36 +03:00
id 'java'
id 'application'
}
group = 'com.annimon'
2023-12-15 22:18:29 +02:00
version = versions.project
2023-08-26 15:59:36 +03:00
2023-08-27 17:32:13 +03:00
ext.mainClassName = 'com.annimon.ownlang.Main'
2023-08-26 15:59:36 +03:00
application {
2023-08-27 17:32:13 +03:00
mainClass = project.mainClassName
2023-08-26 15:59:36 +03:00
}
jar {
manifest {
attributes 'Main-Class': project.mainClassName
}
}
2023-08-26 15:59:36 +03:00
dependencies {
implementation project(":ownlang-core")
implementation project(":ownlang-parser")
implementation project(":ownlang-utils")
implementation project(":modules:main")
testImplementation platform("org.junit:junit-bom:${versions.junit}")
2023-08-26 15:59:36 +03:00
testImplementation 'org.junit.jupiter:junit-jupiter'
}
test {
useJUnitPlatform()
}
def ownlangExec = tasks.register('ownlangExec', JavaExec) {
2023-08-26 15:59:36 +03:00
dependsOn classes
2023-08-27 17:32:13 +03:00
mainClass = project.mainClassName
2023-08-26 15:59:36 +03:00
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
}
tasks.register('runProgram') {
group = "application"
description = "Run sample program"
doFirst {
ownlangExec.configure {
args '-f ../program.own'.split(' ')
}
}
finalizedBy ownlangExec
}
tasks.register('runOptimizing') {
2023-08-27 17:32:13 +03:00
group = "application"
description = "Run sample program with optimizations and measurements"
doFirst {
ownlangExec.configure {
args '-o 9 -m -a -f ../program.own'.split(' ')
}
}
finalizedBy ownlangExec
}
tasks.register('runOptimizationDumper', JavaExec) {
group = "application"
description = "Run optmizer and dump results"
dependsOn classes
mainClass = 'com.annimon.ownlang.utils.OptimizationDumper'
classpath = sourceSets.main.runtimeClasspath
args '../program.own'
}