-
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.
Now demo app is a KMP app (android/desktop/wasmJs).
I could also add iosApp, but that'd be a few more hours work, which I don't find worth... you can copy and edit files from ktmidi-ci-tool.
- Loading branch information
1 parent
3f08f1f
commit 3d3e8c1
Showing
38 changed files
with
1,104 additions
and
103 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,74 +1,119 @@ | ||
@Suppress("DSL_SCOPE_VIOLATION") // TODO: Remove once KTIJ-19369 is fixed | ||
import org.jetbrains.compose.desktop.application.dsl.TargetFormat | ||
|
||
plugins { | ||
kotlin("multiplatform") | ||
alias(libs.plugins.androidApplication) | ||
alias(libs.plugins.kotlinAndroid) | ||
alias(libs.plugins.jetbrainsComposePlugin) | ||
} | ||
|
||
dependencies.platform(libs.compose.bom) | ||
|
||
kotlin { | ||
wasmJs { | ||
browser { | ||
commonWebpackConfig { | ||
outputFileName = "demoapp.js" | ||
} | ||
} | ||
//nodejs {} | ||
binaries.executable() | ||
} | ||
|
||
androidTarget { | ||
compilations.all { | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
} | ||
} | ||
} | ||
|
||
jvm("desktop") | ||
|
||
listOf( | ||
iosX64(), | ||
iosArm64(), | ||
iosSimulatorArm64() | ||
).forEach { iosTarget -> | ||
iosTarget.binaries.framework { | ||
baseName = "ComposeAudioControlsDemoApp" | ||
isStatic = true | ||
} | ||
} | ||
|
||
sourceSets { | ||
val desktopMain by getting | ||
|
||
androidMain.dependencies { | ||
implementation(libs.core.ktx) | ||
implementation(libs.activity.compose) | ||
} | ||
commonMain.dependencies { | ||
implementation(project(":compose-audio-controls")) | ||
implementation(project(":compose-audio-controls-midi")) | ||
|
||
implementation(libs.ktmidi) | ||
implementation(compose.components.resources) | ||
implementation(compose.components.uiToolingPreview) | ||
} | ||
desktopMain.dependencies { | ||
implementation(compose.desktop.currentOs) | ||
implementation(libs.ktmidi.jvm.desktop) | ||
} | ||
|
||
val iosMain by creating { dependsOn(commonMain.get()) } | ||
val iosX64Main by getting { dependsOn(iosMain) } | ||
val iosArm64Main by getting { dependsOn(iosMain) } | ||
val iosSimulatorArm64Main by getting { dependsOn(iosMain) | ||
} | ||
} | ||
} | ||
|
||
android { | ||
namespace = "org.androidaudioplugin.composeaudiocontrols.demoapp" | ||
compileSdk = 34 | ||
|
||
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml") | ||
sourceSets["main"].res.srcDirs("src/androidMain/res") | ||
sourceSets["main"].resources.srcDirs("src/commonMain/resources") | ||
|
||
defaultConfig { | ||
applicationId = "org.androidaudioplugin.composeaudiocontrols" | ||
applicationId = "org.androidaudioplugin.composeaudiocontrols.demoapp" | ||
minSdk = 23 | ||
targetSdk = 34 | ||
versionCode = 1 | ||
versionName = "1.0" | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
|
||
buildTypes { | ||
release { | ||
getByName("release") { | ||
isMinifyEnabled = false | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_1_8 | ||
targetCompatibility = JavaVersion.VERSION_1_8 | ||
} | ||
kotlinOptions { | ||
jvmTarget = "1.8" | ||
dependencies { | ||
debugImplementation(libs.compose.ui.tooling) | ||
} | ||
buildFeatures { | ||
compose = true | ||
} | ||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.5.8" | ||
} | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
|
||
compose.desktop { | ||
application { | ||
mainClass = "MainKt" | ||
|
||
nativeDistributions { | ||
targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) | ||
packageName = "dev.atsushieno.ktmidi.citool" | ||
packageVersion = "1.0.0" | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":compose-audio-controls")) | ||
implementation(project(":compose-audio-controls-midi")) | ||
|
||
implementation(libs.core.ktx) | ||
implementation(libs.lifecycle.runtime.ktx) | ||
implementation(libs.activity.compose) | ||
implementation(platform(libs.compose.bom)) | ||
implementation(libs.compose.ui) | ||
implementation(libs.compose.ui.graphics) | ||
implementation(libs.compose.ui.tooling.preview) | ||
implementation(libs.compose.material3) | ||
implementation(libs.ktmidi) | ||
|
||
testImplementation(libs.junit) | ||
androidTestImplementation(libs.androidx.test.ext.junit) | ||
androidTestImplementation(libs.espresso.core) | ||
androidTestImplementation(platform(libs.compose.bom)) | ||
androidTestImplementation(libs.compose.ui.test.junit4) | ||
debugImplementation(libs.compose.ui.tooling) | ||
debugImplementation(libs.compose.ui.test.manifest) | ||
} | ||
compose.experimental { | ||
web.application {} | ||
} |
File renamed without changes.
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
32 changes: 32 additions & 0 deletions
32
...oidMain/kotlin/org/androidaudioplugin/composeaudiocontrols/demoapp/MainContent.android.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,32 @@ | ||
package org.androidaudioplugin.composeaudiocontrols.demoapp | ||
|
||
import androidx.compose.foundation.layout.Column | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.runtime.getValue | ||
import androidx.compose.runtime.mutableStateOf | ||
import androidx.compose.runtime.remember | ||
import dev.atsushieno.ktmidi.EmptyMidiAccess | ||
import org.androidaudioplugin.composeaudiocontrols.demoapp.theme.ComposeAudioControlsTheme | ||
import org.androidaudioplugin.composeaudiocontrols.midi.DiatonicLiveMidiKeyboard | ||
import org.androidaudioplugin.composeaudiocontrols.midi.KtMidiDeviceAccessScope | ||
import org.androidaudioplugin.composeaudiocontrols.midi.MidiDeviceConfigurator | ||
|
||
|
||
@Composable | ||
fun KnobPreview() { | ||
ComposeAudioControlsTheme { | ||
ImageStripKnobDemo() | ||
} | ||
} | ||
|
||
|
||
@Composable | ||
fun DiatonicKeyboardPreview() { | ||
ComposeAudioControlsTheme { | ||
Column { | ||
val scope by remember { mutableStateOf(KtMidiDeviceAccessScope(EmptyMidiAccess())) } | ||
scope.MidiDeviceConfigurator() | ||
scope.DiatonicLiveMidiKeyboard() | ||
} | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
...seaudiocontrols/demoapp/ui/theme/Color.kt → ...mposeaudiocontrols/demoapp/theme/Color.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
2 changes: 1 addition & 1 deletion
2
...seaudiocontrols/demoapp/ui/theme/Theme.kt → ...mposeaudiocontrols/demoapp/theme/Theme.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
2 changes: 1 addition & 1 deletion
2
...oseaudiocontrols/demoapp/ui/theme/Type.kt → ...omposeaudiocontrols/demoapp/theme/Type.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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
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.