Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
7 changes: 0 additions & 7 deletions .idea/runConfigurations/iosApp.xml

This file was deleted.

1 change: 1 addition & 0 deletions androidApp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
45 changes: 45 additions & 0 deletions androidApp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
}

android {
namespace = "com.sebastianneubauer.jsontreesample"
compileSdk = 36

defaultConfig {
applicationId = "com.sebastianneubauer.jsontreesample"
minSdk = 23
targetSdk = 36

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
// for testing only, don't do this in your app
signingConfig = signingConfigs.getByName("debug")
}

getByName("debug") {
applicationIdSuffix = ".debug"
signingConfig = signingConfigs.getByName("debug")
}
}
buildFeatures {
compose = true
}
}

dependencies {
implementation(project(":sample"))
implementation(libs.androidx.activity.compose)
implementation(libs.jb.compose.components.resources)
}
21 changes: 21 additions & 0 deletions androidApp/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class MainActivity : ComponentActivity() {
enableEdgeToEdge()
setContent { App() }
}
}
}
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ buildscript {

plugins {
alias(libs.plugins.android.application).apply(false)
alias(libs.plugins.android.library).apply(false)
alias(libs.plugins.kotlinMultiplatform).apply(false)
alias(libs.plugins.compose).apply(false)
alias(libs.plugins.compose.compiler).apply(false)
alias(libs.plugins.publish).apply(false)
alias(libs.plugins.api.validator)
alias(libs.plugins.detekt)
alias(libs.plugins.androidKotlinMultiplatformLibrary) apply false
}

apiValidation {
Expand Down
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ java-toolchain = "17"

compose = "1.10.3"
compose-material3 = "1.9.0"
agp = "8.13.2"
agp = "9.1.1"
kotlin = "2.3.20"
publish = "0.36.0"
api-validator = "0.18.1"
Expand Down Expand Up @@ -40,9 +40,9 @@ kotlindiff = { module = "io.github.petertrr:kotlin-multiplatform-diff", version.
detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting", version.ref = "detekt" }

[plugins]
android-library = { id = "com.android.library", version.ref = "agp" }
android-application = { id = "com.android.application", version.ref = "agp" }
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
androidKotlinMultiplatformLibrary = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" }
compose = { id = "org.jetbrains.compose", version.ref = "compose" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
publish = { id = "com.vanniktech.maven.publish", version.ref = "publish" }
Expand Down
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-9.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
46 changes: 13 additions & 33 deletions jsontree/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree

plugins {
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.android.library)
alias(libs.plugins.androidKotlinMultiplatformLibrary)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
alias(libs.plugins.publish)
}

kotlin {
jvm()
androidTarget {
publishLibraryVariants("release")
@OptIn(ExperimentalKotlinGradlePluginApi::class)
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
android {
namespace = "com.sebastianneubauer.jsontree"
compileSdk = libs.versions.android.compileSdk.get().toInt()
minSdk = libs.versions.android.minSdk.get().toInt()
aarMetadata {
minCompileSdk = libs.versions.android.minSdk.get().toInt()
}

androidResources.enable = true
}

jvm()

iosX64()
iosArm64()
iosSimulatorArm64()
Expand Down Expand Up @@ -74,31 +81,4 @@ kotlin {
implementation(compose.desktop.currentOs)
}
}
}

dependencies {
implementation(libs.kotlinx.coroutines.test)
androidTestImplementation(libs.androidx.compose.ui.test.android)
debugImplementation(libs.androidx.compose.ui.test.manifest)
}

android {
namespace = "com.sebastianneubauer.jsontree"
compileSdk = libs.versions.android.compileSdk.get().toInt()
buildFeatures {
buildConfig = false
compose = true
}
defaultConfig {
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
minSdk = libs.versions.android.minSdk.get().toInt()
aarMetadata {
minCompileSdk = libs.versions.android.minSdk.get().toInt()
}
}

// fixes lint error in release builds for compose 1.9.3
lint {
disable.add("NullSafeMutableLiveData")
}
}
51 changes: 9 additions & 42 deletions sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl

plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlinMultiplatform)
alias(libs.plugins.androidKotlinMultiplatformLibrary)
alias(libs.plugins.compose)
alias(libs.plugins.compose.compiler)
}
Expand All @@ -12,7 +12,13 @@ group = "com.sebastianneubauer.jsontreesample"
version = "1.0"

kotlin {
androidTarget()
android {
namespace = "com.sebastianneubauer.jsontreesample.shared"
compileSdk = 36
minSdk = 23

androidResources.enable = true
}

jvm()

Expand Down Expand Up @@ -61,11 +67,6 @@ kotlin {
implementation(kotlin("test"))
}

androidMain.dependencies {
implementation(libs.jb.compose.ui.tooling)
implementation(libs.androidx.activity.compose)
}

jvmMain.dependencies {
implementation(compose.desktop.currentOs)
}
Expand All @@ -79,43 +80,9 @@ kotlin {
jvmToolchain(17)
}

android {
namespace = "com.sebastianneubauer.jsontreesample"
compileSdk = 36

defaultConfig {
minSdk = 23
targetSdk = 36
}
sourceSets["main"].apply {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
res.srcDirs("src/androidMain/res")
}
buildTypes {
getByName("release") {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
//for testing only, don't do this in your app
signingConfig = signingConfigs.getByName("debug")
}
getByName("debug") {
applicationIdSuffix = ".debug"
signingConfig = signingConfigs.getByName("debug")
}
}
buildFeatures {
compose = true
}

// fixes lint error in release builds for compose 1.9.3
lint {
disable.add("NullSafeMutableLiveData")
}
}

compose.desktop {
application {
mainClass = "MainKt"
mainClass = "com.sebastianneubauer.jsontreesample.MainKt"
buildTypes.release {
proguard {
configurationFiles.from("compose-desktop.pro")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ import kotlinx.coroutines.launch
import org.jetbrains.compose.resources.painterResource

@Composable
internal fun App() = JsonTreeTheme(darkTheme = false) {
fun App() = JsonTreeTheme(darkTheme = false) {
MainScreen()
}

Expand Down Expand Up @@ -444,6 +444,7 @@ private fun JsonDiff(

@Preview
@Composable
private fun PreviewMainScreen() = JsonTreeTheme {
MainScreen()
}
private fun PreviewMainScreen() =
JsonTreeTheme {
MainScreen()
}
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
package com.sebastianneubauer.jsontreesample

import androidx.compose.ui.window.ComposeUIViewController
import com.sebastianneubauer.jsontreesample.App
import platform.UIKit.UIViewController
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sebastianneubauer.jsontreesample

import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.ComposeViewport
import com.sebastianneubauer.jsontreesample.App
import kotlinx.browser.document
import org.jetbrains.skiko.wasm.onWasmReady

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.sebastianneubauer.jsontreesample

import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Window
import androidx.compose.ui.window.application
import androidx.compose.ui.window.rememberWindowState
import com.sebastianneubauer.jsontreesample.App
import java.awt.Dimension

fun main() = application {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.sebastianneubauer.jsontreesample

import androidx.compose.ui.ExperimentalComposeUiApi
import androidx.compose.ui.window.ComposeViewport
import com.sebastianneubauer.jsontreesample.App
import kotlinx.browser.document
import org.jetbrains.compose.resources.ExperimentalResourceApi
import org.jetbrains.compose.resources.configureWebResources
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ dependencyResolutionManagement {
rootProject.name = "JsonTree"
include(":jsontree")
include(":sample")
include(":androidApp")