-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle
147 lines (122 loc) · 3.78 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
141
142
143
144
145
146
147
/*
* Copyright (c) 2021. Dhyey Shah, Saurabh Pethani, Romil Nisar
*
* Developed by:
* Dhyey Shah<[email protected]>
* https://github.com/dhyey-shah
*
* Contributors:
* Saurabh Pethani<[email protected]>
* https://github.com/SaurabhPethani
*
* Romil Nisar<[email protected]>
*
*
* This file is part of Cafe.
*
* Cafe is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* Cafe is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cafe. If not, see <https://www.gnu.org/licenses/>.
*/
plugins {
// Apply the java plugin to add support for Java
id 'java'
// Apply the application plugin to add support for building a CLI application.
id 'application'
id 'distribution'
}
group 'cafe'
version '0.4.1'
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
options.compilerArgs += ["-Xlint:all", "-Xlint:-serial", "-parameters"]
}
repositories {
// Use jcenter for resolving dependencies.
// You can declare any Maven/Ivy/file repository here.
jcenter()
}
dependencies {
// https://mvnrepository.com/artifact/org.ow2.asm/asm
implementation group: 'org.ow2.asm', name: 'asm', version: '7.3.1'
// https://mvnrepository.com/artifact/org.ow2.asm/asm-util
implementation group: 'org.ow2.asm', name: 'asm-util', version: '7.3.1'
// https://mvnrepository.com/artifact/com.beust/jcommander
implementation group: 'com.beust', name: 'jcommander', version: '1.78'
// https://search.maven.org/artifact/org.fusesource.jansi/jansi/2.1.1/jar
implementation 'org.fusesource.jansi:jansi:2.1.1'
// https://mvnrepository.com/artifact/org.testng/testng
testCompile group: 'org.testng', name: 'testng', version: '7.3.0'
}
distributions {
main {
baseName("cafe")
contents {
from(projectDir) {
include('README*')
include('COPYRIGHT*')
include('LICENSE*')
include('THIRD-PARTY')
}
into('examples') {
from('examples') {
include '**/*.cafe'
}
}
}
}
}
startScripts {
applicationName = 'cafe'
}
run {
// RUN
// args = ["-r", "-cp=.\\examples\\", "closure"]
// Compile
// args = ["-c",".\\examples\\Objects.cafe"]
// Usage
// args = ["--usage", "-c"]
}
test{
useTestNG()
}
application {
// Define the main class for the application.
mainClassName = 'compiler.Main'
}
tasks.register("exe"){
dependsOn tasks.installDist
doLast {
def innoSetupDir = new File("${buildDir}/innosetup")
delete innoSetupDir
innoSetupDir.mkdir();
copy{
from("${projectDir}/LICENSE", "${projectDir}/README.md")
rename("LICENSE","LICENSE.txt")
rename("README.md", "README.txt")
into(innoSetupDir)
}
copy {
from("${rootProject.projectDir}/gradle/innosetup/cafe_exe_compiler.iss")
expand([
applicationVersion: "${project.version}",
])
from("${rootProject.projectDir}/gradle/innosetup/logo.ico")
into(innoSetupDir)
}
exec {
workingDir rootProject.projectDir
commandLine "iscc ${innoSetupDir}/cafe_exe_compiler.iss".split()
}
}
}