Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
* text=auto eol=lf
* text=auto eol=lf
*.bat text eol=crlf
*.jar binary
170 changes: 106 additions & 64 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,93 +1,135 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "2.4.0"
id "org.jetbrains.kotlin.jvm" version "2.4.0" apply false
id "java-library"
id "maven-publish"
id("net.neoforged.licenser") version "0.7.5"
id("me.champeau.jmh") version "0.7.3"
}

repositories {
mavenCentral()
maven {
url = uri("https://repo.redlance.org/public") // mirroring https://maven.pkg.github.com/bedrockk/MoLang
allprojects {
group = rootProject.group
version = rootProject.version

repositories {
mavenCentral()
maven {
url = uri("https://repo.redlance.org/public") // mirroring https://maven.pkg.github.com/bedrockk/MoLang
}
maven { url = "https://maven.blamejared.com/" } // moonflower's molang-compiler
}
maven { url = "https://maven.blamejared.com/"} // moonflower's molang-compiler
}

dependencies {
implementation api("io.netty:netty-buffer:4.2.15.Final")
compileOnlyApi("org.jetbrains:annotations:26.1.0")
subprojects {
apply plugin: "java-library"
apply plugin: "maven-publish"
apply plugin: "net.neoforged.licenser"

// tests
testImplementation("org.junit.jupiter:junit-jupiter-api:6.1.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:6.1.1")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.1.1")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:2.4.0")
dependencies {
compileOnlyApi("org.jetbrains:annotations:26.1.0")
compileOnlyApi("com.google.j2objc:j2objc-annotations:3.1")

// performance comparison with other libraries
jmhImplementation("com.bedrockk:molang:1.0-SNAPSHOT")
jmhImplementation("gg.moonflower:molang-compiler:3.1.1.19")
}

tasks.register('generateExpectations', Exec) {
def nvmDir = file("${System.getenv('HOME')}/.nvm/versions/node")
executable nvmDir.isDirectory() ? "${nvmDir.listFiles().sort().last()}/bin/node" : 'node'
args 'scripts/generate_expectations.js'
}
testImplementation("org.junit.jupiter:junit-jupiter-api:6.1.1")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:6.1.1")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.1.1")
}

tasks {
test {
tasks.named("test") {
useJUnitPlatform()
dependsOn tasks.generateExpectations
}
compileJmhJava {
sourceCompatibility = "24"
targetCompatibility = "24"
}
compileJava {

tasks.named("compileJava") {
sourceCompatibility = "24"
targetCompatibility = "24"
}
javadoc {

tasks.named("javadoc") {
failOnError = false
}
compileKotlin {
enabled = false

java {
withJavadocJar()
withSourcesJar()
}
}

license {
header.set(rootProject.resources.text.fromFile("header.txt"))
include("**/*.java")
newLine = false
}
jar {
manifest.attributes("FMLModType": "GAMELIBRARY")
}

java {
withJavadocJar()
withSourcesJar()
}
license {
header.set(rootProject.resources.text.fromFile("header.txt"))
include("**/*.java")
newLine = false
}

jar {
manifest.attributes("FMLModType": "GAMELIBRARY")
}
publishing {
repositories {
maven {
name = "RedlanceMinecraft"
url = "https://repo.redlance.org/public"
credentials {
username = "dima_dencep"
password = System.getenv("MAVEN_PASSWORD")
}
}
}
publications {
maven(MavenPublication) {
groupId = "org.redlance.mochafloats"
artifactId = project.name
version = project.version

publishing {
repositories {
maven {
name = "RedlanceMinecraft"
url = "https://repo.redlance.org/public"
credentials {
username = "dima_dencep"
password = System.getenv("MAVEN_PASSWORD")
pom {
name = "MochaFloats ${project.name}"
description = "A lightweight, fast and efficient Molang lexer, parser, interpreter and compiler"
url = "https://github.com/PlayerAnimationLibrary/mochafloats"

developers {
developer {
id = "dima_dencep"
name = "dima_dencep"
email = "dima_dencep@redlance.org"
}
developer {
id = "zigythebird"
name = "ZigyTheBird"
email = "imanyarandi222@gmail.com"
}
}

licenses {
license {
name = "MIT"
url = "https://github.com/PlayerAnimationLibrary/mochafloats/blob/HEAD/license.txt"
}
}

scm {
connection = "scm:git:github.com/PlayerAnimationLibrary/mochafloats.git"
developerConnection = "scm:git:github.com/PlayerAnimationLibrary/mochafloats.git"
url = "https://github.com/PlayerAnimationLibrary/mochafloats.git"
}
}

from components.java
}
}
}
publications {
maven(MavenPublication) {
groupId = "com.zigythebird"
artifactId = "mochafloats"
version = project.version
from components.java
}
}

dependencies {
api project(":lexer")
api project(":parser")
api project(":runtime")
api project(":runtime-compiler")

// performance comparison with other libraries
jmhImplementation("com.bedrockk:molang:1.0-SNAPSHOT")
jmhImplementation("gg.moonflower:molang-compiler:3.1.1.19")
}

tasks {
compileJmhJava {
sourceCompatibility = "24"
targetCompatibility = "24"
}
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
group=team.unnamed
version=5.0.0
version=1.0.0
description=A lightweight, fast and efficient Molang lexer, parser, interpreter and compiler for Java 24+
kotlin.stdlib.default.dependency=false
164 changes: 82 additions & 82 deletions gradlew.bat

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lexer/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
// no internal dependencies
Loading