Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
simonnorberg committed Dec 26, 2024
1 parent 88aa7a2 commit 772eb60
Show file tree
Hide file tree
Showing 21 changed files with 115 additions and 62 deletions.
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ ktlint_code_style = android_studio
max_line_length = 120
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_standard_function-signature = disabled
ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than = 1
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.2.2

- name: Set up JDK
uses: actions/setup-java@v4.2.1
uses: actions/setup-java@v4.6.0
with:
distribution: 'zulu'
java-version: 17
java-version: 21

- name: Update submodules
run: git submodule update --init --recursive
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ build
captures
.externalNativeBuild
.cxx
.kotlin
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ repositories {
mavenCentral()
}
dependencies {
implementation("net.simno.kortholt:kortholt:3.2.0")
implementation("net.simno.kortholt:kortholt:3.3.0")
}
```

Expand Down
3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
alias(libs.plugins.android.application) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.kotlin.compose) apply false
alias(libs.plugins.ktlint.gradle)
alias(libs.plugins.publish.plugin)
alias(libs.plugins.gradle.versions)
Expand All @@ -20,7 +21,7 @@ allprojects {
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
compilerOptions {
allWarningsAsErrors = true
}
}
Expand Down
35 changes: 18 additions & 17 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
[versions]
agp = "8.4.0"
compileSdk = "34"
agp = "8.7.3"
compileSdk = "35"
minSdk = "28"
targetSdk = "34"
ndk = "26.3.11579264"
androidx-activity = "1.9.0"
androidx-annotation = "1.7.1"
androidx-core = "1.13.1"
androidx-lifecycle = "2.7.0"
targetSdk = "35"
ndk = "27.2.12479018"
androidx-activity = "1.9.3"
androidx-annotation = "1.9.1"
androidx-core = "1.15.0"
androidx-lifecycle = "2.8.7"
androidx-media = "1.7.0"
cachefix = "3.0.1"
compose-bom = "2024.05.00"
compose-compiler = "1.5.13"
compose-lint = "1.3.1"
coroutines = "1.8.1"
compose-bom = "2024.12.01"
compose-lint = "1.4.2"
coroutines = "1.10.1"
gradle-versions = "0.51.0"
javaVersion = "17"
kotlin = "1.9.23"
ktlint = "1.2.1"
ktlint-compose = "0.3.20"
ktlint-gradle = "12.1.1"
javaVersion = "21"
kotlin = "2.1.0"
ktlint = "1.5.0"
ktlint-compose = "0.4.22"
ktlint-gradle = "12.1.2"
publish-plugin = "2.0.0"
relinker = "1.4.5"
zip4j = "2.11.5"
Expand All @@ -28,6 +27,7 @@ zip4j = "2.11.5"
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
cachefix = { id = "org.gradle.android.cache-fix", version.ref = "cachefix" }
gradle-versions = { id = "com.github.ben-manes.versions", version.ref = "gradle-versions" }
ktlint-gradle = { id = "org.jlleitschuh.gradle.ktlint", version.ref = "ktlint-gradle" }
Expand All @@ -41,6 +41,7 @@ androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-kt
androidx-media = { module = "androidx.media:media", version.ref = "androidx-media" }
compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-bom" }
compose-material = { module = "androidx.compose.material3:material3" }
compose-ui = { module = "androidx.compose.ui:ui" }
compose-lint = { module = "com.slack.lint.compose:compose-lint-checks", version.ref = "compose-lint" }
coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
ktlint-compose = { module = "io.nlopez.compose.rules:ktlint", version.ref = "ktlint-compose" }
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
6 changes: 4 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#

##############################################################################
#
Expand Down Expand Up @@ -55,7 +57,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down Expand Up @@ -84,7 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down
2 changes: 2 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
Expand Down
5 changes: 2 additions & 3 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ android {
lint {
warningsAsErrors = true
abortOnError = true
disable += "GradleDependency"
}
publishing {
singleVariant("release") {
Expand All @@ -57,7 +56,7 @@ dependencies {
val siteUrl = "https://github.com/simonnorberg/kortholt"
val gitUrl = "https://github.com/simonnorberg/kortholt.git"

version = "3.2.0"
version = "3.3.0"
group = "net.simno.kortholt"

afterEvaluate {
Expand All @@ -67,7 +66,7 @@ afterEvaluate {
from(components["release"])
groupId = "net.simno.kortholt"
artifactId = "kortholt"
version = "3.2.0"
version = "3.3.0"
pom {
name.set("kortholt")
url.set(siteUrl)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/cpp/oboe
Submodule oboe updated 135 files
8 changes: 4 additions & 4 deletions lib/src/main/java/net/simno/kortholt/Kortholt.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ object Kortholt {
private var player: Player? = null

@JvmStatic
fun player(context: Context): Player {
return player ?: newPlayer(context)
}
fun player(context: Context): Player = player ?: newPlayer(context)

@JvmStatic
@Synchronized
Expand Down Expand Up @@ -77,7 +75,9 @@ object Kortholt {
fun newPlayer(): Player
}

class Builder(context: Context) {
class Builder(
context: Context
) {
private val applicationContext: Context = context.applicationContext
private var dispatcher: CoroutineDispatcher = Dispatchers.IO

Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/java/net/simno/kortholt/KortholtPlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,6 @@ internal class KortholtPlayer(

companion object {
private const val NOT_SET = -1L
private const val VERSION = "3.2.0"
private const val VERSION = "3.3.0"
}
}
16 changes: 13 additions & 3 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.cachefix)
}

Expand All @@ -18,9 +21,6 @@ android {
buildConfig = true
compose = true
}
composeOptions {
kotlinCompilerExtensionVersion = libs.versions.compose.compiler.get()
}
packaging {
resources.excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
Expand All @@ -38,6 +38,16 @@ dependencies {
implementation(libs.androidx.media)
implementation(platform(libs.compose.bom))
implementation(libs.compose.material)
implementation(libs.compose.ui)
lintChecks(libs.compose.lint)
ktlintRuleset(libs.ktlint.compose)
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
allWarningsAsErrors = true
freeCompilerArgs.addAll(
"-opt-in=androidx.compose.material3.ExperimentalMaterial3Api"
)
}
}
2 changes: 1 addition & 1 deletion sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:icon="@drawable/ic_music_note"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@android:style/Theme.Material.Light"
android:theme="@android:style/Theme.Material.Light.NoActionBar"
tools:targetApi="tiramisu">
<activity
android:name=".SampleActivity"
Expand Down
21 changes: 5 additions & 16 deletions sample/src/main/java/net/simno/kortholt/sample/LabeledCheckbox.kt
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package net.simno.kortholt.sample

import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Checkbox
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
Expand All @@ -21,25 +16,19 @@ import androidx.compose.ui.unit.dp
fun LabeledCheckbox(
label: Int,
checked: Boolean,
modifier: Modifier = Modifier,
onCheckedChange: (Boolean) -> Unit
onCheckedChange: (Boolean) -> Unit,
modifier: Modifier = Modifier
) {
var isChecked by remember { mutableStateOf(checked) }
Row(
modifier = modifier
.clickable {
isChecked = !isChecked
onCheckedChange(isChecked)
}
.fillMaxWidth()
.padding(16.dp),
.padding(horizontal = 16.dp),
horizontalArrangement = Arrangement.spacedBy(16.dp),
verticalAlignment = Alignment.CenterVertically
) {
Checkbox(
checked = isChecked,
onCheckedChange = null,
enabled = false
checked = checked,
onCheckedChange = onCheckedChange
)
Text(stringResource(label))
}
Expand Down
20 changes: 15 additions & 5 deletions sample/src/main/java/net/simno/kortholt/sample/SampleActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ package net.simno.kortholt.sample
import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.material3.TopAppBar
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.lifecycle.lifecycleScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
Expand All @@ -15,10 +21,14 @@ class SampleActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
lifecycleScope.launch { kortholt.openPatch(R.raw.test, "test.pd", extractZip = true) }
enableEdgeToEdge()
setContent {
MaterialTheme {
Surface {
SampleScreen()
SampleTheme {
Scaffold(
modifier = Modifier.fillMaxSize(),
topBar = { TopAppBar(title = { Text(stringResource(R.string.app_name)) }) }
) { innerPadding ->
SampleScreen(modifier = Modifier.padding(innerPadding))
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion sample/src/main/java/net/simno/kortholt/sample/SampleApp.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import android.app.Application
import kotlinx.coroutines.Dispatchers
import net.simno.kortholt.Kortholt

class SampleApp : Application(), Kortholt.Player.Factory {
class SampleApp :
Application(),
Kortholt.Player.Factory {
override fun newPlayer() = Kortholt.Player.Builder(this)
.dispatcher(Dispatchers.IO)
.build()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ fun SampleScreen(
val kortholt = remember { context.kortholt }
val scope = rememberCoroutineScope()
var isPlaying by remember { mutableStateOf(false) }
var leftEnabled by remember { mutableStateOf(true) }
var rightEnabled by remember { mutableStateOf(true) }
var waveFile by remember { mutableStateOf<File?>(null) }

fun saveWaveFile(seconds: Int) {
Expand Down Expand Up @@ -73,15 +75,17 @@ fun SampleScreen(
)
LabeledCheckbox(
label = R.string.left_label,
checked = true,
checked = leftEnabled,
onCheckedChange = { isChecked ->
leftEnabled = isChecked
kortholt.sendFloat("left", if (isChecked) 1f else 0f)
}
)
LabeledCheckbox(
label = R.string.right_label,
checked = true,
checked = rightEnabled,
onCheckedChange = { isChecked ->
rightEnabled = isChecked
kortholt.sendFloat("right", if (isChecked) 1f else 0f)
}
)
Expand Down
Loading

0 comments on commit 772eb60

Please sign in to comment.