Skip to content

Commit a2e33c3

Browse files
committed
Updates for v2 (wizard version)
1 parent bb298ee commit a2e33c3

File tree

16 files changed

+93
-85
lines changed

16 files changed

+93
-85
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ local.properties
77
.DS_Store
88
xcuserdata/
99
Pods/
10+
/.kotlin/

build.gradle.kts

+1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ plugins {
44
alias(libs.plugins.androidApplication) apply false
55
alias(libs.plugins.androidLibrary) apply false
66
alias(libs.plugins.jetbrainsCompose) apply false
7+
alias(libs.plugins.compose.compiler) apply false
78
alias(libs.plugins.kotlinMultiplatform) apply false
89
}

composeApp/build.gradle.kts

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
1-
import org.jetbrains.compose.ExperimentalComposeLibrary
21
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
2+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
3+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
34

45
plugins {
56
alias(libs.plugins.kotlinMultiplatform)
67
alias(libs.plugins.androidApplication)
78
alias(libs.plugins.jetbrainsCompose)
9+
alias(libs.plugins.compose.compiler)
810
}
911

1012
kotlin {
1113
androidTarget {
12-
compilations.all {
13-
kotlinOptions {
14-
jvmTarget = "1.8"
15-
}
14+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
15+
compilerOptions {
16+
jvmTarget.set(JvmTarget.JVM_11)
1617
}
1718
}
1819

1920
sourceSets {
2021

2122
androidMain.dependencies {
22-
implementation(libs.compose.ui.tooling.preview)
23+
implementation(compose.preview)
2324
implementation(libs.androidx.activity.compose)
2425
}
2526
commonMain.dependencies {
2627
implementation(compose.runtime)
2728
implementation(compose.foundation)
2829
implementation(compose.material)
2930
implementation(compose.ui)
30-
@OptIn(ExperimentalComposeLibrary::class)
3131
implementation(compose.components.resources)
32+
implementation(compose.components.uiToolingPreview)
3233
implementation(projects.shared)
3334
}
3435
}
@@ -60,11 +61,14 @@ android {
6061
}
6162
}
6263
compileOptions {
63-
sourceCompatibility = JavaVersion.VERSION_1_8
64-
targetCompatibility = JavaVersion.VERSION_1_8
64+
sourceCompatibility = JavaVersion.VERSION_11
65+
targetCompatibility = JavaVersion.VERSION_11
66+
}
67+
buildFeatures {
68+
compose = true
6569
}
6670
dependencies {
67-
debugImplementation(libs.compose.ui.tooling)
71+
debugImplementation(compose.uiTooling)
6872
}
6973
}
7074

composeApp/src/androidMain/AndroidManifest.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020
</activity>
2121
</application>
2222

23-
</manifest>
23+
</manifest>

composeApp/src/androidMain/kotlin/App.kt

+8-10
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,28 @@ import androidx.compose.foundation.layout.fillMaxWidth
55
import androidx.compose.material.Button
66
import androidx.compose.material.MaterialTheme
77
import androidx.compose.material.Text
8-
import androidx.compose.runtime.Composable
9-
import androidx.compose.runtime.getValue
10-
import androidx.compose.runtime.mutableStateOf
11-
import androidx.compose.runtime.remember
12-
import androidx.compose.runtime.setValue
8+
import androidx.compose.runtime.*
139
import androidx.compose.ui.Alignment
1410
import androidx.compose.ui.Modifier
15-
import org.jetbrains.compose.resources.DrawableResource
16-
import org.jetbrains.compose.resources.ExperimentalResourceApi
1711
import org.jetbrains.compose.resources.painterResource
12+
import org.jetbrains.compose.ui.tooling.preview.Preview
13+
14+
import spacetutorial.composeapp.generated.resources.Res
15+
import spacetutorial.composeapp.generated.resources.compose_multiplatform
1816

