chore: refactor build scripts and update java-gi
This commit is contained in:
parent
3e70e9e4e1
commit
aede030a7f
|
@ -10,14 +10,14 @@ allprojects {
|
|||
}
|
||||
|
||||
// common
|
||||
val jfCommonsVersion by extra("1.5-SNAPSHOT")
|
||||
val gsonCompileVersion by extra("1.4-SNAPSHOT")
|
||||
val jbAnnotationsVersion by extra("24.0.1")
|
||||
val jfCommonsVersion by extra(libs.versions.jf.commons.get())
|
||||
val gsonCompileVersion by extra(libs.versions.gson.compile.get())
|
||||
val jbAnnotationsVersion by extra(libs.versions.annotations.get())
|
||||
// launcher-imgui
|
||||
val lwjglVersion by extra("3.3.2")
|
||||
val imguiVersion by extra("1.86.10")
|
||||
val lwjglVersion by extra(libs.versions.lwjgl.get())
|
||||
val imguiVersion by extra(libs.versions.imgui.get())
|
||||
// launcher-gtk
|
||||
val javagiVersion by extra("0.8.1")
|
||||
val javagiVersion by extra(libs.versions.javagi.get())
|
||||
|
||||
val flavorProp: String by extra(prop("flavor", "custom"))
|
||||
if (!setOf("custom", "maven", "fat", "windows", "linux", "macos").contains(flavorProp)) throw IllegalStateException("Unsupported flavor: $flavorProp")
|
||||
|
|
|
@ -8,7 +8,8 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation("gradle.plugin.com.github.johnrengelman:shadow:7.1.2")
|
||||
implementation("de.undercouch:gradle-download-task:5.1.2")
|
||||
implementation("io.gitlab.jfronny:convention:1.5-SNAPSHOT")
|
||||
implementation(libs.plugin.shadow)
|
||||
implementation(libs.plugin.download)
|
||||
implementation(libs.plugin.jf.convention)
|
||||
implementation(libs.plugin.jlink)
|
||||
}
|
|
@ -1 +1,8 @@
|
|||
rootProject.name="inceptum-conventions"
|
||||
rootProject.name="inceptum-conventions"
|
||||
dependencyResolutionManagement {
|
||||
versionCatalogs {
|
||||
create("libs") {
|
||||
from(files("../gradle/libs.versions.toml"))
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,8 +4,8 @@ import java.io.FileOutputStream
|
|||
plugins {
|
||||
application
|
||||
id("inceptum.java")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
id("de.undercouch.download")
|
||||
com.github.johnrengelman.shadow
|
||||
de.undercouch.download
|
||||
}
|
||||
|
||||
abstract class FileOutput : DefaultTask() {
|
||||
|
@ -18,14 +18,14 @@ val bootstrapArch = "i686"
|
|||
|
||||
val downloadBootstrap by tasks.registering(Download::class) {
|
||||
src("https://maven.fabricmc.net/net/fabricmc/fabric-installer-native-bootstrap/windows-${bootstrapArch}/${bootstrapVersion}/windows-${bootstrapArch}-${bootstrapVersion}.exe")
|
||||
dest(project.buildDir)
|
||||
dest(project.layout.buildDirectory)
|
||||
}
|
||||
|
||||
val nativeExe by tasks.registering(FileOutput::class) {
|
||||
dependsOn(downloadBootstrap)
|
||||
dependsOn(tasks.shadowJar)
|
||||
|
||||
output = file("$buildDir/libs/${project.name}-${project.version}.exe")
|
||||
output = project.layout.buildDirectory.file("libs/${project.name}-${project.version}.exe").get().asFile
|
||||
outputs.upToDateWhen { false }
|
||||
|
||||
doFirst {
|
||||
|
|
|
@ -2,10 +2,11 @@ plugins {
|
|||
id("inceptum.library")
|
||||
}
|
||||
|
||||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
|
||||
dependencies {
|
||||
api("io.gitlab.jfronny.gson:gson-compile-core:${rootProject.extra["gsonCompileVersion"]}")
|
||||
compileOnly("io.gitlab.jfronny.gson:gson-compile-annotations:${rootProject.extra["gsonCompileVersion"]}")
|
||||
annotationProcessor("io.gitlab.jfronny.gson:gson-compile-processor:${rootProject.extra["gsonCompileVersion"]}")
|
||||
api(libs.findLibrary("gson-compile-core").orElseThrow())
|
||||
compileOnly(libs.findLibrary("gson-compile-annotations").orElseThrow())
|
||||
annotationProcessor(libs.findLibrary("gson-compile-processor").orElseThrow())
|
||||
}
|
||||
|
||||
tasks.withType<JavaCompile> {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id("jf.java")
|
||||
jf.java
|
||||
`maven-publish`
|
||||
}
|
||||
|
||||
|
@ -8,8 +8,9 @@ repositories {
|
|||
maven("https://maven.frohnmeyer-wds.de/artifacts")
|
||||
}
|
||||
|
||||
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
|
||||
dependencies {
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
compileOnly(libs.findLibrary("annotations").orElseThrow())
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
|
|
@ -2,19 +2,13 @@ import io.gitlab.jfronny.scripts.*
|
|||
import javax.lang.model.element.Modifier
|
||||
|
||||
plugins {
|
||||
id("inceptum.library")
|
||||
id("jf.codegen")
|
||||
id("inceptum.gson-compile")
|
||||
inceptum.library
|
||||
jf.codegen
|
||||
inceptum.`gson-compile`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val jfCommonsVersion: String by rootProject.extra
|
||||
|
||||
api("io.gitlab.jfronny:commons:$jfCommonsVersion")
|
||||
api("io.gitlab.jfronny:commons-http-client:$jfCommonsVersion")
|
||||
api("io.gitlab.jfronny:commons-io:$jfCommonsVersion")
|
||||
api("io.gitlab.jfronny:commons-logging:$jfCommonsVersion")
|
||||
api("io.gitlab.jfronny:commons-serialize-gson:$jfCommonsVersion")
|
||||
api(libs.bundles.commons)
|
||||
}
|
||||
|
||||
val javaVersion by extra(project.java.targetCompatibility)
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
[versions]
|
||||
jf-commons = "1.5-SNAPSHOT"
|
||||
gson-compile = "1.4-SNAPSHOT"
|
||||
annotations = "24.0.1"
|
||||
lwjgl = "3.3.2"
|
||||
imgui = "1.86.10"
|
||||
javagi = "0.9.0"
|
||||
kotlin = "1.9.20"
|
||||
|
||||
[libraries]
|
||||
plugin-shadow = "gradle.plugin.com.github.johnrengelman:shadow:7.1.2"
|
||||
plugin-download = "de.undercouch:gradle-download-task:5.1.2"
|
||||
plugin-jf-convention = "io.gitlab.jfronny:convention:1.5-SNAPSHOT"
|
||||
plugin-jlink = "org.beryx:badass-jlink-plugin:3.0.1"
|
||||
|
||||
lwjgl-core = { module = "org.lwjgl:lwjgl", version.ref = "lwjgl" }
|
||||
lwjgl-glfw = { module = "org.lwjgl:lwjgl-glfw", version.ref = "lwjgl" }
|
||||
lwjgl-opengl = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl" }
|
||||
lwjgl-tinyfd = { module = "org.lwjgl:lwjgl-tinyfd", version.ref = "lwjgl" }
|
||||
lwjgl-core-natives = { module = "org.lwjgl:lwjgl", version.ref = "lwjgl" }
|
||||
lwjgl-glfw-natives = { module = "org.lwjgl:lwjgl-glfw", version.ref = "lwjgl" }
|
||||
lwjgl-opengl-natives = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl" }
|
||||
lwjgl-tinyfd-natives = { module = "org.lwjgl:lwjgl-tinyfd", version.ref = "lwjgl" }
|
||||
|
||||
imgui = { module = "io.github.spair:imgui-java-binding", version.ref = "imgui" } # https://github.com/SpaiR/imgui-java
|
||||
imgui-lwjgl = { module = "io.github.spair:imgui-java-lwjgl3", version.ref = "imgui" }
|
||||
imgui-natives-linux = { module = "io.github.spair:imgui-java-natives-linux", version.ref = "imgui" }
|
||||
imgui-natives-windows = { module = "io.github.spair:imgui-java-natives-windows", version.ref = "imgui" }
|
||||
imgui-natives-macos = { module = "io.github.spair:imgui-java-natives-macos", version.ref = "imgui" }
|
||||
|
||||
javagi-glib = { module = "io.github.jwharm.javagi:glib", version.ref = "javagi" }
|
||||
javagi-gtk = { module = "io.github.jwharm.javagi:gtk", version.ref = "javagi" }
|
||||
javagi-adw = { module = "io.github.jwharm.javagi:adw", version.ref = "javagi" }
|
||||
|
||||
commons = { module = "io.gitlab.jfronny:commons", version.ref = "jf-commons" }
|
||||
commons-http-client = { module = "io.gitlab.jfronny:commons-http-client", version.ref = "jf-commons" }
|
||||
commons-http-server = { module = "io.gitlab.jfronny:commons-http-server", version.ref = "jf-commons" }
|
||||
commons-io = { module = "io.gitlab.jfronny:commons-io", version.ref = "jf-commons" }
|
||||
commons-logging = { module = "io.gitlab.jfronny:commons-logging", version.ref = "jf-commons" }
|
||||
commons-serialize-gson = { module = "io.gitlab.jfronny:commons-serialize-gson", version.ref = "jf-commons" }
|
||||
|
||||
gson-compile-core = { module = "io.gitlab.jfronny.gson:gson-compile-core", version.ref = "gson-compile" }
|
||||
gson-compile-annotations = { module = "io.gitlab.jfronny.gson:gson-compile-annotations", version.ref = "gson-compile" }
|
||||
gson-compile-processor = { module = "io.gitlab.jfronny.gson:gson-compile-processor", version.ref = "gson-compile" }
|
||||
|
||||
annotations = { module = "org.jetbrains:annotations", version.ref = "annotations" }
|
||||
|
||||
[bundles]
|
||||
lwjgl = ["lwjgl-core", "lwjgl-glfw", "lwjgl-opengl", "lwjgl-tinyfd"]
|
||||
lwjgl-natives = ["lwjgl-core-natives", "lwjgl-glfw-natives", "lwjgl-opengl-natives", "lwjgl-tinyfd-natives"]
|
||||
javagi = ["javagi-glib", "javagi-gtk", "javagi-adw"]
|
||||
commons = ["commons", "commons-http-client", "commons-io", "commons-logging", "commons-serialize-gson"]
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id("inceptum.application")
|
||||
inceptum.application
|
||||
}
|
||||
|
||||
application {
|
||||
|
@ -7,5 +7,5 @@ application {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":launcher"))
|
||||
implementation(projects.launcher)
|
||||
}
|
||||
|
|
|
@ -3,8 +3,8 @@ import java.nio.file.Files
|
|||
import java.nio.file.Path
|
||||
|
||||
plugins {
|
||||
id("inceptum.application-standalone")
|
||||
id("org.beryx.jlink") version "2.26.0"
|
||||
inceptum.`application-standalone`
|
||||
org.beryx.jlink
|
||||
}
|
||||
|
||||
application {
|
||||
|
@ -14,9 +14,9 @@ application {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":launcher"))
|
||||
implementation(project(":launcher-cli"))
|
||||
implementation(project(":launcher-imgui"))
|
||||
implementation(projects.launcher)
|
||||
implementation(projects.launcherCli)
|
||||
implementation(projects.launcherImgui)
|
||||
}
|
||||
|
||||
tasks.shadowJar {
|
||||
|
@ -121,7 +121,7 @@ if (crosscompile) {
|
|||
tasks.jpackage {
|
||||
doLast {
|
||||
val src = Path.of("/root/jpackage-out")
|
||||
val trg = buildDir.resolve("jpackage").toPath()
|
||||
val trg = layout.buildDirectory.dir("jpackage").get().asFile.toPath()
|
||||
Files.createDirectories(trg)
|
||||
Files.list(src).use {
|
||||
it.filter { Files.isRegularFile(it) }.forEach {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
||||
|
||||
plugins {
|
||||
id("inceptum.application")
|
||||
id("com.github.johnrengelman.shadow")
|
||||
kotlin("jvm") version "1.9.20"
|
||||
kotlin("plugin.sam.with.receiver") version "1.9.20"
|
||||
inceptum.application
|
||||
com.github.johnrengelman.shadow
|
||||
kotlin("jvm") version libs.versions.kotlin
|
||||
kotlin("plugin.sam.with.receiver") version libs.versions.kotlin
|
||||
}
|
||||
|
||||
application {
|
||||
|
@ -15,17 +15,11 @@ samWithReceiver {
|
|||
annotation("io.gitlab.jfronny.commons.SamWithReceiver")
|
||||
}
|
||||
|
||||
repositories {
|
||||
mavenLocal()
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val javagiVersion: String by rootProject.extra
|
||||
|
||||
//implementation("io.github.jwharm.javagi:glib:$javagiVersion")
|
||||
//implementation("io.github.jwharm.javagi:gtk:$javagiVersion")
|
||||
implementation("io.github.jwharm.javagi:adw:$javagiVersion")
|
||||
implementation(project(":launcher"))
|
||||
implementation(libs.bundles.javagi)
|
||||
implementation(projects.launcher)
|
||||
}
|
||||
|
||||
tasks.compileJava {
|
||||
|
|
|
@ -73,19 +73,19 @@ object GtkEnvBackend : EnvBackend {
|
|||
cancel: Runnable?
|
||||
) {
|
||||
val dialog = AlertDialog.builder()
|
||||
.message(title)
|
||||
.detail(markup)
|
||||
.modal(true)
|
||||
.setMessage(title)
|
||||
.setDetail(markup)
|
||||
.setModal(true)
|
||||
when {
|
||||
cancel == null -> dialog.buttons(arrayOf(I18n["ok"]))
|
||||
.defaultButton(0)
|
||||
.cancelButton(-1)
|
||||
ok == null -> dialog.buttons(arrayOf("Cancel"))
|
||||
.defaultButton(-1)
|
||||
.cancelButton(0)
|
||||
else -> dialog.buttons(arrayOf("OK", "Cancel"))
|
||||
.defaultButton(0)
|
||||
.cancelButton(1)
|
||||
cancel == null -> dialog.setButtons(arrayOf(I18n["ok"]))
|
||||
.setDefaultButton(0)
|
||||
.setCancelButton(-1)
|
||||
ok == null -> dialog.setButtons(arrayOf("Cancel"))
|
||||
.setDefaultButton(-1)
|
||||
.setCancelButton(0)
|
||||
else -> dialog.setButtons(arrayOf("OK", "Cancel"))
|
||||
.setDefaultButton(0)
|
||||
.setCancelButton(1)
|
||||
}
|
||||
dialog.build().apply {
|
||||
choose(parent, Cancellable()) { _, res, _ ->
|
||||
|
@ -98,7 +98,7 @@ object GtkEnvBackend : EnvBackend {
|
|||
}
|
||||
}
|
||||
|
||||
private fun processResponses(dialog: Dialog, ok: Runnable?, cancel: Runnable?): Dialog.Response = Dialog.Response { responseId: Int ->
|
||||
private fun processResponses(dialog: Dialog, ok: Runnable?, cancel: Runnable?): Dialog.ResponseCallback = Dialog.ResponseCallback { responseId: Int ->
|
||||
when (ResponseType.of(responseId)) {
|
||||
ResponseType.OK -> {
|
||||
dialog.close()
|
||||
|
|
|
@ -47,7 +47,7 @@ object GtkMain {
|
|||
fun setupApplication(args: Array<String>, onActivate: Application.() -> Unit): Int {
|
||||
val app = Application(ID, ApplicationFlags.FLAGS_NONE)
|
||||
app.onActivate {
|
||||
GLib.idleAdd {
|
||||
GLib.idleAdd(GLib.PRIORITY_DEFAULT_IDLE) {
|
||||
runScheduledTasks()
|
||||
true
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class InstanceListEntryFactory(
|
|||
val thumbnail = InstanceThumbnail()
|
||||
thumbnail.name = "inceptum-thumbnail"
|
||||
|
||||
val launch = Button.newFromIconName("media-playback-start-symbolic")
|
||||
val launch = Button.fromIconName("media-playback-start-symbolic")
|
||||
launch.addCssClass("flat")
|
||||
launch.name = "inceptum-launch"
|
||||
launch.tooltipText = I18n["instance.launch"]
|
||||
|
@ -37,7 +37,7 @@ class InstanceListEntryFactory(
|
|||
val menu = MenuButton()
|
||||
menu.addCssClass("flat")
|
||||
menu.iconName = "view-more-symbolic"
|
||||
menu.setPopover(PopoverMenu.newFromModel(Menu()))
|
||||
menu.setPopover(PopoverMenu.fromModel(Menu()))
|
||||
|
||||
val row = ActionRow()
|
||||
row.margin = 8
|
||||
|
|
|
@ -36,8 +36,8 @@ class IRow(
|
|||
append(head)
|
||||
}
|
||||
|
||||
fun setButton(text: @PropertyKey(resourceBundle = I18n.BUNDLE) String, action: Button.Clicked?): Button =
|
||||
Button.newWithLabel(I18n[text]).apply {
|
||||
fun setButton(text: @PropertyKey(resourceBundle = I18n.BUNDLE) String, action: Button.ClickedCallback?): Button =
|
||||
Button.withLabel(I18n[text]).apply {
|
||||
packSmallEnd()
|
||||
onClicked(action)
|
||||
}
|
||||
|
@ -59,7 +59,7 @@ class IRow(
|
|||
}
|
||||
|
||||
fun setSpinButton(value: Double, min: Double, max: Double, step: Double, changed: DoubleConsumer): SpinButton =
|
||||
SpinButton.newWithRange(min, max, step).apply {
|
||||
SpinButton.withRange(min, max, step).apply {
|
||||
packSmallEnd()
|
||||
this.value = value
|
||||
onValueChanged { changed.accept(this.value) }
|
||||
|
|
|
@ -7,6 +7,6 @@ class BuiltRadioItem<T>(action: SimpleAction, private val options: List<T>) : Bu
|
|||
var selected: T
|
||||
get() = options[action.state!!.int32]
|
||||
set(selected) {
|
||||
action.state = Variant.newInt32(options.indexOf(selected))
|
||||
action.state = Variant.int32(options.indexOf(selected))
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ class BuiltToggleItem(action: SimpleAction, menuItem: MenuItem?) : BuiltMenuItem
|
|||
var state: Boolean
|
||||
get() = action.state!!.boolean
|
||||
set(state) {
|
||||
action.state = Variant.newBoolean(state)
|
||||
action.state = Variant.boolean_(state)
|
||||
}
|
||||
|
||||
fun toggle(): Boolean {
|
||||
|
|
|
@ -62,11 +62,11 @@ class MenuBuilder private constructor(map: ActionMap, menu: Menu, prefix: String
|
|||
fun toggle(name: String, initial: Boolean, onToggle: Consumer<Boolean?>): BuiltToggleItem {
|
||||
var name = name
|
||||
name = prefix + name
|
||||
val action = SimpleAction.newStateful(name, null, Variant.newBoolean(initial))
|
||||
val action = SimpleAction.stateful(name, null, Variant.boolean_(initial))
|
||||
addAction(name, action)
|
||||
action.onActivate { _ ->
|
||||
val state = !action.getState()!!.boolean
|
||||
action.state = Variant.newBoolean(state)
|
||||
action.state = Variant.boolean_(state)
|
||||
onToggle.accept(state)
|
||||
}
|
||||
val menuItem = MenuItem(I18n["menu.$name"], groupName + name)
|
||||
|
@ -87,7 +87,7 @@ class MenuBuilder private constructor(map: ActionMap, menu: Menu, prefix: String
|
|||
): BuiltRadioItem<T> {
|
||||
var name = name
|
||||
name = prefix + name
|
||||
val action = SimpleAction.newStateful(name, VariantTypes.INT32, Variant.newInt32(options.indexOf(initial)))
|
||||
val action = SimpleAction.stateful(name, VariantTypes.INT32, Variant.int32(options.indexOf(initial)))
|
||||
addAction(name, action)
|
||||
action.onActivate { variant: Variant? ->
|
||||
action.state = variant
|
||||
|
@ -135,7 +135,7 @@ class MenuBuilder private constructor(map: ActionMap, menu: Menu, prefix: String
|
|||
}
|
||||
|
||||
fun asPopover(): PopoverMenu {
|
||||
return PopoverMenu.newFromModel(menu)
|
||||
return PopoverMenu.fromModel(menu)
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -155,7 +155,7 @@ class MenuBuilder private constructor(map: ActionMap, menu: Menu, prefix: String
|
|||
|
||||
fun create(target: MenuButton, groupName: String): MenuBuilder {
|
||||
val menu = Menu()
|
||||
val pm = PopoverMenu.newFromModel(menu)
|
||||
val pm = PopoverMenu.fromModel(menu)
|
||||
target.setPopover(pm)
|
||||
return MenuBuilder(pm, groupName)
|
||||
}
|
||||
|
|
|
@ -58,8 +58,8 @@ class NewInstanceWindow(app: Application) : KAssistant(app) {
|
|||
var versions = arrayOf<FabricVersionLoaderInfo>()
|
||||
var def = 0
|
||||
|
||||
val none = CheckButton.newWithLabel("None")
|
||||
val fabric = CheckButton.newWithLabel("Fabric")
|
||||
val none = CheckButton.withLabel("None")
|
||||
val fabric = CheckButton.withLabel("Fabric")
|
||||
none.onToggled { useFabric = false }
|
||||
none.onToggled { useFabric = true }
|
||||
fabric.setGroup(none)
|
||||
|
|
|
@ -50,7 +50,7 @@ class MicrosoftLoginDialog(
|
|||
else -> Log.error("Unexpected response type: $responseId")
|
||||
}
|
||||
}
|
||||
val btn = Button.newWithLabel(I18n["auth.open-browser"])
|
||||
val btn = Button.withLabel(I18n["auth.open-browser"])
|
||||
(messageArea as Box).append(btn)
|
||||
btn.onClicked {
|
||||
try {
|
||||
|
|
|
@ -31,7 +31,7 @@ class GeneralTab(window: InstanceSettingsWindow) : SectionedSettingsTab<Instance
|
|||
val instance = window.instance
|
||||
section(null) {
|
||||
row("instance.settings.general.name", "instance.settings.general.name.placeholder") {
|
||||
val apply = Button.newWithLabel(I18n["instance.settings.apply"])
|
||||
val apply = Button.withLabel(I18n["instance.settings.apply"])
|
||||
val entry = setEntry(instance.name) { s: String -> apply.sensitive = s != instance.name }
|
||||
entry.placeholderText = I18n["instance.settings.general.name.placeholder"]
|
||||
apply.valign = Align.CENTER
|
||||
|
@ -127,7 +127,7 @@ class GeneralTab(window: InstanceSettingsWindow) : SectionedSettingsTab<Instance
|
|||
instance.meta.java = s.ifBlank { null }
|
||||
instance.writeMeta()
|
||||
}
|
||||
val btn = Button.newFromIconName("folder-symbolic")
|
||||
val btn = Button.fromIconName("folder-symbolic")
|
||||
btn.valign = Align.CENTER
|
||||
btn.onClicked {
|
||||
val dialog = FileChooserNative(
|
||||
|
|
|
@ -188,7 +188,7 @@ class ModsTab(window: InstanceSettingsWindow) : SettingsTab<Leaflet, InstanceSet
|
|||
val row = ActionRow()
|
||||
row.activatable = true
|
||||
|
||||
val quickAction = Button.newFromIconName("folder-download-symbolic")
|
||||
val quickAction = Button.fromIconName("folder-download-symbolic")
|
||||
quickAction.addCssClass("flat")
|
||||
quickAction.tooltipText = I18n["instance.settings.mods.download"]
|
||||
|
||||
|
@ -205,7 +205,7 @@ class ModsTab(window: InstanceSettingsWindow) : SettingsTab<Leaflet, InstanceSet
|
|||
fun setupQuickAction(
|
||||
iconName: String,
|
||||
description: @PropertyKey(resourceBundle = I18n.BUNDLE) String,
|
||||
handler: Button.Clicked
|
||||
handler: Button.ClickedCallback
|
||||
) {
|
||||
data.quickAction.iconName = iconName
|
||||
data.quickAction.tooltipText = I18n[description]
|
||||
|
|
|
@ -17,7 +17,7 @@ class AccountsTab(window: Window?) : SectionedSettingsTab<Window>(window) {
|
|||
|
||||
private fun Section.build() {
|
||||
generateRows()
|
||||
val row = Button.newFromIconName("list-add-symbolic")
|
||||
val row = Button.fromIconName("list-add-symbolic")
|
||||
row(row)
|
||||
row.onClicked {
|
||||
MicrosoftLoginDialog(window) {
|
||||
|
@ -46,7 +46,7 @@ class AccountsTab(window: Window?) : SectionedSettingsTab<Window>(window) {
|
|||
subtitle.halign = Align.START
|
||||
head.append(subtitle)
|
||||
row.append(head)
|
||||
val remove = Button.newFromIconName("window-close-symbolic")
|
||||
val remove = Button.fromIconName("window-close-symbolic")
|
||||
remove.valign = Align.CENTER
|
||||
remove.halign = Align.END
|
||||
remove.onClicked {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id("inceptum.application")
|
||||
inceptum.application
|
||||
}
|
||||
|
||||
application {
|
||||
|
@ -8,23 +8,21 @@ application {
|
|||
|
||||
dependencies {
|
||||
val flavor: String by rootProject.extra
|
||||
val lwjglVersion: String by rootProject.extra
|
||||
val imguiVersion: String by rootProject.extra
|
||||
|
||||
fun native(name: String) {
|
||||
if (flavor == "windows" || flavor == "fat") implementation(name.replace("@platform", "windows"))
|
||||
if (flavor == "linux" || flavor == "fat") implementation(name.replace("@platform", "linux"))
|
||||
if (flavor == "macos" || flavor == "fat") implementation(name.replace("@platform", "macos"))
|
||||
implementation(projects.launcher)
|
||||
|
||||
fun forEachPlatform(action: (String) -> Unit) {
|
||||
(if (flavor == "fat") listOf("windows", "linux", "macos") else listOf(flavor)).forEach(action)
|
||||
}
|
||||
|
||||
implementation(project(":launcher"))
|
||||
|
||||
arrayOf("", "-opengl", "-glfw", "-tinyfd").forEach {
|
||||
implementation("org.lwjgl:lwjgl$it:$lwjglVersion")
|
||||
native("org.lwjgl:lwjgl$it:$lwjglVersion:natives-@platform")
|
||||
implementation(libs.bundles.lwjgl)
|
||||
libs.bundles.lwjgl.natives.get().forEach {
|
||||
forEachPlatform { suffix -> implementation(variantOf(provider { it }) { classifier("natives-$suffix") }) }
|
||||
}
|
||||
|
||||
implementation("io.github.spair:imgui-java-binding:$imguiVersion") // https://github.com/SpaiR/imgui-java
|
||||
implementation("io.github.spair:imgui-java-lwjgl3:$imguiVersion")
|
||||
native("io.github.spair:imgui-java-natives-@platform:$imguiVersion")
|
||||
implementation(libs.imgui)
|
||||
implementation(libs.imgui.lwjgl)
|
||||
if (flavor == "windows" || flavor == "fat") implementation(libs.imgui.natives.windows)
|
||||
if (flavor == "linux" || flavor == "fat") implementation(libs.imgui.natives.linux)
|
||||
if (flavor == "macos" || flavor == "fat") implementation(libs.imgui.natives.macos)
|
||||
}
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
plugins {
|
||||
id("inceptum.library")
|
||||
id("inceptum.gson-compile")
|
||||
inceptum.library
|
||||
inceptum.`gson-compile`
|
||||
}
|
||||
|
||||
dependencies {
|
||||
val jfCommonsVersion: String by rootProject.extra
|
||||
val jbAnnotationsVersion: String by rootProject.extra
|
||||
|
||||
api(project(":common"))
|
||||
api("io.gitlab.jfronny:commons-http-server:$jfCommonsVersion") // required for launcher-gtk for some reason
|
||||
compileOnly("org.jetbrains:annotations:$jbAnnotationsVersion")
|
||||
api(projects.common)
|
||||
api(libs.commons.http.server) // required for launcher-gtk for some reason
|
||||
}
|
||||
|
|
|
@ -1,11 +1,8 @@
|
|||
plugins {
|
||||
id("inceptum.library")
|
||||
inceptum.library
|
||||
}
|
||||
|
||||
java {
|
||||
targetCompatibility = JavaVersion.VERSION_1_8
|
||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||
}
|
||||
|
||||
dependencies {
|
||||
}
|
|
@ -8,3 +8,5 @@ include("launcher-imgui")
|
|||
include("launcher-dist")
|
||||
include("launchwrapper")
|
||||
include("launcher-gtk")
|
||||
|
||||
enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
|
|
@ -1,5 +1,5 @@
|
|||
plugins {
|
||||
id("inceptum.application-standalone")
|
||||
inceptum.`application-standalone`
|
||||
}
|
||||
|
||||
application {
|
||||
|
@ -7,7 +7,7 @@ application {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
implementation(project(":common"))
|
||||
implementation(projects.common)
|
||||
}
|
||||
|
||||
tasks.runShadow.get().workingDir = rootProject.projectDir
|
Loading…
Reference in New Issue