Skip to content

Commit 1e48643

Browse files
committed
update versions
1 parent 85ae4be commit 1e48643

11 files changed

Lines changed: 76 additions & 61 deletions

File tree

.idea/compiler.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

androidresampler-demo/build.gradle.kts

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
1+
@file:Suppress("UnstableApiUsage")
2+
3+
import org.gradle.kotlin.dsl.withType
4+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
5+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
6+
7+
18
plugins {
29
alias(libs.plugins.androidApplication)
310
alias(libs.plugins.kotlinAndroid)
11+
alias(libs.plugins.compose.compiler)
412
}
513

614
android {
715
namespace = "io.github.nailik.androidresampler_demo"
8-
compileSdk = 34
16+
compileSdk = 36
917

1018
defaultConfig {
1119
applicationId = "io.github.nailik.androidresampler_demo"
1220
minSdk = 24
13-
targetSdk = 34
14-
versionCode = 1
15-
versionName = "1.0"
21+
targetSdk = 36
22+
versionCode = 2
23+
versionName = "1.1"
1624

1725
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
1826
vectorDrawables {
@@ -30,18 +38,12 @@ android {
3038
}
3139
}
3240
compileOptions {
33-
sourceCompatibility = JavaVersion.VERSION_1_8
34-
targetCompatibility = JavaVersion.VERSION_1_8
35-
}
36-
kotlinOptions {
37-
jvmTarget = "1.8"
41+
sourceCompatibility = JavaVersion.VERSION_22
42+
targetCompatibility = JavaVersion.VERSION_22
3843
}
3944
buildFeatures {
4045
compose = true
4146
}
42-
composeOptions {
43-
kotlinCompilerExtensionVersion = "1.5.0"
44-
}
4547
packaging {
4648
resources {
4749
excludes += "/META-INF/{AL2.0,LGPL2.1}"
@@ -59,12 +61,18 @@ dependencies {
5961
implementation(libs.ui.graphics)
6062
implementation(libs.ui.tooling.preview)
6163
implementation(libs.material3)
62-
implementation("org.jetbrains.kotlinx:kotlinx-collections-immutable:0.3.5")
64+
implementation(libs.kotlinx.collections.immutable)
6365
testImplementation(libs.junit)
6466
androidTestImplementation(libs.androidx.test.ext.junit)
6567
androidTestImplementation(libs.espresso.core)
6668
androidTestImplementation(platform(libs.compose.bom))
6769
androidTestImplementation(libs.ui.test.junit4)
6870
debugImplementation(libs.ui.tooling)
6971
debugImplementation(libs.ui.test.manifest)
72+
}
73+
74+
tasks.withType<KotlinCompile>().configureEach {
75+
compilerOptions {
76+
jvmTarget.set(JvmTarget.JVM_22)
77+
}
7078
}

androidresampler/build.gradle.kts

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,23 @@
11
@file:Suppress("UnstableApiUsage")
22

3-
import com.vanniktech.maven.publish.SonatypeHost
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
5+
46

57
plugins {
68
alias(libs.plugins.androidLibrary)
79
alias(libs.plugins.kotlinAndroid)
8-
id("com.vanniktech.maven.publish") version "0.25.3"
10+
alias(libs.plugins.mavenPublish)
911
}
1012

1113

1214
mavenPublishing {
13-
publishToMavenCentral(SonatypeHost.S01)
15+
publishToMavenCentral()
1416
signAllPublications()
1517
}
1618

1719
mavenPublishing {
18-
coordinates("io.github.nailik", "androidresampler", "0.2")
20+
coordinates("io.github.nailik", "androidresampler", "0.3")
1921

2022
pom {
2123
name.set("androidresampler")
@@ -46,12 +48,17 @@ mavenPublishing {
4648

4749
android {
4850
namespace = "io.github.nailik.androidresampler"
49-
compileSdk = 34
51+
compileSdk = 36
5052

5153
defaultConfig {
52-
minSdk = 1
54+
minSdk = 21
5355
aarMetadata {
54-
minCompileSdk = 1
56+
minCompileSdk = 21
57+
}
58+
externalNativeBuild {
59+
cmake {
60+
arguments += listOf("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON")
61+
}
5562
}
5663
}
5764
buildTypes {
@@ -64,16 +71,13 @@ android {
6471
}
6572
}
6673
compileOptions {
67-
sourceCompatibility = JavaVersion.VERSION_17
68-
targetCompatibility = JavaVersion.VERSION_17
69-
}
70-
kotlinOptions {
71-
jvmTarget = "17"
74+
sourceCompatibility = JavaVersion.VERSION_22
75+
targetCompatibility = JavaVersion.VERSION_22
7276
}
7377
externalNativeBuild {
7478
cmake {
7579
path = file("src/main/cpp/CMakeLists.txt")
76-
version = "3.22.1"
80+
version = "4.0.3"
7781
}
7882
}
7983
testFixtures {
@@ -85,4 +89,10 @@ android {
8589
withJavadocJar()
8690
}
8791
}
92+
}
93+
94+
tasks.withType<KotlinCompile>().configureEach {
95+
compilerOptions {
96+
jvmTarget.set(JvmTarget.JVM_22)
97+
}
8898
}

androidresampler/src/main/cpp/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
set(CMAKE_CXX_STANDARD 17)
88

99
# Sets the minimum CMake version required for this project.
10-
cmake_minimum_required(VERSION 3.22.1)
10+
cmake_minimum_required(VERSION 4.0.3)
1111

1212
# Declares the project name. The project name can be accessed via ${ PROJECT_NAME},
1313
# Since this is the top level CMakeLists.txt, the project name is also accessible

androidresampler/src/main/cpp/resampler/MultiChannelResampler.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void MultiChannelResampler::writeFrame(const float *frame) {
120120
}
121121

122122
float MultiChannelResampler::sinc(float radians) {
123-
if (abs(radians) < 1.0e-9) return 1.0f; // avoid divide by zero
123+
if (fabsf(radians) < 1.0e-9f) return 1.0f; // avoid divide by zero
124124
return sinf(radians) / radians; // Sinc function
125125
}
126126

androidresampler/src/main/cpp/resampler/README.md

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ To build it for use outside of Oboe:
1414

1515
1. Copy the "resampler" folder to a folder in your project that is in the include path.
1616
2. Add all of the \*.cpp files in the resampler folder to your project IDE or Makefile.
17-
3. In ResamplerDefinitions.h, define RESAMPLER_OUTER_NAMESPACE with your own project name.
18-
Alternatively, use -DRESAMPLER_OUTER_NAMESPACE=mynamespace when compiling to avoid modifying the
19-
resampler code.
17+
3. In ResamplerDefinitions.h, define RESAMPLER_OUTER_NAMESPACE with your own project name. Alternatively, use -DRESAMPLER_OUTER_NAMESPACE=mynamespace when compiling to avoid modifying the resampler code.
2018

2119
## Creating a Resampler
2220

@@ -25,8 +23,7 @@ Include the [main header](MultiChannelResampler.h) for the resampler.
2523
#include "resampler/MultiChannelResampler.h"
2624

2725
Here is an example of creating a stereo resampler that will convert from 44100 to 48000 Hz.
28-
Only do this once, when you open your stream. Then use the sample resampler to process multiple
29-
buffers.
26+
Only do this once, when you open your stream. Then use the sample resampler to process multiple buffers.
3027

3128
MultiChannelResampler *resampler = MultiChannelResampler::make(
3229
2, // channel count
@@ -35,37 +32,30 @@ buffers.
3532
MultiChannelResampler::Quality::Medium); // conversion quality
3633

3734
Possible values for quality include { Fastest, Low, Medium, High, Best }.
38-
Higher quality levels will sound better but consume more CPU because they have more taps in the
39-
filter.
35+
Higher quality levels will sound better but consume more CPU because they have more taps in the filter.
4036

4137
## Fractional Frame Counts
4238

4339
Note that the number of output frames generated for a given number of input frames can vary.
4440

45-
For example, suppose you are converting from 44100 Hz to 48000 Hz and using an input buffer with 960
46-
frames. If you calculate the number of output frames you get:
41+
For example, suppose you are converting from 44100 Hz to 48000 Hz and using an input buffer with 960 frames. If you calculate the number of output frames you get:
4742

4843
960.0 * 48000 / 44100 = 1044.897959...
4944

50-
You cannot generate a fractional number of frames. So the resampler will sometimes generate 1044
51-
frames and sometimes 1045 frames. On average it will generate 1044.897959 frames. The resampler
52-
stores the fraction internally and keeps track of when to consume or generate a frame.
45+
You cannot generate a fractional number of frames. So the resampler will sometimes generate 1044 frames and sometimes 1045 frames. On average it will generate 1044.897959 frames. The resampler stores the fraction internally and keeps track of when to consume or generate a frame.
5346

54-
You can either use a fixed number of input frames or a fixed number of output frames. The other
55-
frame count will vary.
47+
You can either use a fixed number of input frames or a fixed number of output frames. The other frame count will vary.
5648

5749
## Calling the Resampler with a fixed number of OUTPUT frames
5850

59-
In this example, suppose we have a fixed number of output frames and a variable number of input
60-
frames.
51+
In this example, suppose we have a fixed number of output frames and a variable number of input frames.
6152

6253
Assume you start with these variables and a method that returns the next input frame:
6354

6455
float *outputBuffer; // multi-channel buffer to be filled
6556
int numOutputFrames; // number of frames of output
6657

67-
The resampler has a method isWriteNeeded() that tells you whether to write to or read from the
68-
resampler.
58+
The resampler has a method isWriteNeeded() that tells you whether to write to or read from the resampler.
6959

7060
int outputFramesLeft = numOutputFrames;
7161
while (outputFramesLeft > 0) {
@@ -81,8 +71,7 @@ resampler.
8171

8272
## Calling the Resampler with a fixed number of INPUT frames
8373

84-
In this example, suppose we have a fixed number of input frames and a variable number of output
85-
frames.
74+
In this example, suppose we have a fixed number of input frames and a variable number of output frames.
8675

8776
Assume you start with these variables:
8877

gradle/libs.versions.toml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
[versions]
2-
activity-compose = "1.7.2"
3-
agp = "8.1.0"
4-
kotlin = "1.9.0"
5-
core-ktx = "1.10.1"
2+
activity-compose = "1.10.1"
3+
agp = "8.12.0"
4+
kotlin = "2.2.0"
5+
core-ktx = "1.16.0"
66
junit = "4.13.2"
7-
androidx-test-ext-junit = "1.1.5"
8-
espresso-core = "3.5.1"
9-
ui = "1.4.3"
10-
lifecycle-runtime-ktx = "2.6.1"
11-
compose-bom = "2023.06.01"
7+
androidx-test-ext-junit = "1.3.0"
8+
espresso-core = "3.7.0"
9+
kotlinx-collections-immutable = "0.4.0"
10+
ui = "1.8.3"
11+
lifecycle-runtime-ktx = "2.9.2"
12+
compose-bom = "2025.07.00"
13+
maven-publish = "0.34.0"
1214

1315
[libraries]
1416
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "activity-compose" }
@@ -17,6 +19,7 @@ core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx
1719
junit = { group = "junit", name = "junit", version.ref = "junit" }
1820
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidx-test-ext-junit" }
1921
espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espresso-core" }
22+
kotlinx-collections-immutable = { module = "org.jetbrains.kotlinx:kotlinx-collections-immutable", version.ref = "kotlinx-collections-immutable" }
2023
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle-runtime-ktx" }
2124
compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "compose-bom" }
2225
ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
@@ -30,4 +33,6 @@ material3 = { group = "androidx.compose.material3", name = "material3" }
3033
androidApplication = { id = "com.android.application", version.ref = "agp" }
3134
androidLibrary = { id = "com.android.library", version.ref = "agp" }
3235
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
36+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
37+
mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "maven-publish" }
3338

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#Thu Jul 20 13:01:25 CEST 2023
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-9.0-milestone-1-bin.zip
55
zipStoreBase=GRADLE_USER_HOME
66
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)