Skip to content

Commit 670dddc

Browse files
dzmprDevSrSouza
andauthored
Update project build configuration and dependencies (#514)
* Update gradle 8.2 => 8.11.1 * Remove redundant .gitignore's; use recommended rules from github * Remove empty consumer rule files * Remove app compat dependency as only theme were used from it * Update project dependencies; simplify build configuration; move configuration logic to convention plugins * Update yarn.lock; fix js sample * Use implementation instead of compileOnly for compose dependencies * Remove uuid dependency and use kotlin stdlib implementation * Replace deprecated API's in samples * Minor warning fixes * Rename common jvm group from jvm to commonJvm to make it non ambiguous * Disable androidResources in library modules * Remove package from AndroidManifest * Update dependencies * Replace deprecated LifecycleEffect * Remove unused repositories * Update .gitignore * Remove comment * Get ktlint version from version catalog * Update dependencies * Rename samples catalog * Rename jvm module convention plugin * Fixing crash causes in older versions because of removeFirst and removeLast * Bump JVM Target to 11 because of Compose requirements, fix Thread Safe collections compilation, fix Lifecycle KMP * Fixing lint issues * Update jvm target for samples * Update dependencies * Update voyager API dump * Update dependencies; change publishing host to central portal * Update API dump --------- Co-authored-by: Gabriel Souza <devsrsouza@gmail.com>
1 parent 962f5d8 commit 670dddc

File tree

156 files changed

+1484
-1309
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

156 files changed

+1484
-1309
lines changed

.gitignore

Lines changed: 62 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,63 @@
1-
/.idea
2-
/local.properties
3-
/build
4-
/captures
5-
.DS_Store
6-
.externalNativeBuild
7-
.gradle
1+
# Dropbox focus plugin
2+
*.focus
3+
4+
# https://github.com/github/gitignore/blob/main/Android.gitignore
5+
# Gradle files
6+
.gradle/
7+
build/
8+
9+
# Local configuration file (sdk path, etc)
10+
local.properties
11+
12+
# Log/OS Files
13+
*.log
14+
15+
# Android Studio generated files and folders
16+
captures/
17+
.externalNativeBuild/
18+
.cxx/
19+
*.apk
20+
output.json
21+
22+
# IntelliJ
823
*.iml
9-
*.focus
24+
.idea/
25+
misc.xml
26+
deploymentTargetDropDown.xml
27+
render.experimental.xml
28+
29+
# Keystore files
30+
*.jks
31+
*.keystore
32+
33+
# Google Services (e.g. APIs or Firebase)
34+
google-services.json
35+
36+
# Android Profiling
37+
*.hprof
38+
39+
# https://github.com/github/gitignore/blob/main/Kotlin.gitignore
40+
# Kotlin data directory
41+
.kotlin/
42+
43+
# Compiled class file
44+
*.class
45+
46+
# BlueJ files
47+
*.ctxt
48+
49+
# Mobile Tools for Java (J2ME)
50+
.mtj.tmp/
51+
52+
# Package Files #
53+
*.jar
54+
*.war
55+
*.nar
56+
*.ear
57+
*.zip
58+
*.tar.gz
59+
*.rar
60+
61+
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
62+
hs_err_pid*
63+
replay_pid*

build-config/build.gradle.kts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
plugins {
2+
`kotlin-dsl`
3+
}
4+
5+
dependencies {
6+
compileOnly(libs.pluginartifact.android)
7+
compileOnly(libs.pluginartifact.kotlin)
8+
compileOnly(libs.pluginartifact.ktlint)
9+
compileOnly(libs.pluginartifact.mavenPublish)
10+
}

build-config/settings.gradle.kts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
rootProject.name = "build-config"
2+
3+
dependencyResolutionManagement {
4+
repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS
5+
repositories {
6+
mavenCentral()
7+
google()
8+
gradlePluginPortal()
9+
}
10+
versionCatalogs {
11+
create("libs") {
12+
from(files("../gradle/libs.versions.toml"))
13+
}
14+
}
15+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import com.android.build.gradle.BaseExtension
2+
import extensions.isAndroidApplicationModule
3+
import extensions.isAndroidLibraryModule
4+
import extensions.isMultiplatformModule
5+
6+
configure<BaseExtension> {
7+
compileSdkVersion(36)
8+
defaultConfig {
9+
minSdk = 21
10+
11+
if (isAndroidApplicationModule()) {
12+
targetSdk = 36
13+
versionCode = 1
14+
versionName = "1.0"
15+
}
16+
17+
if (isAndroidLibraryModule()) {
18+
val proguardFilename = "consumer-rules.pro"
19+
if (layout.projectDirectory.file(proguardFilename).asFile.exists()) {
20+
consumerProguardFile(proguardFilename)
21+
}
22+
}
23+
}
24+
25+
compileOptions {
26+
sourceCompatibility = JavaVersion.VERSION_11
27+
targetCompatibility = JavaVersion.VERSION_11
28+
}
29+
30+
testOptions {
31+
unitTests.all(Test::useJUnitPlatform)
32+
}
33+
34+
if (isMultiplatformModule()) {
35+
sourceSets["main"].manifest.srcFile("src/androidMain/AndroidManifest.xml")
36+
}
37+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
2+
3+
configure<KotlinProjectExtension> {
4+
explicitApi()
5+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import extensions.kotlinAndroid
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
4+
kotlinAndroid {
5+
compilerOptions {
6+
jvmTarget = JvmTarget.JVM_11
7+
}
8+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import extensions.kotlinMultiplatform
2+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
4+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget
5+
6+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
7+
kotlinMultiplatform {
8+
applyDefaultHierarchyTemplate {
9+
common {
10+
group("commonJvm") {
11+
withCompilations {
12+
it.target.targetName == "desktop" || it.target is KotlinAndroidTarget
13+
}
14+
}
15+
group("nonAndroid") {
16+
withCompilations {
17+
it.target.targetName == "desktop"
18+
}
19+
}
20+
}
21+
}
22+
23+
androidTarget {
24+
compilerOptions {
25+
jvmTarget = JvmTarget.JVM_11
26+
}
27+
}
28+
jvm("desktop") {
29+
compilerOptions {
30+
jvmTarget = JvmTarget.JVM_11
31+
}
32+
}
33+
}
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import extensions.kotlinMultiplatform
2+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3+
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
4+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
5+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinAndroidTarget
6+
7+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
8+
kotlinMultiplatform {
9+
applyDefaultHierarchyTemplate {
10+
common {
11+
group("commonJvm") {
12+
withCompilations {
13+
it.target.targetName == "desktop" || it.target is KotlinAndroidTarget
14+
}
15+
}
16+
group("nonAndroid") {
17+
withJs()
18+
withNative()
19+
withWasmJs()
20+
withCompilations {
21+
it.target.targetName == "desktop"
22+
}
23+
}
24+
group("commonWeb") {
25+
withJs()
26+
withWasmJs()
27+
}
28+
}
29+
}
30+
31+
js(IR) {
32+
browser()
33+
}
34+
@OptIn(ExperimentalWasmDsl::class)
35+
wasmJs {
36+
browser()
37+
}
38+
39+
androidTarget {
40+
compilerOptions {
41+
jvmTarget = JvmTarget.JVM_11
42+
}
43+
}
44+
jvm("desktop") {
45+
compilerOptions {
46+
jvmTarget = JvmTarget.JVM_11
47+
}
48+
}
49+
50+
macosX64()
51+
macosArm64()
52+
53+
iosArm64()
54+
iosX64()
55+
iosSimulatorArm64()
56+
57+
compilerOptions {
58+
freeCompilerArgs.add("-Xexpect-actual-classes")
59+
}
60+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import org.jlleitschuh.gradle.ktlint.KtlintExtension
2+
3+
plugins.apply("org.jlleitschuh.gradle.ktlint")
4+
5+
configure<KtlintExtension> {
6+
val libs = extensions.getByType<VersionCatalogsExtension>().named("libs")
7+
8+
version = libs.findVersion("ktlint").get().toString()
9+
disabledRules = setOf("filename")
10+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension
2+
3+
configure<KotlinProjectExtension> {
4+
sourceSets.all {
5+
languageSettings {
6+
optIn("cafe.adriel.voyager.core.annotation.InternalVoyagerApi")
7+
optIn("cafe.adriel.voyager.core.annotation.ExperimentalVoyagerApi")
8+
}
9+
}
10+
}

0 commit comments

Comments
 (0)