6bfe50220d
1. gradle wrapper
2. ./gradlew run
3. manifest will look like
Manifest-Version: 1.0
Main-Class: me.topchetoeu.jscript.runtime.SimpleRepl
Build-Timestamp: 2024-09-04T10:44:35.990+0200
Build-Branch: ma/add-first-tests
Build-Revision: 412edc0ebc
Build-Jdk: 21.0.3 (Oracle Corporation 21.0.3+7-LTS-152)
Build-Author: TopchetoEU
4. build/distributions contains a zip and a jar which contain jscript-0.9.41-beta.jar
5. unnecessary libs have been removed
6. gradle has been updated to 8.10
7. first test has been added
85 lines
1.9 KiB
Groovy
85 lines
1.9 KiB
Groovy
import java.text.SimpleDateFormat
|
|
|
|
plugins {
|
|
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 {
|
|
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.2'
|
|
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
|
|
}
|
|
|
|
java {
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
targetCompatibility = JavaVersion.VERSION_17
|
|
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(17)
|
|
}
|
|
}
|
|
|
|
jar {
|
|
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'
|
|
)
|
|
}
|
|
}
|
|
|
|
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()
|
|
}
|
|
}
|
|
}
|
|
|
|
processResources {
|
|
filesMatching "metadata.json", {
|
|
expand(
|
|
version: project.project_version,
|
|
name: project.project_name
|
|
)
|
|
}
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
}
|
|
|
|
wrapper {
|
|
gradleVersion = '8.10'
|
|
}
|