ES6 Support Groundwork + Fixes (OLD ONE DON'T LOOK AT ME!!!) #22

Merged
TopchetoEU merged 49 commits from ES6 into master 2024-09-05 14:17:52 +00:00
8 changed files with 90 additions and 8 deletions
Showing only changes of commit 9265a7d813 - Show all commits

View File

@ -1,13 +1,23 @@
<<<<<<< HEAD
plugins { plugins {
id "application" id "application"
// these idiots don't optimize in the compile-time, but in the runtime // these idiots don't optimize in the compile-time, but in the runtime
// who let these knuckleheads make a language // who let these knuckleheads make a language
=======
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
>>>>>>> master
// TODO: figure out how to integrate proguard // TODO: figure out how to integrate proguard
// id "com.github.xaverkapeller.proguard-annotations" // id "com.github.xaverkapeller.proguard-annotations"
} }
<<<<<<< HEAD
repositories { repositories {
mavenCentral() mavenCentral()
gradlePluginPortal() gradlePluginPortal()
@ -30,15 +40,69 @@ configure([tasks.compileJava]) {
javaCompiler = javaToolchains.compilerFor { javaCompiler = javaToolchains.compilerFor {
languageVersion = JavaLanguageVersion.of(17) languageVersion = JavaLanguageVersion.of(17)
} }
=======
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'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
configure([tasks.compileJava]) {
options.release = 11
>>>>>>> master
} }
jar { jar {
manifest.attributes["Main-class"] = project.main_class 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'
)
}
} }
sourceSets { application {
main.java.srcDirs = [ "src/java" ] mainClass = project.main_class
main.resources.srcDirs = [ "src/assets" ] 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 { processResources {
@ -50,6 +114,10 @@ processResources {
} }
} }
base.archivesName = project.project_name test {
version = project.project_version useJUnitPlatform()
group = project.project_group }
wrapper {
gradleVersion = '8.10'
}

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

View File

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,14 @@
package me.topchetoeu.jscript;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class TestHelloWorld {
@Test
public void testHelloWorld() {
final String message = "Hello World!";
assertEquals("Hello World!", message);
}
}