Skip to content

Commit

Permalink
◀️ integrate terminal app template
Browse files Browse the repository at this point in the history
  • Loading branch information
theapache64 committed Dec 19, 2022
1 parent ae09ecb commit 67f512b
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 13 deletions.
22 changes: 12 additions & 10 deletions .idea/artifacts/create_compose_app_main_jar.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
Manifest-Version: 1.0
Main-Class: com.theapache64.createcomposeapp.MainKt
Class-Path: annotations-13.0.jar kotlin-stdlib-common-1.6.10.jar kotlin-
stdlib-jdk8-1.6.10.jar kotlin-stdlib-jdk7-1.6.10.jar kotlin-stdlib-1.6.
10.jar

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "index.js",
"preferGlobal": true,
"repository": "https://github.com/theapache64/create-compose-app",
"version": "2022.8.29",
"version": "2022.12.19",
"jdeploy": {},
"dependencies": {
"shelljs": "0.8.4"
Expand Down
24 changes: 22 additions & 2 deletions src/main/kotlin/com/theapache64/createcomposeapp/Main.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import kotlin.io.path.Path
import kotlin.io.path.div

private const val IS_DEBUG = false
private const val VERSION = "2022.8.29"
private const val VERSION = "2022.12.19"

enum class Platform(val title: String) {
Android("🤖 Android"),
Expand All @@ -19,6 +19,7 @@ enum class Platform(val title: String) {
Wasm("🌐 Wasm"),
ChromeExt("🔌 Chrome extension"),
DesktopGame("🎮 Desktop (game)"),
Terminal("⌨️ Terminal")
}


Expand Down Expand Up @@ -51,9 +52,9 @@ fun main(args: Array<String>) {
Platform.Wasm -> createComposeWasmApp()
Platform.ChromeExt -> createChromeExtensionApp()
Platform.DesktopGame -> createDesktopGameApp()
Platform.Terminal -> createTerminalApp()
}
}

fun createAndroidApp() {
val corvette = Corvette(
githubRepoUrl = "https://github.com/theapache64/compose-android-template",
Expand Down Expand Up @@ -174,4 +175,23 @@ private fun createDesktopGameApp() {

corvette.start(replaceMap)
println(Color.YELLOW, "Run `./gradlew run` from project root to run the game")
}

private fun createTerminalApp() {
val corvette = Corvette(
githubRepoUrl = "https://github.com/theapache64/compose-terminal-template",
isDebug = IS_DEBUG,
modules = arrayOf("src"),
srcDirs = arrayOf("main"),
srcPackagePath = Path("com") / "myterminal"
)

val replaceMap = mapOf(
"rootProject.name = \"compose-terminal-template\"" to "rootProject.name = \"${corvette.projectDirName}\"", // settings.gradle.kt
"mainClass.set(\"com.myterminal.app.AppKt\")" to "mainClass.set(\"${corvette.packageName}.app.AppKt\")",
"com.myterminal" to corvette.packageName, // app kt files
)

corvette.start(replaceMap)
println(Color.YELLOW, "Run `./gradlew run` from project root to run the app")
}

0 comments on commit 67f512b

Please sign in to comment.