Skip to content
Merged
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,8 @@ Thumbs.db
*~
*.*#
*#*#
/.kotlin/
/assets/assets.txt
/assets/sdk/

## Special cases:

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
Expand Down
17 changes: 17 additions & 0 deletions android/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@
-dontwarn android.support.**
-dontwarn com.badlogic.gdx.backends.android.AndroidFragmentApplication

# Ignore missing AWT classes (desktop-only, not needed on Android)
-dontwarn java.awt.**
-dontwarn javax.swing.**

# Ignore Java 9+ classes that don't exist on Android
-dontwarn java.lang.Runtime$Version
-dontwarn java.lang.reflect.InaccessibleObjectException

# Ignore all Groovy warnings (Gradle's internal dependency)
-dontwarn org.codehaus.groovy.**

# Needed by the gdx-controllers official extension.
-keep class com.badlogic.gdx.controllers.android.AndroidControllers

Expand All @@ -39,6 +50,10 @@
float reportRayFixture(long, float, float, float, float, float);
}

# Don't obfuscate code at all, since it's open source and we want people to mess with the game's
# internals and reverse engineer the code as much as possible.
-dontobfuscate

# Ignore missing Java Beans classes (Android doesn't have java.beans, Groovy handles this internally)
-dontwarn java.beans.**

Expand All @@ -61,6 +76,8 @@
# You will probably need this line in most cases:
-keep public class com.badlogic.gdx.graphics.Color { *; }

-keep class me.stringdotjar.** { *; }

# These two lines are used with mapping files; see https://developer.android.com/build/shrink-code#retracing
-keepattributes LineNumberTable,SourceFile
-renamesourcefileattribute SourceFile
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ buildscript {
}
dependencies {
classpath "com.android.tools.build:gradle:8.7.3"

}
}

Expand Down
30 changes: 27 additions & 3 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,34 @@ dependencies {
api "games.rednblack.miniaudio:miniaudio:$miniaudioVersion"

// FNF:JE.
implementation "org.apache.groovy:groovy:4.0.12"
implementation "org.jetbrains:annotations:15.0"
implementation "org.apache.groovy:groovy:5.0.3"
implementation "org.jetbrains:annotations:26.0.2-1"

if(enableGraalNative == 'true') {
if (enableGraalNative == 'true') {
implementation "io.github.berstanio:gdx-svmhelper-annotations:$graalHelperVersion"
}
}

tasks.register('exportModSDK', Copy) {
group = "modding"
description = "Copies all API JARs needed for modding into the assets folder."

into "$rootProject.projectDir/assets/sdk/api"

from(tasks.named('jar')) {
rename { "funkin-api.jar" }
}

// Include every external dependency.
from(configurations.runtimeClasspath) {
// Exclude native files, since modders only need the Java interfaces.
exclude "**/*.dll", "**/*.so", "**/*.dylib", "**/*.jnilib"
}
}

// Make sure the assets are ready before the game runs.
if (project.name == 'lwjgl3') {
tasks.named('run') {
dependsOn(rootProject.tasks.named('processAssets'))
}
}
54 changes: 5 additions & 49 deletions lwjgl3/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
}
dependencies {
classpath "io.github.fourlastor:construo:1.7.1"
if(enableGraalNative == 'true') {
if (enableGraalNative == 'true') {
classpath "org.graalvm.buildtools.native:org.graalvm.buildtools.native.gradle.plugin:0.9.28"
}
}
Expand All @@ -14,17 +14,14 @@ plugins {
}
apply plugin: 'io.github.fourlastor.construo'


import io.github.fourlastor.construo.Target

sourceSets.main.resources.srcDirs += [ rootProject.file('assets').path ]
sourceSets.main.resources.srcDirs += [rootProject.file('assets').path]
mainClassName = 'me.stringdotjar.funkin.lwjgl3.Lwjgl3Launcher'
application.setMainClass(mainClassName)
eclipse.project.name = appName + '-lwjgl3'
java.sourceCompatibility = 17
java.targetCompatibility = 17
if (JavaVersion.current().isJava9Compatible()) {
compileJava.options.release.set(17)
compileJava.options.release.set(17)
}

dependencies {
Expand All @@ -34,7 +31,7 @@ dependencies {
implementation "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop"
implementation project(':core')

if(enableGraalNative == 'true') {
if (enableGraalNative == 'true') {
implementation "io.github.berstanio:gdx-svmhelper-backend-lwjgl3:$graalHelperVersion"
}
}
Expand Down Expand Up @@ -113,47 +110,6 @@ tasks.register("jarWin") {
}
}

construo {
// name of the executable
name.set(appName)
// human-readable name, used for example in the `.app` name for macOS
humanName.set(appName)
// Optional, defaults to project version property
version.set("$projectVersion")

targets.configure {
register("linuxX64", Target.Linux) {
architecture.set(Target.Architecture.X86_64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_linux_hotspot_17.0.15_6.tar.gz")
// Linux does not currently have a way to set the icon on the executable
}
register("macM1", Target.MacOs) {
architecture.set(Target.Architecture.AARCH64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_aarch64_mac_hotspot_17.0.15_6.tar.gz")
// macOS needs an identifier
identifier.set("me.stringdotjar.funkin." + appName)
// Optional: icon for macOS, as an ICNS file
macIcon.set(project.file("icons/logo.icns"))
}
register("macX64", Target.MacOs) {
architecture.set(Target.Architecture.X86_64)
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_mac_hotspot_17.0.15_6.tar.gz")
// macOS needs an identifier
identifier.set("me.stringdotjar.funkin." + appName)
// Optional: icon for macOS, as an ICNS file
macIcon.set(project.file("icons/logo.icns"))
}
register("winX64", Target.Windows) {
architecture.set(Target.Architecture.X86_64)
// Optional: icon for Windows, as a PNG
icon.set(project.file("icons/logo.png"))
jdkUrl.set("https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.15%2B6/OpenJDK17U-jdk_x64_windows_hotspot_17.0.15_6.zip")
// Uncomment the next line to show a console when the game runs, to print messages.
//useConsole.set(true)
}
}
}

// Equivalent to the jar task; here for compatibility with gdx-setup.
tasks.register('dist') {
dependsOn 'jar'
Expand All @@ -176,6 +132,6 @@ distributions {
startScripts.dependsOn(':lwjgl3:jar')
startScripts.classpath = project.tasks.jar.outputs.files

if(enableGraalNative == 'true') {
if (enableGraalNative == 'true') {
apply from: file("nativeimage.gradle")
}