2024-09-04 12:29:17 +00:00
|
|
|
import java.text.SimpleDateFormat
|
|
|
|
|
2024-01-11 07:56:50 +00:00
|
|
|
plugins {
|
2024-09-04 12:29:17 +00:00
|
|
|
id 'application'
|
|
|
|
id 'net.nemerosa.versioning' version '2.15.0'
|
|
|
|
id 'org.ajoberstar.grgit' version '5.0.0-rc.3' // required by gradle
|
|
|
|
|
|
|
|
// TODO: figure out how to integrate proguard
|
|
|
|
// id "com.github.xaverkapeller.proguard-annotations"
|
|
|
|
}
|
|
|
|
|
|
|
|
base.archivesName = project.project_name
|
|
|
|
version = project.project_version
|
|
|
|
group = project.project_group
|
|
|
|
description = 'ES5-compliant JavaScript interpreter'
|
|
|
|
|
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
annotationProcessor 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2'
|
|
|
|
compileOnly 'com.github.bsideup.jabel:jabel-javac-plugin:0.4.2'
|
|
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
|
|
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
2024-01-11 07:56:50 +00:00
|
|
|
}
|
|
|
|
|
2024-01-11 08:47:41 +00:00
|
|
|
java {
|
2024-09-04 12:29:17 +00:00
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
|
|
|
|
toolchain {
|
|
|
|
languageVersion = JavaLanguageVersion.of(17)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
configure([tasks.compileJava]) {
|
|
|
|
options.release = 11
|
2024-01-11 08:47:41 +00:00
|
|
|
}
|
|
|
|
|
2024-01-11 08:58:40 +00:00
|
|
|
jar {
|
2024-09-04 12:29:17 +00:00
|
|
|
manifest {
|
|
|
|
attributes(
|
|
|
|
'Main-Class': project.main_class,
|
|
|
|
'Build-Timestamp': new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
|
|
|
|
'Build-Branch': versioning.info.branch,
|
|
|
|
'Build-Revision': versioning.info.commit,
|
|
|
|
'Build-Jdk': "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']})",
|
|
|
|
'Build-Author': 'TopchetoEU'
|
|
|
|
)
|
|
|
|
}
|
2024-01-11 08:58:40 +00:00
|
|
|
}
|
|
|
|
|
2024-09-04 12:29:17 +00:00
|
|
|
application {
|
|
|
|
mainClass = project.main_class
|
|
|
|
applicationDefaultJvmArgs = ['-Xmx2G', '-Xms2G', '-server', '-Dfile.encoding=UTF-8']
|
|
|
|
}
|
|
|
|
|
|
|
|
distZip {
|
|
|
|
eachFile { file ->
|
|
|
|
if (file.path.contains('bin')) {
|
|
|
|
file.exclude()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
distTar {
|
|
|
|
eachFile { file ->
|
|
|
|
if (file.path.contains('bin')) {
|
|
|
|
file.exclude()
|
|
|
|
}
|
|
|
|
}
|
2024-01-11 07:56:50 +00:00
|
|
|
}
|
|
|
|
|
2024-01-11 08:47:41 +00:00
|
|
|
processResources {
|
2024-01-12 07:48:20 +00:00
|
|
|
filesMatching "metadata.json", {
|
|
|
|
expand(
|
|
|
|
version: project.project_version,
|
|
|
|
name: project.project_name
|
2024-01-11 08:47:41 +00:00
|
|
|
)
|
2024-01-11 07:56:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-09-04 12:29:17 +00:00
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
|
|
|
wrapper {
|
|
|
|
gradleVersion = '8.10'
|
|
|
|
}
|