19-
@OptIn(ExperimentalResourceApi::class)
2017
@Composable
18+
@Preview
2119
fun App() {
2220
MaterialTheme {
2321
var showContent by remember { mutableStateOf(false) }
24-
val greeting = remember { Greeting().greet() }
2522
Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
2623
Button(onClick = { showContent = !showContent }) {
2724
Text("Click me!")
2825
}
2926
AnimatedVisibility(showContent) {
27+
val greeting = remember { Greeting().greet() }
3028
Column(Modifier.fillMaxWidth(), horizontalAlignment = Alignment.CenterHorizontally) {
31-
Image(painterResource(DrawableResource("compose-multiplatform.xml")), null)
29+
Image(painterResource(Res.drawable.compose_multiplatform), null)
3230
Text("Compose: $greeting")
3331
}
3432
}

composeApp/src/androidMain/res/drawable/ic_launcher_background.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,4 +167,4 @@
167167
android:pathData="M79,19L79,89"
168168
android:strokeWidth="0.8"
169169
android:strokeColor="#33FFFFFF" />
170-
</vector>
170+
</vector>

composeApp/src/androidMain/resources/compose-multiplatform.xml renamed to composeApp/src/commonMain/composeResources/drawable/compose-multiplatform.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333
android:fillColor="#00000000"
3434
android:strokeColor="#083042"
3535
android:fillType="nonZero"/>
36-
</vector>
36+
</vector>

gradle.properties

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,9 @@ kotlin.code.style=official
33
#Gradle
44
org.gradle.jvmargs=-Xmx2048M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx2048M"
55

6-
76
#Android
87
android.nonTransitiveRClass=true
98
android.useAndroidX=true
109

11-
#MPP
12-
kotlin.mpp.androidSourceSetLayoutVersion=2
13-
kotlin.mpp.enableCInteropCommonization=true
14-
15-
#Development
16-
development=true
10+
#Kotlin Multiplatform
11+
kotlin.mpp.enableCInteropCommonization=true

gradle/libs.versions.toml

+9-11
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@ agp = "8.2.0"
33
android-compileSdk = "34"
44
android-minSdk = "24"
55
android-targetSdk = "34"
6-
androidx-activityCompose = "1.8.2"
7-
androidx-appcompat = "1.6.1"
6+
androidx-activityCompose = "1.9.0"
7+
androidx-appcompat = "1.7.0"
88
androidx-constraintlayout = "2.1.4"
9-
androidx-core-ktx = "1.12.0"
10-
androidx-espresso-core = "3.5.1"
11-
androidx-material = "1.11.0"
12-
androidx-test-junit = "1.1.5"
13-
compose = "1.6.2"
14-
compose-plugin = "1.6.0"
9+
androidx-core-ktx = "1.13.1"
10+
androidx-espresso-core = "3.6.0"
11+
androidx-material = "1.12.0"
12+
androidx-test-junit = "1.2.0"
13+
compose-plugin = "1.6.11"
1514
junit = "4.13.2"
16-
kotlin = "1.9.22"
15+
kotlin = "2.0.0"
1716

1817
[libraries]
1918
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
@@ -26,11 +25,10 @@ androidx-appcompat = { group = "androidx.appcompat", name = "appcompat", version
2625
androidx-material = { group = "com.google.android.material", name = "material", version.ref = "androidx-material" }
2726
androidx-constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "androidx-constraintlayout" }
2827
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidx-activityCompose" }
29-
compose-ui-tooling = { module = "androidx.compose.ui:ui-tooling", version.ref = "compose" }
30-
compose-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "compose" }
3128

3229
[plugins]
3330
androidApplication = { id = "com.android.application", version.ref = "agp" }
3431
androidLibrary = { id = "com.android.library", version.ref = "agp" }
3532
jetbrainsCompose = { id = "org.jetbrains.compose", version.ref = "compose-plugin" }
33+
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
3634
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }

gradle/wrapper/gradle-wrapper.jar

346 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

+9-8
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ done
8383
# This is normally unused
8484
# shellcheck disable=SC2034
8585
APP_BASE_NAME=${0##*/}
86-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
86+
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87+
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
8788

8889
# Use the maximum available, or set MAX_FD != -1 to use that value.
8990
MAX_FD=maximum
@@ -144,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144145
case $MAX_FD in #(
145146
max*)
146147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
148149
MAX_FD=$( ulimit -H -n ) ||
149150
warn "Could not query maximum file descriptor limit"
150151
esac
151152
case $MAX_FD in #(
152153
'' | soft) :;; #(
153154
*)
154155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
156157
ulimit -n "$MAX_FD" ||
157158
warn "Could not set maximum file descriptor limit to $MAX_FD"
158159
esac
@@ -201,11 +202,11 @@ fi
201202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
202203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
203204

204-
# Collect all arguments for the java command;
205-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
206-
# shell script including quotes and variable substitutions, so put them in
207-
# double quotes to make sure that they get re-expanded; and
208-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
209210

210211
set -- \
211212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

iosApp/iosApp.xcodeproj/project.pbxproj

