Build native app
This commit is contained in:
parent
478bbce6ff
commit
432ee4d045
@ -1,8 +1,11 @@
|
||||
plugins {
|
||||
application
|
||||
kotlin("jvm") version "2.1.10"
|
||||
id("com.github.johnrengelman.shadow") version "7.1.2"
|
||||
id("org.graalvm.buildtools.native") version "0.10.5"
|
||||
}
|
||||
|
||||
group = "com.blzr"
|
||||
group = "me.blzr"
|
||||
version = "1.0-SNAPSHOT"
|
||||
|
||||
repositories {
|
||||
@ -15,9 +18,34 @@ dependencies {
|
||||
testImplementation(kotlin("test"))
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("me.blzr.apex.MainKt")
|
||||
}
|
||||
|
||||
tasks.test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
kotlin {
|
||||
jvmToolchain(17)
|
||||
}
|
||||
// https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html#configure-native-image
|
||||
// Install visual studio https://www.graalvm.org/latest/getting-started/windows/
|
||||
// Run
|
||||
// set JAVA_HOME=%USERPROFILE%\.jdks\graalvm-jdk-23.0.2
|
||||
// call "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvars64.bat" > nul
|
||||
// gradlew nativeCompile
|
||||
// On linux run java -jar -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image build/libs/xlsx2json-1.0-SNAPSHOT-all.jar src/test/resources/input.xlsx out.json
|
||||
graalvmNative {
|
||||
// toolchainDetection.set(true)
|
||||
binaries {
|
||||
named("main") {
|
||||
useFatJar.set(true)
|
||||
buildArgs.add("-H:-CheckToolchain")
|
||||
// CP1252 is missing
|
||||
// https://github.com/apache/poi/blob/trunk/poi/src/main/java/org/apache/poi/poifs/filesystem/FileMagic.java#L133
|
||||
buildArgs.add("-H:+AddAllCharsets")
|
||||
configurationFileDirectories.from(file("src/main/resources/META-INF/native-image/"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
plugins {
|
||||
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
|
||||
}
|
||||
rootProject.name = "obu"
|
||||
rootProject.name = "apex-ddl-splitter"
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
package com.blzr
|
||||
package me.blzr.apex
|
||||
|
||||
import me.alllex.parsus.parser.getOrElse
|
||||
import java.io.File
|
||||
@ -15,7 +15,7 @@ fun main(vararg args: String) {
|
||||
1 -> args[0] to "${args[0].let { if (it.endsWith(".sql")) it.dropLast(4) else it }}/out/"
|
||||
2 -> args[0] to args[1]
|
||||
else -> {
|
||||
println("input.sql [out folder]")
|
||||
println("apex-ddl-splitter input.sql [out folder]")
|
||||
exitProcess(0)
|
||||
}
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
package com.blzr
|
||||
package me.blzr.apex
|
||||
|
||||
sealed class Ora {
|
||||
data class CreateTable(override val name: String, override val fileName: String = "table ${name.lowercase()}.sql") : Ora()
|
||||
@ -1,4 +1,4 @@
|
||||
package com.blzr
|
||||
package me.blzr.apex
|
||||
|
||||
import me.alllex.parsus.parser.Grammar
|
||||
import me.alllex.parsus.parser.choose
|
||||
Loading…
x
Reference in New Issue
Block a user