Add Gradle ownlangExec and generateMarkdownModules tasks

This commit is contained in:
aNNiMON 2023-11-25 17:38:27 +02:00 committed by Victor Melnik
parent 68570f10f1
commit 90314e0cb9
4 changed files with 38 additions and 12 deletions

11
docs/build.gradle Normal file
View File

@ -0,0 +1,11 @@
tasks.register('generateMarkdownModules') {
group = "documentation"
def ownlangExec = tasks.getByPath(':ownlang-desktop:ownlangExec')
doFirst {
ownlangExec.configure {
workingDir '../docs/src'
args '-f', 'docgen-md.own'
}
}
finalizedBy ownlangExec
}

View File

@ -12,7 +12,7 @@ dependencies {
implementation "org.slf4j:slf4j-simple:${versions.slf4j}"
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
testImplementation platform("org.junit:junit-bom:")
testImplementation platform("org.junit:junit-bom:${versions.junit}")
testImplementation 'org.junit.jupiter:junit-jupiter'
}

View File

@ -12,6 +12,12 @@ application {
mainClass = project.mainClassName
}
jar {
manifest {
attributes 'Main-Class': project.mainClassName
}
}
dependencies {
implementation project(":ownlang-core")
implementation project(":ownlang-parser")
@ -26,26 +32,34 @@ test {
useJUnitPlatform()
}
tasks.register('runProgram', JavaExec) {
group = "application"
description = "Run sample program"
def ownlangExec = tasks.register('ownlangExec', JavaExec) {
dependsOn classes
mainClass = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
standardInput = System.in
ignoreExitValue true
args '-f ../program.own'.split(' ')
}
tasks.register('runOptimizing', JavaExec) {
tasks.register('runProgram') {
group = "application"
description = "Run sample program"
doFirst {
ownlangExec.configure {
args '-f ../program.own'.split(' ')
}
}
finalizedBy ownlangExec
}
tasks.register('runOptimizing') {
group = "application"
description = "Run sample program with optimizations and measurements"
dependsOn classes
mainClass = project.mainClassName
classpath = sourceSets.main.runtimeClasspath
ignoreExitValue true
doFirst {
ownlangExec.configure {
args '-o 9 -m -a -f ../program.own'.split(' ')
}
}
finalizedBy ownlangExec
}
tasks.register('runOptimizationDumper', JavaExec) {
group = "application"

View File

@ -4,6 +4,7 @@ include 'ownlang-core'
include 'ownlang-parser'
include 'ownlang-desktop'
include 'ownlang-utils'
include 'docs'
final def modules = ['main', 'canvasfx', 'server']