Skip to content

Commit 0c65b17

Browse files
committed
Add jitpack support
1 parent 46df86e commit 0c65b17

File tree

3 files changed

+41
-17
lines changed

3 files changed

+41
-17
lines changed

android-wave-recorder/build.gradle

+23-1
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
apply plugin: 'com.android.library'
22
apply plugin: 'kotlin-android'
3+
apply plugin: 'maven-publish'
4+
35
android {
46
namespace 'com.github.squti.androidwaverecorder'
57
defaultConfig {
6-
compileSdk 33
8+
compileSdk 34
79
minSdkVersion 16
810
targetSdkVersion 33
911

@@ -24,6 +26,12 @@ android {
2426
kotlinOptions {
2527
jvmTarget = JavaVersion.VERSION_17
2628
}
29+
publishing {
30+
singleVariant("release") {
31+
withSourcesJar()
32+
withJavadocJar()
33+
}
34+
}
2735
}
2836

2937
dependencies {
@@ -38,3 +46,17 @@ dependencies {
3846
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3'
3947
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.7.3'
4048
}
49+
50+
publishing {
51+
publications {
52+
release(MavenPublication) {
53+
groupId = 'com.github.shiftstudio'
54+
artifactId = 'waverecorder'
55+
version = '1.0.0'
56+
57+
afterEvaluate {
58+
from components.release
59+
}
60+
}
61+
}
62+
}

android-wave-recorder/src/main/java/com/github/squti/androidwaverecorder/WaveHeaderWriter.kt

+16-16
Original file line numberDiff line numberDiff line change
@@ -66,22 +66,22 @@ internal class WaveHeaderWriter(
6666
channels: Int, byteRate: Long, bitsPerSample: Int
6767
): ByteArray {
6868
val header = ByteArray(44)
69-
header[0] = 'R'.toByte()
70-
header[1] = 'I'.toByte()
71-
header[2] = 'F'.toByte()
72-
header[3] = 'F'.toByte()
69+
header[0] = 'R'.code.toByte()
70+
header[1] = 'I'.code.toByte()
71+
header[2] = 'F'.code.toByte()
72+
header[3] = 'F'.code.toByte()
7373
header[4] = (totalDataLen and 0xff).toByte()
7474
header[5] = (totalDataLen shr 8 and 0xff).toByte()
7575
header[6] = (totalDataLen shr 16 and 0xff).toByte()
7676
header[7] = (totalDataLen shr 24 and 0xff).toByte()
77-
header[8] = 'W'.toByte()
78-
header[9] = 'A'.toByte()
79-
header[10] = 'V'.toByte()
80-
header[11] = 'E'.toByte()
81-
header[12] = 'f'.toByte()
82-
header[13] = 'm'.toByte()
83-
header[14] = 't'.toByte()
84-
header[15] = ' '.toByte()
77+
header[8] = 'W'.code.toByte()
78+
header[9] = 'A'.code.toByte()
79+
header[10] = 'V'.code.toByte()
80+
header[11] = 'E'.code.toByte()
81+
header[12] = 'f'.code.toByte()
82+
header[13] = 'm'.code.toByte()
83+
header[14] = 't'.code.toByte()
84+
header[15] = ' '.code.toByte()
8585
header[16] = 16
8686
header[17] = 0
8787
header[18] = 0
@@ -102,10 +102,10 @@ internal class WaveHeaderWriter(
102102
header[33] = 0
103103
header[34] = bitsPerSample.toByte()
104104
header[35] = 0
105-
header[36] = 'd'.toByte()
106-
header[37] = 'a'.toByte()
107-
header[38] = 't'.toByte()
108-
header[39] = 'a'.toByte()
105+
header[36] = 'd'.code.toByte()
106+
header[37] = 'a'.code.toByte()
107+
header[38] = 't'.code.toByte()
108+
header[39] = 'a'.code.toByte()
109109
header[40] = (totalAudioLen and 0xff).toByte()
110110
header[41] = (totalAudioLen shr 8 and 0xff).toByte()
111111
header[42] = (totalAudioLen shr 16 and 0xff).toByte()

jitpack.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
jdk:
2+
- openjdk17

0 commit comments

Comments
 (0)