Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
simonnorberg committed Mar 28, 2024
1 parent 70c0fe8 commit 8cc5a7c
Show file tree
Hide file tree
Showing 15 changed files with 105 additions and 75 deletions.
15 changes: 15 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.{kt,kts}]
ktlint_code_style = android_studio
max_line_length = 120
ktlint_function_naming_ignore_when_annotated_with = Composable
ktlint_standard_function-signature = disabled
10 changes: 6 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: Android CI

on: [push]
on: [ push ]

jobs:
build:
runs-on: ubuntu-latest
if: github.repository == 'simonnorberg/kortholt'
timeout-minutes: 30
env:
TERM: dumb
Expand All @@ -15,10 +16,11 @@ jobs:
ORG_GRADLE_PROJECT_SIGNING_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PASSWORD }}

steps:
- uses: actions/checkout@v3
- name: Checkout
uses: actions/checkout@v4.1.1

- name: Set up JDK
uses: actions/setup-java@v3
uses: actions/setup-java@v4.2.1
with:
distribution: 'zulu'
java-version: 17
Expand All @@ -27,7 +29,7 @@ jobs:
run: git submodule update --init --recursive

- name: Build and publish
run: ./gradlew publishToMavenLocal
run: ./gradlew ktlintCheck lintDebug publishToMavenLocal

