Skip to content

Commit

Permalink
Beating my head against the Graal.
Browse files Browse the repository at this point in the history
The Graal is winning.
  • Loading branch information
tommyettinger committed Jul 14, 2024
1 parent e841ee2 commit 6066f4f
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 337 deletions.
37 changes: 37 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,43 @@ if(enableGraalNative == 'true') {
run {
doNotTrackState("Running the app should not be affected by Graal.")
}


// Modified from https://lyze.dev/2021/04/29/libGDX-Internal-Assets-List/ ; thanks again, Lyze!
// This creates a resource-config.json file based on the contents of the assets folder (and the libGDX icons).
// This file is used by Graal Native to embed those specific files.
// This has to run before nativeCompile, so it runs at the start of an unrelated resource-handling command.
generateResourcesConfigFile.doFirst {
def assetsFolder = new File("${project.rootDir}/src/main/resources/")
def resFolder = new File("${project.rootDir}/src/main/resources/META-INF/native-image/gdx-liftoff/")
resFolder.mkdirs()
def resFile = new File(resFolder, "resource-config.json")
resFile.delete()
resFile.append(
"""{
"resources":{
"includes":[
{
"pattern": ".*(""")
// This adds every filename in the src/main/resources/ folder to a pattern that adds those files as resources.
fileTree(assetsFolder).each {
if (!it.path.contains("META-INF")) {
resFile.append("\\\\Q${it.name}\\\\E|")
// The backslash-Q and backslash-E escape the start and end of a literal string, respectively.
}
}
// We also match all of the window icon images this way and the font files that are part of libGDX.
resFile.append(
"""libgdx.+\\\\.png|lsans.+)"
}
]},
"bundles":[{
"name":"sun.text.resources.cldr.FormatData",
"locales":["en", "en-US", "und"]
}]
}"""
)
}
}

