-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
114 lines (91 loc) · 3.36 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
import groovy.xml.MarkupBuilder
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.ajoberstar:gradle-git:1.1.0'
}
}
plugins {
id 'net.nemerosa.versioning' version '2.0.0'
}
apply plugin: 'java'
apply plugin: 'scala'
static def os() {
def system = System.getProperty("os.name", "generic").toLowerCase(Locale.ENGLISH)
if(system.contains("nux")) return "linux"
else if(system.contains("windows")) return "windows"
else if(system.contains("mac")) return "macos"
else throw new IllegalStateException("Unsupported operating system")
}
ext {
platform = project.properties['platform'] ?: os()
}
import org.ajoberstar.grgit.*
ext.repo = Grgit.open(project.file('.'))
group 'net.warpgame'
//def branch = "${System.env.GIT_BRANCH ? System.env.GIT_BRANCH : versioning.info.branch}"
//version "${branch.replace("origin/", "")}-0.1.2.${versioning.info.build}"
repositories {
mavenCentral()
}
dependencies {
compile 'org.slf4j:slf4j-api:1.7.12'
testCompile 'junit:junit:4.12'
}
subprojects.each { subproject -> evaluationDependsOn(subproject.path) }
jar {
zip64 true
from {
project.configurations.compile
.collect { it.isDirectory() ? it : zipTree(it) }
}
manifest {
attributes 'Main-Class': 'net.warpgame.engine.core.runtime.EngineLauncher'
}
baseName = "Warp-${platform}"
}
dependencies {
compile project(':graphicstest')
compile group: 'org.codehaus.groovy', name: 'groovy-xml', version: '2.5.6'
}
task runEngine(type:JavaExec) {
main = "net.warpgame.engine.core.runtime.EngineLauncher"
classpath = sourceSets.main.runtimeClasspath
if(project.hasProperty('cl')){
args(cl)
}
jvmArgs '-Djava.system.class.loader=net.warpgame.engine.core.runtime.EngineClassLoader'
}
static def createConfiguration(taskName, mainClass, mod) {
def runConfigurationsDir = new File(".idea/runConfigurations")
runConfigurationsDir.mkdirs()
def launcherClass = "net.warpgame.engine.core.runtime.EngineLauncher"
def props = "-Djava.system.class.loader=net.warpgame.engine.core.runtime.EngineClassLoader"
def writer = new FileWriter(new File(runConfigurationsDir, "${taskName}.xml"))
def xml = new MarkupBuilder(writer)
xml.component(name: "ProjectRunConfigurationManager") {
configuration(default: 'false', name: taskName, type: "Application", factoryName: "Application", singleton: "true") {
option(name: 'MAIN_CLASS_NAME', value: launcherClass)
option(name: 'VM_PARAMETERS', value: props)
option(name: 'PROGRAM_PARAMETERS', value: mainClass)
option(name: 'WORKING_DIRECTORY', value: 'file://$PROJECT_DIR$')
module(name: mod)
}
}
}
task createRunConfigurations {
createConfiguration("SP - Vulkan Test", "net.warpgame.engine.graphicstest.GraphicsTest", "graphicstest_main")
createConfiguration("MP - Server Test", "net.warpgame.servertest.server.ServerTest", "servertest_main")
createConfiguration("MP - Client Test", "net.warpgame.servertest.client.ClientTest", "servertest_main")
createConfiguration("IDE - Ai Behavior Tree Editor", "net.warpgame.ide.AiBehaviorTreeEditor", "ide_main")
}
subprojects {
group 'net.warpgame'
version '0.1.2'
test {
reports.html.enabled = false
reports.junitXml.enabled = true
}
}