Skip to content

Commit 90314e0

Browse files
committed
Add Gradle ownlangExec and generateMarkdownModules tasks
1 parent 68570f1 commit 90314e0

File tree

4 files changed

+38
-12
lines changed

4 files changed

+38
-12
lines changed

docs/build.gradle

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
tasks.register('generateMarkdownModules') {
2+
group = "documentation"
3+
def ownlangExec = tasks.getByPath(':ownlang-desktop:ownlangExec')
4+
doFirst {
5+
ownlangExec.configure {
6+
workingDir '../docs/src'
7+
args '-f', 'docgen-md.own'
8+
}
9+
}
10+
finalizedBy ownlangExec
11+
}

modules/server/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies {
1212
implementation "org.slf4j:slf4j-simple:${versions.slf4j}"
1313
implementation "com.fasterxml.jackson.core:jackson-databind:${versions.jackson}"
1414

15-
testImplementation platform("org.junit:junit-bom:")
15+
testImplementation platform("org.junit:junit-bom:${versions.junit}")
1616
testImplementation 'org.junit.jupiter:junit-jupiter'
1717
}
1818

ownlang-desktop/build.gradle

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ application {
1212
mainClass = project.mainClassName
1313
}
1414

15+
jar {
16+
manifest {
17+
attributes 'Main-Class': project.mainClassName
18+
}
19+
}
20+
1521
dependencies {
1622
implementation project(":ownlang-core")
1723
implementation project(":ownlang-parser")
@@ -26,25 +32,33 @@ test {
2632
useJUnitPlatform()
2733
}
2834

29-
tasks.register('runProgram', JavaExec) {
30-
group = "application"
31-
description = "Run sample program"
35+
def ownlangExec = tasks.register('ownlangExec', JavaExec) {
3236
dependsOn classes
3337
mainClass = project.mainClassName
3438
classpath = sourceSets.main.runtimeClasspath
3539
standardInput = System.in
36-
ignoreExitValue true
37-
args '-f ../program.own'.split(' ')
3840
}
3941

40-
tasks.register('runOptimizing', JavaExec) {
42+
tasks.register('runProgram') {
43+
group = "application"
44+
description = "Run sample program"
45+
doFirst {
46+
ownlangExec.configure {
47+
args '-f ../program.own'.split(' ')
48+
}
49+
}
50+
finalizedBy ownlangExec
51+
}
52+
53+
tasks.register('runOptimizing') {
4154
group = "application"
4255
description = "Run sample program with optimizations and measurements"
43-
dependsOn classes
44-
mainClass = project.mainClassName
45-
classpath = sourceSets.main.runtimeClasspath
46-
ignoreExitValue true
47-
args '-o 9 -m -a -f ../program.own'.split(' ')
56+
doFirst {
57+
ownlangExec.configure {
58+
args '-o 9 -m -a -f ../program.own'.split(' ')
59+
}
60+
}
61+
finalizedBy ownlangExec
4862
}
4963

5064
tasks.register('runOptimizationDumper', JavaExec) {

settings.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ include 'ownlang-core'
44
include 'ownlang-parser'
55
include 'ownlang-desktop'
66
include 'ownlang-utils'
7+
include 'docs'
78

89
final def modules = ['main', 'canvasfx', 'server']
910

0 commit comments

Comments
 (0)