-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
140 lines (126 loc) · 6.25 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
// Copyright by Barry G. Becker, 2016 - 2021. Licensed under MIT License: http://www.opensource.org/licenses/MIT
buildscript {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots/"}
maven { url "https://oss.sonatype.org/content/repositories/releases" }
}
dependencies {
classpath 'com.barrybecker4:bb4-gradle:1.8-SNAPSHOT'
}
}
plugins {
id "com.github.maiflai.scalatest" version "0.32" // needed to run scala tests
}
description = 'A framework for creating adventure games. It could also be used for other educational purposes.'
group = 'com.barrybecker4'
version = '1.7'
ext {
archivesBaseName = 'bb4-adventure'
mainClass = "com.barrybecker4.puzzle.adventure.ui.GraphicalAdventureApp"
}
apply from: project.buildscript.classLoader.getResource('bb4.gradle').toURI()
dependencies {
implementation 'com.barrybecker4:bb4-sound:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-ui:1.8-SNAPSHOT'
implementation 'com.barrybecker4:bb4-common:1.8-SNAPSHOT'
}
// The appMap is used to create the list of available applications in the html index page and to generate the app tasks.
ext.appMap = new LinkedHashMap()
appMap['adventure'] = [
title: 'Ludlow Adventure',
command: 'bb4-adventure ludlowScript.xml',
mainClass: 'com.barrybecker4.puzzle.adventure.ui.GraphicalAdventureApp',
resourcePath: 'com/barrybecker4/puzzle/adventure/stories/ludlow/',
script: 'ludlowScript.xml',
description: 'Explore a haunted house.',
longDescription: 'This started as a simple text based adventure. The scenes are stored in an xml file. ' +
'I thought it would be cool to have images and sounds associated with the scenes, so I added a UI. ' +
'When editing the xml file got tedious, I decided to add the graphical editor. ' +
'You can edit the story if you know the password. ' +
'Next I may add support for keeping track of found items and hit-points. ' +
'This story is based on an adventure published by James M. Ward in Dragon Magazine back in 1980.'
]
appMap['textAdventure'] = [
title: 'Ludlow Text Adventure',
command: 'bb4-text-adventure ludlowScript.xml',
mainClass: 'com.barrybecker4.puzzle.adventure.TextAdventure',
resourcePath: 'com/barrybecker4/puzzle/adventure/stories/ludlow/',
script: 'ludlowScript.xml',
description: 'Explore a haunted house.',
longDescription: 'The scenes are stored in an xml file. ' +
'This story is based on an adventure published by James M. Ward in Dragon Magazine back in 1980.'
]
appMap['binaryTutorial'] = [
title: 'Binary Tutorial',
command: 'bb4-adventure binaryScript.xml com/barrybecker4/puzzle/adventure/stories/learnBinary/',
mainClass: 'com.barrybecker4.puzzle.adventure.ui.GraphicalAdventureApp',
resourcePath: 'com/barrybecker4/puzzle/adventure/stories/learnBinary/',
script: 'binaryScript.xml',
description: 'Learn about binary numbers.',
longDescription: 'The same framework that is used to make adventure games ' +
'can also be used for pedagogical purposes. ' +
'Here, the socratc method is used to teach about binary numbers.'
]
appMap['textBinaryTutorial'] = [
title: 'Binary Tutorial (text version)',
command: 'bb4-text-adventure binaryScript.xml com/barrybecker4/puzzle/adventure/stories/learnBinary/',
mainClass: 'com.barrybecker4.puzzle.adventure.TextAdventure',
resourcePath: 'com/barrybecker4/puzzle/adventure/stories/learnBinary/',
script: 'binaryScript.xml',
description: 'Learn about binary numbers.',
longDescription: 'The same framework that is used to make adventure games ' +
'can also be used for pedagogical purposes.'
]
appMap['aikidoEditor'] = [
title: 'Aikido Editor',
command: 'bb4-adventure techniques.xml com/barrybecker4/puzzle/adventure/stories/aikido/',
mainClass: 'com.barrybecker4.puzzle.adventure.ui.AikidoEditor',
resourcePath: 'com/barrybecker4/puzzle/adventure/stories/aikido/',
//resourcePath: '../../bb4-aikido-app/deployment/techniques/',
script: 'techniques.xml',
description: 'Edit library of aikido techniques for builder application.',
longDescription: 'The same framework that is used to make adventure games ' +
'can also be used for editing aikido techniques.'
]
appMap.each { appId, propMap ->
def mainClass = "com.barrybecker4.puzzle.adventure.ui.GraphicalAdventureApp"
if (propMap.containsKey('mainClass'))
mainClass = propMap['mainClass'] // "${propMap['mainClass']}"
println("mainClass = ${mainClass})")
def argsList = []
if (propMap.containsKey('script'))
argsList << "${propMap['script']}"
if (propMap.containsKey('resourcePath'))
argsList << "${propMap['resourcePath']}"
tasks.create(name: "run${appId.capitalize()}", type: JavaExec, description: "${propMap.description}") {
group = 'application'
mainClassName = "${mainClass}"
standardInput = System.in
args = argsList
classpath = sourceSets.main.runtimeClasspath
jvmArgs = ["-ea"]
}
}
ext.jarMap = new LinkedHashMap()
jarMap['adventure'] = [
include:['com/barrybecker4/puzzle/adventure/**'],
exclude:['com/barrybecker4/puzzle/adventure/**/*.pdf']
]
// The application is deployed to /build/distributions. Run scripts are in the bin directory.
// Additional script to run text version.
// It can take parameters like 'ludlow/ludlowScript.xml' or 'learnBinary/binaryScript.xml'
task createTextAdventureApp(type: CreateStartScripts) {
mainClass.set("com.barrybecker4.puzzle.adventure.TextAdventure")
classpath = startScripts.classpath
outputDir = startScripts.outputDir
applicationName = 'bb4-text-adventure'
defaultJvmOpts = ["-Xmx1024m"]
}
// add extra execution scripts
applicationDistribution.into("bin") {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(createTextAdventureApp)
fileMode = 0755
}
apply from: project.buildscript.classLoader.getResource('bb4-publish.gradle').toURI()
apply from: project.buildscript.classLoader.getResource('bb4-deploy.gradle').toURI()