+16-21
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 54;
6+
objectVersion = 56;
77
objects = {
88

99
/* Begin PBXBuildFile section */
@@ -17,7 +17,7 @@
1717
058557BA273AAA24004C7B11 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
1818
058557D8273AAEEB004C7B11 /* Preview Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = "Preview Assets.xcassets"; sourceTree = "<group>"; };
1919
2152FB032600AC8F00CF470E /* iOSApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = iOSApp.swift; sourceTree = "<group>"; };
20-
7555FF7B242A565900829871 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
20+
7555FF7B242A565900829871 /* SpaceTutorial.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SpaceTutorial.app; sourceTree = BUILT_PRODUCTS_DIR; };
2121
7555FF82242A565900829871 /* ContentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
2222
7555FF8C242A565B00829871 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
2323
AB3632DC29227652001CCB65 /* Config.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; path = Config.xcconfig; sourceTree = "<group>"; };
@@ -62,7 +62,7 @@
6262
7555FF7C242A565900829871 /* Products */ = {
6363
isa = PBXGroup;
6464
children = (
65-
7555FF7B242A565900829871 /* iosApp.app */,
65+
7555FF7B242A565900829871 /* SpaceTutorial.app */,
6666
);
6767
name = Products;
6868
sourceTree = "<group>";
@@ -107,7 +107,7 @@
107107
packageProductDependencies = (
108108
);
109109
productName = iosApp;
110-
productReference = 7555FF7B242A565900829871 /* iosApp.app */;
110+
productReference = 7555FF7B242A565900829871 /* SpaceTutorial.app */;
111111
productType = "com.apple.product-type.application";
112112
};
113113
/* End PBXNativeTarget section */
@@ -116,8 +116,9 @@
116116
7555FF73242A565900829871 /* Project object */ = {
117117
isa = PBXProject;
118118
attributes = {
119+
BuildIndependentTargetsInParallel = YES;
119120
LastSwiftUpdateCheck = 1130;
120-
LastUpgradeCheck = 1130;
121+
LastUpgradeCheck = 1540;
121122
ORGANIZATIONNAME = orgName;
122123
TargetAttributes = {
123124
7555FF7A242A565900829871 = {
@@ -126,7 +127,7 @@
126127
};
127128
};
128129
buildConfigurationList = 7555FF76242A565900829871 /* Build configuration list for PBXProject "iosApp" */;
129-
compatibilityVersion = "Xcode 12.0";
130+
compatibilityVersion = "Xcode 14.0";
130131
developmentRegion = en;
131132
hasScannedForEncodings = 0;
132133
knownRegions = (
@@ -229,6 +230,7 @@
229230
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
230231
ENABLE_STRICT_OBJC_MSGSEND = YES;
231232
ENABLE_TESTABILITY = YES;
233+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
232234
GCC_C_LANGUAGE_STANDARD = gnu11;
233235
GCC_DYNAMIC_NO_PIC = NO;
234236
GCC_NO_COMMON_BLOCKS = YES;
@@ -243,7 +245,7 @@
243245
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
244246
GCC_WARN_UNUSED_FUNCTION = YES;
245247
GCC_WARN_UNUSED_VARIABLE = YES;
246-
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
248+
IPHONEOS_DEPLOYMENT_TARGET = 15.3;
247249
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
248250
MTL_FAST_MATH = YES;
249251
ONLY_ACTIVE_ARCH = YES;
@@ -291,6 +293,7 @@
291293
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
292294
ENABLE_NS_ASSERTIONS = NO;
293295
ENABLE_STRICT_OBJC_MSGSEND = YES;
296+
ENABLE_USER_SCRIPT_SANDBOXING = NO;
294297
GCC_C_LANGUAGE_STANDARD = gnu11;
295298
GCC_NO_COMMON_BLOCKS = YES;
296299
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
@@ -299,7 +302,7 @@
299302
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
300303
GCC_WARN_UNUSED_FUNCTION = YES;
301304
GCC_WARN_UNUSED_VARIABLE = YES;
302-
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
305+
IPHONEOS_DEPLOYMENT_TARGET = 15.3;
303306
MTL_ENABLE_DEBUG_INFO = NO;
304307
MTL_FAST_MATH = YES;
305308
SDKROOT = iphoneos;
@@ -319,19 +322,15 @@
319322
DEVELOPMENT_TEAM = "${TEAM_ID}";
320323
ENABLE_PREVIEWS = YES;
321324
FRAMEWORK_SEARCH_PATHS = (
325+
"$(inherited)",
322326
"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
323327
);
324328
INFOPLIST_FILE = iosApp/Info.plist;
325-
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
329+
IPHONEOS_DEPLOYMENT_TARGET = 15.3;
326330
LD_RUNPATH_SEARCH_PATHS = (
327331
"$(inherited)",
328332
"@executable_path/Frameworks",
329333
);
330-
OTHER_LDFLAGS = (
331-
"$(inherited)",
332-
"-framework",
333-
shared,
334-
);
335334
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
336335
PRODUCT_NAME = "${APP_NAME}";
337336
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -350,19 +349,15 @@
350349
DEVELOPMENT_TEAM = "${TEAM_ID}";
351350
ENABLE_PREVIEWS = YES;
352351
FRAMEWORK_SEARCH_PATHS = (
352+
"$(inherited)",
353353
"$(SRCROOT)/../shared/build/xcode-frameworks/$(CONFIGURATION)/$(SDK_NAME)",
354354
);
355355
INFOPLIST_FILE = iosApp/Info.plist;
356-
IPHONEOS_DEPLOYMENT_TARGET = 14.1;
356+
IPHONEOS_DEPLOYMENT_TARGET = 15.3;
357357
LD_RUNPATH_SEARCH_PATHS = (
358358
"$(inherited)",
359359
"@executable_path/Frameworks",
360360
);
361-
OTHER_LDFLAGS = (
362-
"$(inherited)",
363-
"-framework",
364-
shared,
365-
);
366361
PRODUCT_BUNDLE_IDENTIFIER = "${BUNDLE_ID}${TEAM_ID}";
367362
PRODUCT_NAME = "${APP_NAME}";
368363
PROVISIONING_PROFILE_SPECIFIER = "";
@@ -395,4 +390,4 @@
395390
/* End XCConfigurationList section */
396391
};
397392
rootObject = 7555FF73242A565900829871 /* Project object */;
398-
}
393+
}

0 commit comments

Comments
 (0)