Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
TonnyL committed Aug 16, 2023
1 parent 8053067 commit 044c227
Show file tree
Hide file tree
Showing 16 changed files with 63 additions and 47 deletions.
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
object Versions {

const val compileSdk = 33
const val targetSdk = 33
const val compileSdk = 34
const val targetSdk = 34
const val minSdk = 24

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems
import androidx.paging.compose.collectAsLazyPagingItems
import androidx.paging.compose.itemsIndexed
import androidx.paging.compose.itemKey
import com.lizhaotailang.packman.common.ui.CiJobPreviewProviders
import com.lizhaotailang.packman.common.ui.ErrorScreen
import com.lizhaotailang.packman.common.ui.HomeViewModel
import com.lizhaotailang.packman.common.ui.LocalNavController
import com.lizhaotailang.packman.common.ui.Screen
import com.lizhaotailang.packman.graphql.fragment.CiJob
import com.lizhaotailang.packman.graphql.type.CiJobStatus.*

@OptIn(ExperimentalMaterialApi::class)
@Composable
Expand Down Expand Up @@ -88,12 +87,11 @@ private fun CiJobsScreenContent(
val navController = LocalNavController.current

LazyColumn {
itemsIndexed(
items = jobs,
key = { _, item ->
item.id ?: ""
}
) { index, item ->
items(
count = jobs.itemCount,
key = jobs.itemKey { it.id ?: "" }
) { index ->
val item = jobs[index]
if (index == 0) {
Spacer(modifier = Modifier.height(height = innerPaddings.calculateTopPadding()))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ internal fun DebugScreenContent(
LazyColumn(contentPadding = paddingValues) {
item(key = "insert_history") {
ListItem(
headlineText = {
headlineContent = {
Text(text = "Insert history into database")
},
supportingText = {
supportingContent = {
Text(text = "size: ${histories.size}")
},
modifier = Modifier.clickable(onClick = insertHistoryIntoDatabase)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,16 @@ internal fun JobScreenContent(
}
}

@OptIn(ExperimentalMaterial3Api::class)
private fun LazyListScope.jobInfoItem(
headline: String,
supporting: String
) {
item {
ListItem(
headlineText = {
headlineContent = {
Text(text = headline)
},
supportingText = {
supportingContent = {
Text(
text = supporting,
style = MaterialTheme.typography.bodyMedium
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.offset
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.Icon
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
Expand All @@ -26,21 +25,20 @@ import com.lizhaotailang.packman.graphql.type.CiJobStatus
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime

@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun JobListItem(
job: CiJob,
navigate: (CiJob) -> Unit
) {
ListItem(
headlineText = {
headlineContent = {
Text(
text = "${job.id} ${job.refName}",
maxLines = 1,
overflow = TextOverflow.Ellipsis
)
},
supportingText = {
supportingContent = {
val duration = job.duration?.let {
"${(it % 3600) / 60}:${it % 60}"
} ?: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import kotlinx.datetime.toLocalDateTime

@OptIn(
ExperimentalMaterial3Api::class,
ExperimentalStdlibApi::class,
ExperimentalLayoutApi::class
)
@Composable
Expand Down Expand Up @@ -109,18 +108,17 @@ internal fun NewJobConfigurationItem(
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun HistoryItem(
history: History,
onClick: (History) -> Unit
) {
ListItem(
headlineText = {
headlineContent = {
Text(text = history.branch)
},
supportingText = {
val variants = history.variants.map { Variant.values()[it] }.joinToString()
supportingContent = {
val variants = history.variants.map { Variant.entries[it] }.joinToString()
val startedAt = history.startedAt.toInstant()
.toLocalDateTime(timeZone = TimeZone.currentSystemDefault())
Text(text = "${variants}\n$startedAt")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,17 +120,16 @@ internal fun PipelineScheduleScreenContent(
}
}

@OptIn(ExperimentalMaterial3Api::class)
private fun LazyListScope.pipelineScheduleInfoItem(
headline: String,
supporting: String
) {
item {
ListItem(
headlineText = {
headlineContent = {
Text(text = headline)
},
supportingText = {
supportingContent = {
Text(
text = supporting,
style = MaterialTheme.typography.bodyMedium
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.lizhaotailang.packman.common.ui.schedules

import androidx.compose.foundation.clickable
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.ListItem
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
Expand All @@ -12,17 +11,16 @@ import com.lizhaotailang.packman.common.data.PipelineScheduleListItem
import kotlinx.datetime.TimeZone
import kotlinx.datetime.toLocalDateTime

@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun PipelineScheduleItem(
item: PipelineScheduleListItem,
onClick: (PipelineScheduleListItem) -> Unit
) {
ListItem(
headlineText = {
headlineContent = {
Text(text = "#${item.id} ${item.description}")
},
supportingText = {
supportingContent = {
val nextRunAt =
item.nextRunAt.toLocalDateTime(timeZone = TimeZone.of(zoneId = item.cronTimezone))
Text(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import com.lizhaotailang.packman.common.ui.barsBackground
import com.lizhaotailang.packman.common.ui.debug.DebugScreen
import com.lizhaotailang.packman.common.ui.job.JobScreen
import com.lizhaotailang.packman.common.ui.schedule.PipelineScheduleScreen
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.useContents
import platform.UIKit.UIViewController
import platform.UIKit.UIWindow
import platform.UIKit.safeAreaInsets
import kotlin.math.roundToInt

@Composable
Expand Down Expand Up @@ -87,6 +87,7 @@ internal fun MainScreen(insets: WindowInsets) {
}
}

@OptIn(ExperimentalForeignApi::class)
@Suppress("UNUSED")
fun mainViewController(window: UIWindow): UIViewController {
val insets = window.safeAreaInsets.useContents {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package com.lizhaotailang.packman.common.util
import androidx.compose.runtime.Composable
import androidx.compose.ui.graphics.ImageBitmap
import androidx.compose.ui.graphics.toComposeImageBitmap
import kotlinx.cinterop.ExperimentalForeignApi
import kotlinx.cinterop.addressOf
import kotlinx.cinterop.usePinned
import org.jetbrains.skia.Image
import platform.UIKit.UIImage
import platform.UIKit.UIImagePNGRepresentation
import platform.posix.memcpy

@OptIn(ExperimentalForeignApi::class)
@Composable
internal fun imageResource(id: String): ImageBitmap {
// TODO: maybe use something more efficient
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ xcodeproj=iOS
org.jetbrains.compose.experimental.jscanvas.enabled=true
org.jetbrains.compose.experimental.macos.enabled=true
org.jetbrains.compose.experimental.uikit.enabled=true
kotlin.native.cocoapods.generate.wrapper=true
kotlin.native.cacheKind=none
kotlin.native.cocoapods.generate.wrapper=true
kotlin.native.useEmbeddableCompilerJar=true
kotlin.native.cacheOrchestration=gradle
kotlin.native.useXcodeMessageStyle=true
Expand Down
22 changes: 11 additions & 11 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
[versions]
androidGradlePlugin = "8.0.2"
androidGradlePlugin = "8.1.0"
componentsResources = "1.3.0"
kotlin = "1.8.20"
compose = "1.5.0-dev1049"
apollo = "4.0.0-alpha.1"
kotlin = "1.9.0"
compose = "1.5.0-beta02"
apollo = "4.0.0-alpha.3"
junit4 = "4.13.2"
androidxAppCompat = "1.7.0-alpha01"
androidxAppCompat = "1.7.0-alpha03"
androidxTestExt = "1.1.5"
androidxEspresso = "3.5.1"
androidxLifecycle = "2.6.0-alpha04"
androidxActivityCompose = "1.7.0-alpha02"
androidxNavigationCompose = "2.6.0-alpha04"
androidxLifecycle = "2.6.1"
androidxActivityCompose = "1.7.2"
androidxNavigationCompose = "2.7.0"
spotless = "6.18.0"
kotlinDateTime = "0.4.0"
pagingCompose = "1.0.0-alpha17"
pagingCompose = "3.2.0"
ktor = "2.2.4"
buildKonfig = "0.13.3"
accompanist = "0.29.1-alpha"
mdc = "1.9.0-alpha02"
accompanist = "0.31.6-rc"
mdc = "1.9.0"
realm = "1.8.0"

[libraries]
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-rc-3-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
8 changes: 6 additions & 2 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 @@ -130,10 +131,13 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
Expand Down
18 changes: 18 additions & 0 deletions iOS/iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
7555FF77242A565900829871 /* Sources */,
7555FF79242A565900829871 /* Resources */,
64A64D84DFD66CCE3523B56E /* Frameworks */,
655219B9AF3560A93C6E5A98 /* [CP] Copy Pods Resources */,
);
buildRules = (
);
Expand Down Expand Up @@ -158,6 +159,23 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
655219B9AF3560A93C6E5A98 /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iOS/Pods-iOS-resources-${CONFIGURATION}-input-files.xcfilelist",
);
name = "[CP] Copy Pods Resources";
outputFileListPaths = (
"${PODS_ROOT}/Target Support Files/Pods-iOS/Pods-iOS-resources-${CONFIGURATION}-output-files.xcfilelist",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-iOS/Pods-iOS-resources.sh\"\n";
showEnvVarsInLog = 0;
};
95B9FE178D2C2D6544C5DC64 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
Expand Down

0 comments on commit 044c227

Please sign in to comment.