Skip to content
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
7124afd
Update gradle 8.2 => 8.11.1
dzmpr Nov 24, 2024
75ff0ad
Remove redundant .gitignore's; use recommended rules from github
dzmpr Nov 29, 2024
129360a
Remove empty consumer rule files
dzmpr Nov 29, 2024
f3f10c2
Remove app compat dependency as only theme were used from it
dzmpr Nov 30, 2024
88e345c
Update project dependencies; simplify build configuration; move confi…
dzmpr Dec 1, 2024
7d7450f
Update yarn.lock; fix js sample
dzmpr Dec 1, 2024
95db997
Use implementation instead of compileOnly for compose dependencies
dzmpr Dec 1, 2024
4f5bf41
Remove uuid dependency and use kotlin stdlib implementation
dzmpr Dec 1, 2024
a05ce49
Replace deprecated API's in samples
dzmpr Dec 1, 2024
4f66d4c
Minor warning fixes
dzmpr Dec 1, 2024
cd60348
Rename common jvm group from jvm to commonJvm to make it non ambiguous
dzmpr Dec 27, 2024
664917d
Disable androidResources in library modules
dzmpr May 2, 2025
4bd3336
Remove package from AndroidManifest
dzmpr May 2, 2025
2a768f1
Update dependencies
dzmpr May 18, 2025
a2fe0f7
Replace deprecated LifecycleEffect
dzmpr May 19, 2025
db76d3f
Merge branch 'main' into dependencies_update
dzmpr May 20, 2025
75b7ec7
Remove unused repositories
dzmpr May 21, 2025
b4223d7
Update .gitignore
dzmpr May 21, 2025
6de76c2
Remove comment
dzmpr May 21, 2025
a4efe74
Get ktlint version from version catalog
dzmpr May 23, 2025
86a66e1
Update dependencies
dzmpr May 23, 2025
1a92029
Rename samples catalog
dzmpr May 23, 2025
72e2a9b
Rename jvm module convention plugin
dzmpr May 23, 2025
97bf62e
Fixing crash causes in older versions because of removeFirst and remo…
DevSrSouza Jun 3, 2025
910a76b
Bump JVM Target to 11 because of Compose requirements, fix Thread Saf…
DevSrSouza Jun 3, 2025
8c3141d
Fixing lint issues
DevSrSouza Jun 3, 2025
7d3866b
Update jvm target for samples
dzmpr Jun 14, 2025
1bd3f50
Update dependencies
dzmpr Jun 14, 2025
0738d86
Update voyager API dump
dzmpr Jun 14, 2025
6198a48
Update dependencies; change publishing host to central portal
dzmpr Jul 2, 2025
85e9663
Update API dump
dzmpr Jul 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 62 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,63 @@
/.idea
/local.properties
/build
/captures
.DS_Store
.externalNativeBuild
.gradle
# Dropbox focus plugin
*.focus

# https://github.com/github/gitignore/blob/main/Android.gitignore
# Gradle files
.gradle/
build/

# Local configuration file (sdk path, etc)
local.properties

# Log/OS Files
*.log

# Android Studio generated files and folders
captures/
.externalNativeBuild/
.cxx/
*.apk
output.json

# IntelliJ
*.iml
*.focus
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.focus files are generated by dropbox plugin.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the dropbox plugin, voyager project is a small project for using the plugin honestly.

.idea/
misc.xml
deploymentTargetDropDown.xml
render.experimental.xml

# Keystore files
*.jks
*.keystore

# Google Services (e.g. APIs or Firebase)
google-services.json

# Android Profiling
*.hprof

# https://github.com/github/gitignore/blob/main/Kotlin.gitignore
# Kotlin data directory
.kotlin/

# Compiled class file
*.class

# BlueJ files
*.ctxt

# Mobile Tools for Java (J2ME)
.mtj.tmp/

# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
replay_pid*
10 changes: 10 additions & 0 deletions build-config/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
plugins {
`kotlin-dsl`
}

dependencies {
compileOnly(libs.pluginartifact.android)
compileOnly(libs.pluginartifact.kotlin)
compileOnly(libs.pluginartifact.ktlint)
compileOnly(libs.pluginartifact.mavenPublish)
}
15 changes: 15 additions & 0 deletions build-config/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
rootProject.name = "build-config"

