forked from terrakok/kmp-web-wizard
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue-10] Support Single Targets and Native-Grouped Targets
[Summary] Some dependencies are only applicable to 1 target, and some apply to all native targets (except WASM, which almost no one supports yet). It would be nice to add in some target-specific dependencies, especially when they relate closely to a shared dependency (Ktor and SQLDelight are examples). [Fix] Create a "Single Target Libraries" and a "Native Target Libraries" section. Single Target libraries are available as long as there is a target selected that supports it. Native Target Libraries are available as long as there is at least one native target it builds for (excluding WASM). [Testing] - `./gradlew check` - manual testing
- Loading branch information
1 parent
16a6424
commit c5318ed
Showing
11 changed files
with
267 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/commonMain/kotlin/org/jetbrains/webwiz/models/NativeTargetLibrary.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package org.jetbrains.webwiz.models | ||
|
||
import org.jetbrains.webwiz.models.SourceSetType.MAIN | ||
|
||
// Dependencies in here will be available for all native targets | ||
enum class NativeTargetLibrary( | ||
val userName: String, | ||
val dep: String, | ||
val sourceSetType: SourceSetType | ||
) { | ||
SQLDELIGHT_DRIVER_NATIVE( | ||
"SQDelight Native Driver", | ||
"com.squareup.sqldelight:native-driver:1.5.3", | ||
MAIN | ||
), | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/commonMain/kotlin/org/jetbrains/webwiz/models/SingleTargetLibrary.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package org.jetbrains.webwiz.models | ||
|
||
import org.jetbrains.webwiz.models.SourceSetType.MAIN | ||
|
||
enum class SingleTargetLibrary( | ||
val target: Target, | ||
val userName: String, | ||
val dep: String, | ||
val sourceSetType: SourceSetType | ||
) { | ||
KTOR_CLIENT_IOS( | ||
Target.IOS, | ||
"Ktor iOS Client", | ||
"io.ktor:ktor-client-ios:1.6.7", | ||
MAIN | ||
), | ||
KTOR_CLIENT_OKHTTP( | ||
Target.ANDROID, | ||
"Ktor OkHttp Client", | ||
"io.ktor:ktor-client-okhttp:1.6.7", | ||
MAIN | ||
), | ||
KTOR_CLIENT_JVM( | ||
Target.JVM, | ||
"Ktor JVM Client", | ||
"io.ktor:ktor-client-jvm:1.6.7", | ||
MAIN | ||
), | ||
KTOR_CLIENT_JS( | ||
Target.JS, | ||
"Ktor JS Client", | ||
"io.ktor:ktor-client-js:1.6.7", | ||
MAIN | ||
), | ||
SQLDELIGHT_DRIVER_ANDROID( | ||
Target.ANDROID, | ||
"SQLDelight Android Driver", | ||
"com.squareup.sqldelight:android-driver:1.5.3", | ||
MAIN | ||
), | ||
SQLDELIGHT_DRIVER_JVM( | ||
Target.JVM, | ||
"SQLDelight JVM Driver", | ||
"com.squareup.sqldelight:sqlite-driver:1.5.3", | ||
MAIN | ||
), | ||
SQLDELIGHT_DRIVER_JS( | ||
Target.JS, | ||
"SQDelight JS Driver", | ||
"com.squareup.sqldelight:sqljs-driver:1.5.3", | ||
MAIN | ||
), | ||
} |
11 changes: 11 additions & 0 deletions
11
src/commonMain/kotlin/org/jetbrains/webwiz/models/SourceSetType.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.jetbrains.webwiz.models | ||
|
||
enum class SourceSetType(val sourceSetTypeName: String) { | ||
MAIN("Main"), | ||
TEST("Test") | ||
} | ||
|
||
enum class SourceSetDelegate(val delegate: String) { | ||
CREATING("creating"), | ||
GETTING("getting") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.