tasks.register('sample', JavaExec) {
Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8 -DUSE_NATIVE_IMAGE_JAVA_PLATFORM_MODULE_SYSTEM=false
kotlinVersion=1.9.22
org.gradle.jvmargs=-Xms512M -Xmx1G -Dfile.encoding=UTF-8 -Dconsole.encoding=UTF-8
kotlinVersion=1.9.24
gdxVersion=1.12.1
lmlVersion=1.10.1.12.1
visUiVersion=1.5.3
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,87 +1,12 @@
{
"resources":{
"includes":[
{
"pattern": ".*(libgdx.+\\.png|lsans.+)"
}, {
"pattern":"\\QMETA-INF/MANIFEST.MF\\E"
}, {
"pattern":"\\QMETA-INF/services/java.lang.System$LoggerFinder\\E"
}, {
"pattern":"\\Qgdx64.dll\\E"
}, {
"pattern":"\\Qgenerator/gitattributes\\E"
}, {
"pattern":"\\Qgenerator/gitignore\\E"
}, {
"pattern":"\\Qgenerator/gradle/wrapper/gradle-wrapper.jar\\E"
}, {
"pattern":"\\Qgenerator/gradle/wrapper/gradle-wrapper.properties\\E"
}, {
"pattern":"\\Qgenerator/gradlew.bat\\E"
}, {
"pattern":"\\Qgenerator/gradlew\\E"
}, {
"pattern":"\\Qgenerator/templates/libgdx.png\\E"
}, {
"pattern":"\\Qicons/libgdx128.png\\E"
}, {
"pattern":"\\Qicons/libgdx16.png\\E"
}, {
"pattern":"\\Qicons/libgdx32.png\\E"
}, {
"pattern":"\\Qicons/libgdx64.png\\E"
}, {
"pattern":"\\Qicons/logo.icns\\E"
}, {
"pattern":"\\Qicons/logo.ico\\E"
}, {
"pattern":"\\Qicons/logo.png\\E"
}, {
"pattern":"\\Qopengl32.dll\\E"
}, {
"pattern":"\\Qorg/lwjgl/Version.class\\E"
}, {
"pattern":"\\Qui-data/defaults.properties\\E"
}, {
"pattern":"\\Qui-data/nls.properties\\E"
}, {
"pattern":"\\Qui-data/urls.properties\\E"
}, {
"pattern":"\\Qui-skin/font-button-big.fnt\\E"
}, {
"pattern":"\\Qui-skin/font-button-mid.fnt\\E"
}, {
"pattern":"\\Qui-skin/font-button-small.fnt\\E"
}, {
"pattern":"\\Qui-skin/font-label-field.fnt\\E"
}, {
"pattern":"\\Qui-skin/font-label-header.fnt\\E"
}, {
"pattern":"\\Qui-skin/font-label-tooltip.fnt\\E"
}, {
"pattern":"\\Qui-skin/font-label.fnt\\E"
}, {
"pattern":"\\Qui-skin/font-labelMarkup.fnt\\E"
}, {
"pattern":"\\Qui-skin/skin.atlas\\E"
}, {
"pattern":"\\Qui-skin/skin.json\\E"
}, {
"pattern":"\\Qui-skin/skin.png\\E"
}, {
"pattern":"\\Qwindows/x64/org/lwjgl/glfw/glfw.dll\\E"
}, {
"pattern":"\\Qwindows/x64/org/lwjgl/jemalloc/jemalloc.dll\\E"
}, {
"pattern":"\\Qwindows/x64/org/lwjgl/lwjgl.dll\\E"
}, {
"pattern":"\\Qwindows/x64/org/lwjgl/nfd/lwjgl_nfd.dll\\E"
}, {
"pattern":"\\Qwindows/x64/org/lwjgl/opengl/lwjgl_opengl.dll\\E"
}]},
{
"pattern": ".*(\\Qic_launcher-web.png\\E|\\Qproguard-rules.pro\\E|\\Qproject.properties\\E|\\Qic_launcher.xml\\E|\\Qic_launcher_foreground.xml\\E|\\Qic_launcher.png\\E|\\Qic_launcher.png\\E|\\Qic_launcher.png\\E|\\Qic_launcher.png\\E|\\Qic_launcher.png\\E|\\Qcolor.xml\\E|\\Qstyles.xml\\E|\\Q.gitkeep\\E|\\Qlights.atlas\\E|\\Qlights.png\\E|\\Qfont-list.fnt\\E|\\Qfont-subtitle.fnt\\E|\\Qfont-window.fnt\\E|\\Qfont.fnt\\E|\\Quiskin.atlas\\E|\\Quiskin.json\\E|\\Quiskin.png\\E|\\Qgitattributes\\E|\\Qgitignore\\E|\\Qgradle-wrapper.jar\\E|\\Qgradle-wrapper.properties\\E|\\Qgradlew\\E|\\Qgradlew.bat\\E|\\Qjsr305.gwt.xml\\E|\\Qindex.html\\E|\\Qindex_old.html\\E|\\Qrefresh.png\\E|\\Qsoundmanager2-jsmin.js\\E|\\Qsoundmanager2-jsmin_old.js\\E|\\Qsoundmanager2-setup.js\\E|\\Qstyles.css\\E|\\Qweb.xml\\E|\\QLaunchScreen.storyboard\\E|\\Qapp-store-icon-1024@1x.png\\E|\\QContents.json\\E|\\Qipad-app-icon-76@1x.png\\E|\\Qipad-app-icon-76@2x.png\\E|\\Qipad-notifications-icon-20@1x.png\\E|\\Qipad-notifications-icon-20@2x.png\\E|\\Qipad-pro-app-icon-83.5@2x.png\\E|\\Qipad-settings-icon-29@1x.png\\E|\\Qipad-settings-icon-29@2x.png\\E|\\Qipad-spotlight-icon-40@1x.png\\E|\\Qipad-spotlight-icon-40@2x.png\\E|\\Qiphone-app-icon-60@2x.png\\E|\\Qiphone-app-icon-60@3x.png\\E|\\Qiphone-notification-icon-20@2x.png\\E|\\Qiphone-notification-icon-20@3x.png\\E|\\Qiphone-spotlight-icon-40@2x.png\\E|\\Qiphone-spotlight-icon-40@3x.png\\E|\\Qiphone-spotlight-settings-icon-29@2x.png\\E|\\Qiphone-spotlight-settings-icon-29@3x.png\\E|\\QContents.json\\E|\\QContents.json\\E|\\Qlibgdx@1x.png\\E|\\Qlibgdx@2x.png\\E|\\Qlibgdx@3x.png\\E|\\QPrivacyInfo.xcprivacy\\E|\\QInfo.plist.xml\\E|\\QDefault-1024w-1366h@2x~ipad.png\\E|\\QDefault-375w-667h@2x.png\\E|\\QDefault-375w-812h@3x.png\\E|\\QDefault-414w-736h@3x.png\\E|\\QDefault-568h@2x.png\\E|\\QDefault.png\\E|\\QDefault@2x.png\\E|\\QDefault@2x~ipad.png\\E|\\QDefault~ipad.png\\E|\\QInfo.plist\\E|\\Qmain.cpp\\E|\\Qapp-store-icon-1024@1x.png\\E|\\QContents.json\\E|\\Qipad-app-icon-76@1x.png\\E|\\Qipad-app-icon-76@2x.png\\E|\\Qipad-notifications-icon-20@1x.png\\E|\\Qipad-notifications-icon-20@2x.png\\E|\\Qipad-pro-app-icon-83.5@2x.png\\E|\\Qipad-settings-icon-29@1x.png\\E|\\Qipad-settings-icon-29@2x.png\\E|\\Qipad-spotlight-icon-40@1x.png\\E|\\Qipad-spotlight-icon-40@2x.png\\E|\\Qiphone-app-icon-60@2x.png\\E|\\Qiphone-app-icon-60@3x.png\\E|\\Qiphone-notification-icon-20@2x.png\\E|\\Qiphone-notification-icon-20@3x.png\\E|\\Qiphone-spotlight-icon-40@2x.png\\E|\\Qiphone-spotlight-icon-40@3x.png\\E|\\Qiphone-spotlight-settings-icon-29@2x.png\\E|\\Qiphone-spotlight-settings-icon-29@3x.png\\E|\\QContents.json\\E|\\QInfo.plist\\E|\\Qmain.cpp\\E|\\Qproject.pbxproj\\E|\\Qbutton-normal-over.9.png\\E|\\Qbutton-normal-over.png\\E|\\Qbutton-normal-pressed.9.png\\E|\\Qbutton-normal-pressed.png\\E|\\Qbutton-normal.9.png\\E|\\Qbutton-normal.png\\E|\\Qcheck-on.png\\E|\\Qcheck.png\\E|\\Qcheckbox-over.png\\E|\\Qcheckbox-selected-over.png\\E|\\Qcheckbox-selected.png\\E|\\Qcheckbox.png\\E|\\Qdot.png\\E|\\Qfont-list.fnt\\E|\\Qfont-list.png\\E|\\Qfont-subtitle.fnt\\E|\\Qfont-subtitle.png\\E|\\Qfont-window.fnt\\E|\\Qfont-window.png\\E|\\Qfont.fnt\\E|\\Qfont.png\\E|\\Qknob-h.png\\E|\\Qknob-v.png\\E|\\Qline-h.png\\E|\\Qline-v.png\\E|\\Qlist.9.png\\E|\\Qlist.png\\E|\\Qpack.json\\E|\\Qprogress-bar-knob.png\\E|\\Qprogress-bar-square-knob.9.png\\E|\\Qprogress-bar-square-knob.png\\E|\\Qprogress-bar-square.9.png\\E|\\Qprogress-bar-square.png\\E|\\Qprogress-bar.png\\E|\\Qradio-over.png\\E|\\Qradio-selected-over.png\\E|\\Qradio-selected.png\\E|\\Qradio.png\\E|\\Qrect.png\\E|\\Qscrollbar.9.png\\E|\\Qscrollbar.png\\E|\\Qselect-box-open.9.png\\E|\\Qselect-box-open.png\\E|\\Qselect-box.9.png\\E|\\Qselect-box.png\\E|\\Qselect.9.png\\E|\\Qselection.9.png\\E|\\Qselection.png\\E|\\Qskin.usl\\E|\\Qslider-knob-over.png\\E|\\Qslider-knob.png\\E|\\Qslider.png\\E|\\Qspinner-down-over.png\\E|\\Qspinner-down-pressed.png\\E|\\Qspinner-down.png\\E|\\Qspinner-textfield-selected.9.png\\E|\\Qspinner-textfield-selected.png\\E|\\Qspinner-textfield.9.png\\E|\\Qspinner-textfield.png\\E|\\Qspinner-up-over.png\\E|\\Qspinner-up-pressed.png\\E|\\Qspinner-up.png\\E|\\Qsquare.png\\E|\\Qtextfield-selected.9.png\\E|\\Qtextfield-selected.png\\E|\\Qtextfield.9.png\\E|\\Qtextfield.png\\E|\\Qtree-minus.png\\E|\\Qtree-plus.png\\E|\\Qwhite.png\\E|\\Qwindow-border.9.png\\E|\\Qwindow-resize.9.png\\E|\\Qwindow.9.png\\E|\\Qwindow.png\\E|\\Qbundle.properties\\E|\\Qbundle_en.properties\\E|\\Qbundle_pl.properties\\E|\\Qcontrols.lml\\E|\\Qedit.lml\\E|\\Qinactive.lml\\E|\\Qsettings.lml\\E|\\Qswitch.lml\\E|\\Qgame.lml\\E|\\Qloading.lml\\E|\\Qglobal.lml\\E|\\Qmenu.lml\\E|\\Qbundle.properties\\E|\\Qbundle_en.properties\\E|\\Qbundle_pl.properties\\E|\\Qtheme.ogg\\E|\\Qktx.png\\E|\\Qlibgdx.png\\E|\\Qkoalio-single.png\\E|\\Qkoalio.png\\E|\\Qlevel1.tmx\\E|\\QtileSet.png\\E|\\Qnls.properties\\E|\\Qnls_en.properties\\E|\\Qlibgdx128.png\\E|\\Qlibgdx16.png\\E|\\Qlibgdx32.png\\E|\\Qlibgdx64.png\\E|\\Qlogo.icns\\E|\\Qlogo.ico\\E|\\Qlogo.png\\E|\\Qdefault.fnt\\E|\\Qtinted.atlas\\E|\\Qtinted.json\\E|\\Qtinted.png\\E|\\QbasicData.lml\\E|\\Qdelete.lml\\E|\\QdeleteError.lml\\E|\\Qgeneration.lml\\E|\\Qheader.lml\\E|\\Qmacros.lml\\E|\\Qmain.lml\\E|\\Qadvanced.lml\\E|\\Qextensions.lml\\E|\\Qlanguages.lml\\E|\\Qplatforms.lml\\E|\\Qtemplates.lml\\E|\\QthirdParty.lml\\E|\\Qtoast.lml\\E|\\Qdefaults.properties\\E|\\Qnls.properties\\E|\\Qurls.properties\\E|\\Qfont-button-big.fnt\\E|\\Qfont-button-mid.fnt\\E|\\Qfont-button-small.fnt\\E|\\Qfont-label-field.fnt\\E|\\Qfont-label-header.fnt\\E|\\Qfont-label-tooltip.fnt\\E|\\Qfont-label.fnt\\E|\\Qfont-labelMarkup.fnt\\E|\\Qskin.atlas\\E|\\Qskin.json\\E|\\Qskin.png\\E|libgdx.+\\.png|lsans.+)"
}
]},
"bundles":[{
"name":"sun.text.resources.cldr.FormatData",
"locales":["en", "en-US", "und"]
}]
}
}
Loading

0 comments on commit 6066f4f

Please sign in to comment.