dependencyResolutionManagement {
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
repositories {
mavenCentral()
google()
gradlePluginPortal()
}
versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import com.android.build.gradle.BaseExtension
import extensions.isAndroidApplicationModule
import extensions.isAndroidLibraryModule
import extensions.isMultiplatformModule

configure<BaseExtension> {
compileSdkVersion(36)
defaultConfig {
minSdk = 21

if (isAndroidApplicationModule()) {
targetSdk = 36
versionCode = 1
versionName = "1.0"
}

if (isAndroidLibraryModule()) {
val proguardFilename = "consumer-rules.pro"
if (layout.projectDirectory.file(proguardFilename).asFile.exists()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need check if exists. AGP ignores the file whether it doesn't exist.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AGP will print that certain proguard files not found:

Supplied consumer proguard configuration does not exist: /Users/dzmitry/AndroidStudioProjects/voyager/voyager-bottom-sheet-navigator/consumer-rules.pro

If you ok with this I remove an if clause.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed the empty files. That is the reason to complain about missing it.
Is there any advantage to remove the files instead of putting the check for them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion a project has less clutter when it doesn't have files that don't affect anything.

consumerProguardFile(proguardFilename)
}
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

testOptions {
unitTests.all(Test::useJUnitPlatform)
}

if (isMultiplatformModule()) {
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension

configure<KotlinProjectExtension> {
explicitApi()
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import extensions.kotlinAndroid
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

kotlinAndroid {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import extensions.kotlinMultiplatform
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget

@OptIn(ExperimentalKotlinGradlePluginApi::class)
kotlinMultiplatform {
applyDefaultHierarchyTemplate {
common {
group("commonJvm") {
withCompilations {
it.target.targetName == "desktop" || it.target is KotlinAndroidTarget
}
}
group("nonAndroid") {
withCompilations {
it.target.targetName == "desktop"
}
}
}
}

androidTarget {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
jvm("desktop") {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import extensions.kotlinMultiplatform
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget

@OptIn(ExperimentalKotlinGradlePluginApi::class)
kotlinMultiplatform {
applyDefaultHierarchyTemplate {
common {
group("commonJvm") {
withCompilations {
it.target.targetName == "desktop" || it.target is KotlinAndroidTarget
}
}
group("nonAndroid") {
withJs()
withNative()
withWasmJs()
withCompilations {
it.target.targetName == "desktop"
}
}
group("commonWeb") {
withJs()
withWasmJs()
}
}
}

js(IR) {
browser()
}
@OptIn(ExperimentalWasmDsl::class)
wasmJs {
browser()
}

androidTarget {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
jvm("desktop") {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}

macosX64()
macosArm64()

iosArm64()
iosX64()
iosSimulatorArm64()

compilerOptions {
freeCompilerArgs.add("-Xexpect-actual-classes")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.jlleitschuh.gradle.ktlint.KtlintExtension

plugins.apply("org.jlleitschuh.gradle.ktlint")

configure<KtlintExtension> {
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")

version = libs.findVersion("ktlint").get().toString()
disabledRules = setOf("filename")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension

configure<KotlinProjectExtension> {
sourceSets.all {
languageSettings {
optIn("cafe.adriel.voyager.core.annotation.InternalVoyagerApi")
optIn("cafe.adriel.voyager.core.annotation.ExperimentalVoyagerApi")
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import com.vanniktech.maven.publish.MavenPublishBaseExtension
import com.vanniktech.maven.publish.SonatypeHost
import extensions.isMultiplatformModule
import extensions.kotlinMultiplatform

pluginManager.apply("com.vanniktech.maven.publish")

if (isMultiplatformModule()) {
kotlinMultiplatform {
androidTarget {
publishLibraryVariants("release")
}
}
}

group = "cafe.adriel.voyager"

configure<MavenPublishBaseExtension> {
publishToMavenCentral(host = SonatypeHost.S01, automaticRelease = true)
signAllPublications()

pom {
description = "A pragmatic navigation library for Jetpack Compose"
inceptionYear = "2021"
url = "https://github.com/adrielcafe/voyager"

licenses {
license {
name = "The MIT License"
url = "https://opensource.org/licenses/MIT"
distribution = "repo"
}
}

scm {
url = "https://github.com/adrielcafe/voyager"
connection = "scm:git:ssh://git@github.com/adrielcafe/voyager.git"
developerConnection = "scm:git:ssh://git@github.com/adrielcafe/voyager.git"
}

developers {
developer {
id = "adrielcafe"
name = "Adriel Cafe"
url = "https://github.com/adrielcafe/"
}
}
}
}
Comment on lines +21 to +48
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this was required? why not keep it on gradle.properties?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think explicit configuration is better than implicit

20 changes: 20 additions & 0 deletions build-config/src/main/kotlin/extensions/ProjectExtensions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package extensions

import org.gradle.api.Project
import org.gradle.kotlin.dsl.configure
import org.jetbrains.kotlin.gradle.dsl.KotlinAndroidExtension
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension

fun Project.hasPlugin(id: String) = plugins.hasPlugin(id)

fun Project.isAndroidLibraryModule(): Boolean = hasPlugin("com.android.library")

fun Project.isAndroidApplicationModule(): Boolean = hasPlugin("com.android.application")

fun Project.isMultiplatformModule() = hasPlugin("org.jetbrains.kotlin.multiplatform")

fun Project.kotlinMultiplatform(block: KotlinMultiplatformExtension.() -> Unit) =
extensions.configure<KotlinMultiplatformExtension>(block)

fun Project.kotlinAndroid(block: KotlinAndroidExtension.() -> Unit) =
extensions.configure<KotlinAndroidExtension>(block)
11 changes: 11 additions & 0 deletions build-config/src/main/kotlin/extensions/StringExtensions.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package extensions

import java.util.Locale

fun String.capitalize(): String = replaceFirstChar { firstChar ->
if (firstChar.isLowerCase()) {
firstChar.titlecase(Locale.getDefault())
} else {
toString()
}
}
14 changes: 14 additions & 0 deletions build-config/src/main/kotlin/samples-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("configure-android")
id("configure-opt-in")
id("configure-ktlint")
}

tasks.withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id("voyager-base-module")
id("configure-kotlin-android")
}
7 changes: 7 additions & 0 deletions build-config/src/main/kotlin/voyager-base-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id("configure-android")
id("configure-opt-in")
id("configure-explicit-api")
id("configure-publishing")
id("configure-ktlint")
}
4 changes: 4 additions & 0 deletions build-config/src/main/kotlin/voyager-jvm-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id("voyager-base-module")
id("configure-kotlin-jvm")
}
4 changes: 4 additions & 0 deletions build-config/src/main/kotlin/voyager-kmp-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
plugins {
id("voyager-base-module")
id("configure-kotlin-multiplatform")
}
Loading
Loading