Skip to content

Commit

Permalink
Merge pull request #46 from skydoves/kotlin/2.0.0
Browse files Browse the repository at this point in the history
Bump Kotlin to 2.0.0 and Compose compiler plugin
  • Loading branch information
skydoves authored Jun 18, 2024
2 parents 5b30de6 + 889e660 commit 928cff0
Show file tree
Hide file tree
Showing 14 changed files with 34 additions and 43 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# Java class files
*.class

# Kotlin class files
/.kotlin

# Generated files
bin/
gen/
Expand Down
5 changes: 1 addition & 4 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import com.skydoves.orbital.Configuration
plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.compose.compiler.get().pluginId)
}

android {
Expand All @@ -36,10 +37,6 @@ android {
targetCompatibility = JavaVersion.VERSION_11
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get()
}

kotlinOptions {
jvmTarget = libs.versions.jvmTarget.get()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ fun GridView(model: MyModel) {
class MyModel {
val items = mutableListOf(
Kitty("Waffle", R.drawable.poster, "Bulbasaur", 0),
Kitty("油条", R.drawable.poster, "ivysaur", 1),
Kitty("Bubble", R.drawable.poster, "ivysaur", 1),
Kitty("Cowboy", R.drawable.poster, "Venusaur", 2),
Kitty("Pepper", R.drawable.poster, "charmander", 3),
Kitty("Unknown", R.drawable.poster, "charmeleon", 4),
Expand Down
5 changes: 1 addition & 4 deletions benchmark-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.skydoves.orbital.Configuration
plugins {
id(libs.plugins.android.application.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.compose.compiler.get().pluginId)
id(libs.plugins.baseline.profile.get().pluginId)
}

Expand All @@ -22,10 +23,6 @@ android {
targetCompatibility = JavaVersion.VERSION_11
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get()
}

kotlinOptions {
jvmTarget = libs.versions.jvmTarget.get()
}
Expand Down
1 change: 1 addition & 0 deletions benchmark/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import com.skydoves.orbital.Configuration
plugins {
id(libs.plugins.android.test.get().pluginId)
id(libs.plugins.kotlin.android.get().pluginId)
id(libs.plugins.compose.compiler.get().pluginId)
id(libs.plugins.baseline.profile.get().pluginId)
}

Expand Down
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ plugins {
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.jetbrains.compose) apply false
alias(libs.plugins.baseline.profile) apply false
alias(libs.plugins.compose.compiler) apply false
alias(libs.plugins.kotlin.binary.compatibility)
alias(libs.plugins.nexus.plugin)
alias(libs.plugins.spotless)
Expand Down
24 changes: 12 additions & 12 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,30 +1,30 @@
[versions]
agp = "8.2.2"
dokka = "1.9.10"
nexusPlugin = "0.26.0"
kotlin = "1.9.22"
agp = "8.4.0"
dokka = "1.9.20"
nexusPlugin = "0.28.0"
kotlin = "2.0.0"
kotlinBinaryCompatibility = "0.14.0"
jvmTarget = "11"
androidxComposeBom = "2024.01.00"
androidxComposeCompiler = "1.5.8"
androidxComposeBom = "2024.06.00"
androidxComposeConstraintLayout = "1.0.1"
androidxActivity = "1.8.0"
androidxActivity = "1.9.0"
androidxTest = "1.5.2"
androidxNavigation = "2.7.5"
coroutines = "1.7.3"
landscapist = "2.2.13"
androidxNavigation = "2.7.7"
coroutines = "1.8.1"
landscapist = "2.3.4"
baselineProfiles = "1.3.1"
uiAutomator = "2.3.0-alpha05"
spotless = "6.21.0"
junit = "1.1.5"
espresso-core = "3.5.1"
androidxMacroBenchmark = "1.2.3"
jetbrains-compose = "1.5.12"
androidxMacroBenchmark = "1.2.4"
jetbrains-compose = "1.6.11"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
android-library = { id = "com.android.library", version.ref = "agp" }
android-test = { id = "com.android.test", version.ref = "agp" }
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
Expand Down
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.5-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
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
2 changes: 0 additions & 2 deletions orbital/api/android/orbital.api
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public final class com/skydoves/orbital/OrbitalKt {
public final class com/skydoves/orbital/OrbitalScope : androidx/compose/ui/layout/LookaheadScope {
public static final field $stable I
public fun getLookaheadScopeCoordinates (Landroidx/compose/ui/layout/Placeable$PlacementScope;)Landroidx/compose/ui/layout/LayoutCoordinates;
public fun intermediateLayout (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function4;)Landroidx/compose/ui/Modifier;
public fun localLookaheadPositionOf-dBAh8RU (Landroidx/compose/ui/layout/LayoutCoordinates;Landroidx/compose/ui/layout/LayoutCoordinates;)J
public fun onPlaced (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;)Landroidx/compose/ui/Modifier;
public fun toLookaheadCoordinates (Landroidx/compose/ui/layout/LayoutCoordinates;)Landroidx/compose/ui/layout/LayoutCoordinates;
}

Expand Down
2 changes: 0 additions & 2 deletions orbital/api/desktop/orbital.api
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ public final class com/skydoves/orbital/OrbitalKt {
public final class com/skydoves/orbital/OrbitalScope : androidx/compose/ui/layout/LookaheadScope {
public static final field $stable I
public fun getLookaheadScopeCoordinates (Landroidx/compose/ui/layout/Placeable$PlacementScope;)Landroidx/compose/ui/layout/LayoutCoordinates;
public fun intermediateLayout (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function4;)Landroidx/compose/ui/Modifier;
public fun localLookaheadPositionOf-dBAh8RU (Landroidx/compose/ui/layout/LayoutCoordinates;Landroidx/compose/ui/layout/LayoutCoordinates;)J
public fun onPlaced (Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function2;)Landroidx/compose/ui/Modifier;
public fun toLookaheadCoordinates (Landroidx/compose/ui/layout/LayoutCoordinates;)Landroidx/compose/ui/layout/LayoutCoordinates;
}

Expand Down
5 changes: 1 addition & 4 deletions orbital/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ plugins {
id(libs.plugins.android.library.get().pluginId)
id(libs.plugins.kotlin.multiplatform.get().pluginId)
id(libs.plugins.jetbrains.compose.get().pluginId)
id(libs.plugins.compose.compiler.get().pluginId)
id(libs.plugins.nexus.plugin.get().pluginId)
id(libs.plugins.baseline.profile.get().pluginId)
}
Expand Down Expand Up @@ -76,10 +77,6 @@ android {
targetCompatibility = JavaVersion.VERSION_1_8
}

composeOptions {
kotlinCompilerExtensionVersion = libs.versions.androidxComposeCompiler.get()
}

packaging {
resources {
excludes.add("/META-INF/{AL2.0,LGPL2.1}")
Expand Down
5 changes: 2 additions & 3 deletions orbital/src/commonMain/kotlin/com/skydoves/orbital/Orbital.kt
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.Layout
import androidx.compose.ui.layout.LookaheadLayout
import androidx.compose.ui.layout.LookaheadScope
import androidx.compose.ui.layout.MeasurePolicy
import kotlin.math.max

/**
* Orbital is a layout that measures and placements internally, and collocates the measured layouts
* on the [LookaheadLayout] continuously. You can allows the [content] to run animations such as
* on the [LookaheadScope] continuously. You can allows the [content] to run animations such as
* [animateMovement], [animateTransformation], and [animateSharedElementTransition] on the [OrbitalScope].
*
* @param modifier [Modifier] used to adjust the layout or drawing content.
Expand All @@ -53,7 +52,7 @@ public fun Orbital(

/**
* Orbital is a layout that measures and placements internally, and collocates the measured layouts
* on the [LookaheadLayout] continuously. You can allows the [onStartContent] and [onTransformedContent]
* on the [LookaheadScope] continuously. You can allows the [onStartContent] and [onTransformedContent]
* to run animations such as [animateMovement], [animateTransformation], and [animateSharedElementTransition]
* on the [OrbitalScope].
*
Expand Down

0 comments on commit 928cff0

Please sign in to comment.