-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
130 lines (109 loc) · 2.75 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
println """
*******************************************
You are building Mani!
Output files will be in /build/libs
*******************************************
"""
group 'Mani'
version '1.0-SNAPSHOT'
apply from: 'config/ide.gradle'
apply plugin: 'java'
apply plugin: 'application'
apply plugin: 'idea'
mainClassName = 'Mani'
sourceSets.main.java.srcDirs = ['src']
sourceCompatibility = 1.8
ext.buildNumber = System.getenv("BUILD_NUMBER") ?: "dev"
version 'Stable'
task start(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = "com.mani.lang.main.Mani"
}
task startCompiled(type: JavaExec) {
classpath sourceSets.main.runtimeClasspath
main = "com.mani.compiler.ManiCompiler"
}
jar {
manifest {
attributes 'Main-Class': 'com.mani.lang.main.Mani'
}
}
task buildCompiler(type: Jar) {
manifest {
attributes 'Main-Class': 'com.mani.compiler.ManiCompiler'
}
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
with jar
sourceSets {
main {
resources {
srcDirs "src/com/mani/compiler/resources"
}
}
}
}
task fatJar(type: Jar) {
version 'FatJar'
manifest {
attributes 'Main-Class': 'com.mani.lang.main.Mani'
}
from {
configurations.compile.collect {
it.isDirectory() ? it : zipTree(it)
}
}
with jar
sourceSets {
main {
into 'stdlib', {
from 'stdlib'
}
}
}
}
repositories {
mavenCentral()
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:okhttp:3.14.0'
compile 'org.mongodb:mongo-java-driver:2.12.3'
compile 'io.socket:socket.io-client:1.0.0'
compile 'com.neovisionaries:nv-websocket-client:2.8'
}
// For IntelliJ
idea {
module.excludeDirs += file('examples');
module.downloadSources = true
project {
// Set JDK
jdkName = '1.8'
wildcards -= '!?*.groovy'
ipr {
withXml { xmlProvider ->
def iprNode = xmlProvider.asNode()
ideaActivateCopyright(iprNode)
ideaActivateGradle(iprNode)
ideaActivateCopyright(iprNode)
}
whenMerged { project ->
project.jdk.languageLevel = 'JDK_1_8'
}
}
}
workspace.iws.withXml { xmlProvider ->
def iwsNode = xmlProvider.asNode()
ideaMakeAutomatically(iwsNode)
ideaRunConfig(iwsNode)
}
}
cleanIdea.doLast {
new File('Mani.iws').delete()
new File('Mani.ipr').delete()
new File('Mani.iml').delete()
}