- name: Upload release
if: startsWith(github.ref, 'refs/heads/develop')
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ See [Sample](https://github.com/simonnorberg/kortholt/tree/main/sample) for deta

## Download

```groovy
```kotlin
repositories {
mavenCentral()
}
dependencies {
implementation "net.simno.kortholt:kortholt:3.0.0"
implementation("net.simno.kortholt:kortholt:3.1.0")
}
```

Expand Down
33 changes: 16 additions & 17 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
import com.diffplug.gradle.spotless.SpotlessExtension
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

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.spotless) apply false
alias(libs.plugins.publishPlugin)
alias(libs.plugins.dependencyUpdates)
alias(libs.plugins.ktlint.gradle)
alias(libs.plugins.publish.plugin)
alias(libs.plugins.gradle.versions)
}

allprojects {
plugins.withType<JavaBasePlugin>().configureEach {
extensions.configure<JavaPluginExtension> {
toolchain {
languageVersion.set(
JavaLanguageVersion.of(rootProject.libs.versions.javaVersion.get().toInt())
)
}
}
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
allWarningsAsErrors = true
}
}
apply(plugin = rootProject.libs.plugins.spotless.get().pluginId)
configure<SpotlessExtension> {
kotlin {
target("**/*.kt")
targetExclude("**/cpp/**/*.kt")
ktlint(libs.versions.ktlint.get()).editorConfigOverride(
mapOf(
"ktlint_code_style" to "android_studio",
"max_line_length" to 120
)
)
}
apply(plugin = rootProject.libs.plugins.ktlint.gradle.get().pluginId)
ktlint {
version.set(rootProject.libs.versions.ktlint.asProvider())
android.set(true)
}
}

Expand Down
3 changes: 3 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
org.gradle.parallel=true

org.gradle.configureondemand=true
org.gradle.caching=true

# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
Expand Down
45 changes: 27 additions & 18 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,38 @@
[versions]
agp = "8.1.0"
compileSdk = "33"
agp = "8.3.1"
compileSdk = "34"
minSdk = "28"
targetSdk = "33"
ndk = "25.2.9519653"
androidx-activity = "1.7.2"
androidx-annotation = "1.6.0"
androidx-core = "1.10.1"
androidx-lifecycle = "2.6.1"
androidx-media = "1.6.0"
compose-bom = "2023.06.01"
compose-compiler = "1.5.1"
compose-lint = "1.2.0"
coroutines = "1.7.3"
kotlin = "1.9.0"
ktlint = "0.50.0"
targetSdk = "34"
ndk = "26.2.11394342"
androidx-activity = "1.8.2"
androidx-annotation = "1.7.1"
androidx-core = "1.12.0"
androidx-lifecycle = "2.7.0"
androidx-media = "1.7.0"
cachefix = "3.0.1"
compose-bom = "2024.03.00"
compose-compiler = "1.5.11"
compose-lint = "1.3.1"
coroutines = "1.8.0"
gradle-versions = "0.51.0"
javaVersion = "17"
kotlin = "1.9.23"
ktlint = "1.2.1"
ktlint-compose = "0.3.12"
ktlint-gradle = "12.1.0"
publish-plugin = "1.3.0"
relinker = "1.4.5"
spotless = "6.25.0"
zip4j = "2.11.5"

[plugins]
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" }
spotless = { id = "com.diffplug.spotless", version = "6.20.0" }
dependencyUpdates = { id = "com.github.ben-manes.versions", version = "0.47.0" }
publishPlugin = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" }
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" }
publish-plugin = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "publish-plugin" }

[libraries]
androidx-activity = { module = "androidx.activity:activity-compose", version.ref = "androidx-activity" }
Expand All @@ -36,5 +44,6 @@ compose-bom = { module = "androidx.compose:compose-bom", version.ref = "compose-
compose-material = { module = "androidx.compose.material3:material3" }
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" }
relinker = { module = "com.getkeepsafe.relinker:relinker", version.ref = "relinker" }
zip4j = { module = "net.lingala.zip4j:zip4j", version.ref = "zip4j" }
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.2.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
17 changes: 9 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# 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

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -201,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
9 changes: 3 additions & 6 deletions lib/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.android.library)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.cachefix)
id("maven-publish")
id("signing")
}
Expand All @@ -24,10 +25,6 @@ android {
path("src/main/cpp/CMakeLists.txt")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
packaging {
resources.excludes += "/META-INF/{AL2.0,LGPL2.1}"
}
Expand Down Expand Up @@ -59,7 +56,7 @@ dependencies {
val siteUrl = "https://github.com/simonnorberg/kortholt"
val gitUrl = "https://github.com/simonnorberg/kortholt.git"

version = "3.0.0"
version = "3.1.0"
group = "net.simno.kortholt"

afterEvaluate {
Expand All @@ -69,7 +66,7 @@ afterEvaluate {
from(components["release"])
groupId = "net.simno.kortholt"
artifactId = "kortholt"
version = "3.0.0"
version = "3.1.0"
pom {
name.set("kortholt")
url.set(siteUrl)
Expand Down
2 changes: 1 addition & 1 deletion lib/src/main/cpp/oboe
Submodule oboe updated 112 files
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.0.0"
private const val VERSION = "3.1.0"
}
}
7 changes: 3 additions & 4 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.cachefix)
}

android {
Expand All @@ -13,10 +14,6 @@ android {
versionCode = 1
versionName = "1.0"
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
buildFeatures {
buildConfig = true
compose = true
Expand All @@ -30,6 +27,7 @@ android {
lint {
warningsAsErrors = true
abortOnError = true
disable += "ObsoleteLintCustomCheck"
}
}

Expand All @@ -42,4 +40,5 @@ dependencies {
implementation(platform(libs.compose.bom))
implementation(libs.compose.material)
lintChecks(libs.compose.lint)
ktlintRuleset(libs.ktlint.compose)
}
11 changes: 8 additions & 3 deletions sample/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />

<application
android:name=".SampleApp"
android:allowBackup="true"
android:enableOnBackInvokedCallback="true"
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"
tools:targetApi="tiramisu">
<activity
android:name=".SampleActivity"
android:exported="true"
Expand All @@ -22,7 +26,8 @@
</activity>
<service
android:name=".SampleService"
android:exported="false" />
android:exported="false"
android:foregroundServiceType="mediaPlayback" />
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}"
Expand Down

0 comments on commit 8cc5a7c

Please sign in to comment.