Skip to content
Merged
Changes from 1 commit
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
12 changes: 5 additions & 7 deletions desktop-web-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
* SOFTWARE.
*/

import Build_gradle.WebFramework.Companion.fromProperty
import com.google.protobuf.gradle.id
import org.gradle.api.JavaVersion.VERSION_17

Expand All @@ -39,10 +40,7 @@ version = "1.0"
val applicationName = "JxBrowserWebApp"
val mainJar = "$applicationName-$version.jar"

val webFramework = project.findProperty("frontend")
?.toString()
?.let { WebFramework.fromProperty(it) }
?: WebFramework.REACT
val webFramework = project.fromProperty("frontend")
val webAppLocationDir = "${projectDir}/${webFramework.dirName}"

val host = "localhost"
Expand Down Expand Up @@ -233,9 +231,9 @@ enum class WebFramework(val dirName: String) {
VUE("web-app-vue");

companion object {
fun fromProperty(value: String?): WebFramework {
return values().find { it.name.equals(value, ignoreCase = true) }
?: REACT
fun Project.fromProperty(propertyName: String): WebFramework {
val value = findProperty(propertyName)?.toString()
return values().find { it.name.equals(value, ignoreCase = true) } ?: REACT
}
}
}
Loading