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
173 changes: 108 additions & 65 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,93 +1,136 @@
plugins {
id "org.jetbrains.kotlin.jvm" version "2.4.10"
id "org.jetbrains.kotlin.jvm" version "2.4.10" apply false
id "java-library"
id "maven-publish"
id("net.neoforged.licenser") version "0.7.5"
id("net.neoforged.licenser") version "0.7.5" apply false
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
}
maven { url = "https://maven.blamejared.com/"} // moonflower's molang-compiler
}
allprojects {
apply plugin: "net.neoforged.licenser"

dependencies {
implementation api("io.netty:netty-buffer:4.2.17.Final")
compileOnlyApi("org.jetbrains:annotations:26.1.0")
group = rootProject.group
version = rootProject.version

// tests
testImplementation("org.junit.jupiter:junit-jupiter-api:6.1.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:6.1.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.1.3")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:2.4.10")
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
}

// performance comparison with other libraries
jmhImplementation("com.bedrockk:molang:1.0-SNAPSHOT")
jmhImplementation("gg.moonflower:molang-compiler:3.1.1.19")
license {
header.set(rootProject.resources.text.fromFile("header.txt"))
include("**/*.java")
newLine = false
}
}

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'
}
subprojects {
apply plugin: "java-library"
apply plugin: "maven-publish"

tasks {
test {
useJUnitPlatform()
dependsOn tasks.generateExpectations
dependencies {
compileOnlyApi("org.jetbrains:annotations:26.1.0")
compileOnlyApi("com.google.j2objc:j2objc-annotations:3.1")

testImplementation("org.junit.jupiter:junit-jupiter-api:6.1.3")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:6.1.3")
testRuntimeOnly("org.junit.platform:junit-platform-launcher:6.1.3")
}
compileJmhJava {
sourceCompatibility = "24"
targetCompatibility = "24"

tasks.named("test") {
useJUnitPlatform()
}
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()
}
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

jar {
manifest.attributes("FMLModType": "GAMELIBRARY")
}
pom {
name = "MochaFloats ${project.name}"
description = "A lightweight, fast and efficient Molang lexer, parser, interpreter and compiler"
url = "https://github.com/PlayerAnimationLibrary/mochafloats"

publishing {
repositories {
maven {
name = "RedlanceMinecraft"
url = "https://repo.redlance.org/public"
credentials {
username = "dima_dencep"
password = System.getenv("MAVEN_PASSWORD")
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=6.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