Skip to content

Commit

Permalink
Fixed crash on boot w/out data
Browse files Browse the repository at this point in the history
  • Loading branch information
kaeaton committed Feb 7, 2024
1 parent b87e00f commit a4ed50f
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 37 deletions.
74 changes: 37 additions & 37 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -85,43 +85,43 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
tasks.test { useJUnitPlatform() }

// Compile to fat jar
tasks.named<Jar>("jar") {
manifest {
attributes(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version,
"Main-Class" to "org.b12x.gfe.GSG"
)
}

// To avoid the duplicate handling strategy error
duplicatesStrategy = DuplicatesStrategy.EXCLUDE

// To add all of the dependencies otherwise a "NoClassDefFoundError" error
from(sourceSets.main.get().output)

dependsOn(configurations.runtimeClasspath)
from({
configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
})
}

tasks {
val fatJar = register<Jar>("fatJar") {
dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources")) // We need this for Gradle optimization to work
archiveClassifier.set("standalone") // Naming the jar
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
manifest { attributes(mapOf("Main-Class" to application.mainClass)) } // Provided we set it up in the application plugin configuration
val sourcesMain = sourceSets.main.get()
val contents = configurations.runtimeClasspath.get()
.map { if (it.isDirectory) it else zipTree(it) } +
sourcesMain.output
from(contents)
}
build {
dependsOn(fatJar) // Trigger fat jar creation during build
}
}
//tasks.named<Jar>("jar") {
// manifest {
// attributes(
// "Implementation-Title" to project.name,
// "Implementation-Version" to project.version,
// "Main-Class" to "org.b12x.gfe.GSG"
// )
// }
//
// // To avoid the duplicate handling strategy error
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
//
// // To add all of the dependencies otherwise a "NoClassDefFoundError" error
// from(sourceSets.main.get().output)
//
// dependsOn(configurations.runtimeClasspath)
// from({
// configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) }
// })
//}

//tasks {
// val fatJar = register<Jar>("fatJar") {
// dependsOn.addAll(listOf("compileJava", "compileKotlin", "processResources")) // We need this for Gradle optimization to work
// archiveClassifier.set("standalone") // Naming the jar
// duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// manifest { attributes(mapOf("Main-Class" to application.mainClass)) } // Provided we set it up in the application plugin configuration
// val sourcesMain = sourceSets.main.get()
// val contents = configurations.runtimeClasspath.get()
// .map { if (it.isDirectory) it else zipTree(it) } +
// sourcesMain.output
// from(contents)
// }
// build {
// dependsOn(fatJar) // Trigger fat jar creation during build
// }
//}

// Be sure to use latest Gradle version
tasks.named<Wrapper>("wrapper") { gradleVersion = "7.5.1" }
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ object CreateNewGfeSearchData {
BuildRegexString.assembleRegexString(gfeSearchData)
BuildHeaderString.assembleHeaderString(gfeSearchData)

return gfeSearchData

} catch (ex: Exception) {
val noDataMsg = "GSG cannot create a search.\nPlease check to see if you have internet and data.\n" +
"Data files are located in Documents/GSG/GSGData/.\nIf the HLA folder is empty, you need to download data."
Expand Down

0 comments on commit a4ed50f

Please sign in to comment.