-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
148 lines (120 loc) · 4.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
141
142
143
144
145
146
147
148
import java.text.SimpleDateFormat
plugins {
id 'idea'
id 'java'
id 'distribution'
id 'com.install4j.gradle' version '9.0.6'
}
group = 'org.kodedevs'
version = kodeVersion
description = 'Kode is an open source programming language which aims for better readability and functionality.'
ext {
buildDate = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date())
}
repositories {
// Maven Central Repository -> https://mvnrepository.com/repos/central
mavenCentral()
// Gradle Plugin Portal -> https://plugins.gradle.org/
gradlePluginPortal()
// ej-technologies Repository -> https://www.ej-technologies.com/
maven {
url 'https://maven.ej-technologies.com/repository'
}
// 3rd-party libs
flatDir {
dirs 'libs/3_p'
}
}
dependencies {
implementation 'org.slf4j:slf4j-api:2.0.0' // SLF4J API Module
implementation 'info.picocli:picocli:4.6.3' // Picocli
annotationProcessor 'info.picocli:picocli-codegen:4.6.3' // Picocli Codegen
// For Testing
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.9.0' // JUnit Jupiter API
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.9.0' // JUnit Jupiter Engine
}
test {
useJUnitPlatform()
}
java {
withJavadocJar()
withSourcesJar()
// Minimum Java Version Compatibility
toolchain.setLanguageVersion(JavaLanguageVersion.of(17))
}
tasks.withType(JavaCompile) {
options.compilerArgs += ["-Aproject=${rootProject.group}/${rootProject.name}"]
options.encoding = 'UTF-8'
}
processResources {
filesMatching('**/kode-release-info.txt') {
expand(
'project': project
)
}
}
jar {
// Build a custom manifest
manifest.attributes([
'Manifest-Version' : '1.0',
'Created-By' : "Gradle API ${gradle.gradleVersion}",
'Built-By' : System.properties['user.name'],
'Build-Jdk' : "${System.properties['java.version']} (${System.properties['java.vendor']} " +
"${System.properties['java.vm.version']})",
'Build-OS' : "${System.properties['os.name']} ${System.properties['os.arch']} " +
"${System.properties['os.version']}",
'Automatic-Module-Name' : "org.kodedevs.kode",
// describes version of the specification the JAR meets
'Specification-Title' : "Kode",
'Specification-Version' : project.version,
'Specification-Vendor' : project.group,
// describes version of the application contained by the JAR
'Implementation-Title' : "Kode",
'Implementation-Version' : project.version,
'Implementation-Vendor' : project.group,
'Implementation-Build-Date': project.ext.buildDate,
])
metaInf {
from(rootDir) {
include 'LICENSE*', 'NOTICE*'
}
}
exclude 'META-INF/*.SF', 'META-INF/*.RSA', 'META-INF/*.DSA', 'META-INF/*.MF'
}
distributions {
main {
contents {
from jar
from configurations.runtimeClasspath
}
}
}
task runApplication(type: JavaExec) {
// Main class name
mainClass = 'org.kodedevs.kode.cli.Application'
// Arguments to pass to the application
// args 'appArg1'
// Runtime Classpath
classpath = sourceSets.main.runtimeClasspath + files(tasks.jar)
// The standard input stream for the process executing the command
standardInput System.in
}
install4j {
if (System.env['INSTALL4J_HOME'] != null) installDir = file("$System.env.INSTALL4J_HOME")
// Add License Key If Present
license = System.env['INSTALL4J_LICENSE']
}
task buildInstallers(type: com.install4j.gradle.Install4jTask, group: BasePlugin.BUILD_GROUP) {
dependsOn 'installDist' // task that prepares the distribution for install4j
projectFile = rootProject.file('installer/kode.install4j')
destination = "$buildDir/distributions"
release = project.version
quiet = false
onlyIf {
System.env['INSTALL4J_HOME'] != null
}
}
wrapper {
gradleVersion = '7.5.1'
distributionType = Wrapper.DistributionType.ALL
}