create-kmp-library 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/out.js +5362 -0
- package/package.json +30 -0
- package/template/base-cmp/_gitignore +8 -0
- package/template/base-cmp/androidApp/build.gradle.kts +46 -0
- package/template/base-cmp/androidApp/src/main/AndroidManifest.xml +14 -0
- package/template/base-cmp/androidApp/src/main/kotlin/__PACKAGE_PATH__/androidapp/MainActivity.kt +16 -0
- package/template/base-cmp/build.gradle.kts +9 -0
- package/template/base-cmp/gradle/libs.versions.toml +21 -0
- package/template/base-cmp/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/base-cmp/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/base-cmp/gradle.properties +14 -0
- package/template/base-cmp/gradlew +251 -0
- package/template/base-cmp/gradlew.bat +94 -0
- package/template/base-cmp/iosApp/Configuration/Config.xcconfig +29 -0
- package/template/base-cmp/iosApp/iosApp/ContentView.swift +19 -0
- package/template/base-cmp/iosApp/iosApp/Info.plist +8 -0
- package/template/base-cmp/iosApp/iosApp/iOSApp.swift +10 -0
- package/template/base-cmp/iosApp/iosApp.xcodeproj/project.pbxproj +232 -0
- package/template/base-cmp/iosApp/scripts/build_framework.sh +58 -0
- package/template/base-cmp/library/build.gradle.kts +72 -0
- package/template/base-cmp/library/src/androidMain/kotlin/__PACKAGE_PATH__/Platform.android.kt +5 -0
- package/template/base-cmp/library/src/commonMain/kotlin/__PACKAGE_PATH__/Greeting.kt +9 -0
- package/template/base-cmp/library/src/commonMain/kotlin/__PACKAGE_PATH__/LibraryRoot.kt +9 -0
- package/template/base-cmp/library/src/iosMain/kotlin/__PACKAGE_PATH__/MainViewControllerFactory.kt +12 -0
- package/template/base-cmp/library/src/iosMain/kotlin/__PACKAGE_PATH__/Platform.ios.kt +5 -0
- package/template/base-cmp/settings.gradle.kts +18 -0
- package/template/base-kmp/_gitignore +8 -0
- package/template/base-kmp/androidApp/build.gradle.kts +35 -0
- package/template/base-kmp/androidApp/src/main/AndroidManifest.xml +14 -0
- package/template/base-kmp/androidApp/src/main/kotlin/__PACKAGE_PATH__/androidapp/MainActivity.kt +17 -0
- package/template/base-kmp/build.gradle.kts +9 -0
- package/template/base-kmp/gradle/libs.versions.toml +21 -0
- package/template/base-kmp/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/template/base-kmp/gradle/wrapper/gradle-wrapper.properties +7 -0
- package/template/base-kmp/gradle.properties +14 -0
- package/template/base-kmp/gradlew +251 -0
- package/template/base-kmp/gradlew.bat +94 -0
- package/template/base-kmp/iosApp/Configuration/Config.xcconfig +29 -0
- package/template/base-kmp/iosApp/iosApp/ContentView.swift +10 -0
- package/template/base-kmp/iosApp/iosApp/Info.plist +8 -0
- package/template/base-kmp/iosApp/iosApp/iOSApp.swift +10 -0
- package/template/base-kmp/iosApp/iosApp.xcodeproj/project.pbxproj +232 -0
- package/template/base-kmp/iosApp/scripts/build_framework.sh +58 -0
- package/template/base-kmp/library/build.gradle.kts +66 -0
- package/template/base-kmp/library/src/androidMain/kotlin/__PACKAGE_PATH__/Platform.android.kt +5 -0
- package/template/base-kmp/library/src/commonMain/kotlin/__PACKAGE_PATH__/Greeting.kt +9 -0
- package/template/base-kmp/library/src/iosMain/kotlin/__PACKAGE_PATH__/Platform.ios.kt +5 -0
- package/template/base-kmp/settings.gradle.kts +18 -0
- package/template/target-jvm/library/src/jvmMain/kotlin/__PACKAGE_PATH__/Platform.jvm.kt +3 -0
|
@@ -0,0 +1,232 @@
|
|
|
1
|
+
// !$*UTF8*$!
|
|
2
|
+
{
|
|
3
|
+
archiveVersion = 1;
|
|
4
|
+
classes = {
|
|
5
|
+
};
|
|
6
|
+
objectVersion = 77;
|
|
7
|
+
objects = {
|
|
8
|
+
|
|
9
|
+
/* Begin PBXFileReference section */
|
|
10
|
+
4AFEA63EE4E382DCEE9C7342 /* iosApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = iosApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
|
11
|
+
/* End PBXFileReference section */
|
|
12
|
+
|
|
13
|
+
/* Begin PBXFileSystemSynchronizedBuildFileExceptionSet section */
|
|
14
|
+
F61D80A47EDC3CC6E38D38E2 /* Exceptions for "iosApp" folder in "iosApp" target */ = {
|
|
15
|
+
isa = PBXFileSystemSynchronizedBuildFileExceptionSet;
|
|
16
|
+
membershipExceptions = (
|
|
17
|
+
Info.plist,
|
|
18
|
+
);
|
|
19
|
+
target = E2A59491D3A693D6CF8FAA99 /* iosApp */;
|
|
20
|
+
};
|
|
21
|
+
/* End PBXFileSystemSynchronizedBuildFileExceptionSet section */
|
|
22
|
+
|
|
23
|
+
/* Begin PBXFileSystemSynchronizedRootGroup section */
|
|
24
|
+
F584CF6A856159BE8A9D4B6B /* iosApp */ = {
|
|
25
|
+
isa = PBXFileSystemSynchronizedRootGroup;
|
|
26
|
+
exceptions = (
|
|
27
|
+
F61D80A47EDC3CC6E38D38E2 /* Exceptions for "iosApp" folder in "iosApp" target */,
|
|
28
|
+
);
|
|
29
|
+
path = iosApp;
|
|
30
|
+
sourceTree = "<group>";
|
|
31
|
+
};
|
|
32
|
+
995164853EA3993193B95917 /* Configuration */ = {
|
|
33
|
+
isa = PBXFileSystemSynchronizedRootGroup;
|
|
34
|
+
path = Configuration;
|
|
35
|
+
sourceTree = "<group>";
|
|
36
|
+
};
|
|
37
|
+
/* End PBXFileSystemSynchronizedRootGroup section */
|
|
38
|
+
|
|
39
|
+
/* Begin PBXFrameworksBuildPhase section */
|
|
40
|
+
B0D8C1A0EDB9473CC67F2043 /* Frameworks */ = {
|
|
41
|
+
isa = PBXFrameworksBuildPhase;
|
|
42
|
+
buildActionMask = 2147483647;
|
|
43
|
+
files = (
|
|
44
|
+
);
|
|
45
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
46
|
+
};
|
|
47
|
+
/* End PBXFrameworksBuildPhase section */
|
|
48
|
+
|
|
49
|
+
/* Begin PBXGroup section */
|
|
50
|
+
1697F1640D261BE07EB49B9B = {
|
|
51
|
+
isa = PBXGroup;
|
|
52
|
+
children = (
|
|
53
|
+
995164853EA3993193B95917 /* Configuration */,
|
|
54
|
+
F584CF6A856159BE8A9D4B6B /* iosApp */,
|
|
55
|
+
0AB826A394E372549F7760E1 /* Products */,
|
|
56
|
+
);
|
|
57
|
+
sourceTree = "<group>";
|
|
58
|
+
};
|
|
59
|
+
0AB826A394E372549F7760E1 /* Products */ = {
|
|
60
|
+
isa = PBXGroup;
|
|
61
|
+
children = (
|
|
62
|
+
4AFEA63EE4E382DCEE9C7342 /* iosApp.app */,
|
|
63
|
+
);
|
|
64
|
+
name = Products;
|
|
65
|
+
sourceTree = "<group>";
|
|
66
|
+
};
|
|
67
|
+
/* End PBXGroup section */
|
|
68
|
+
|
|
69
|
+
/* Begin PBXNativeTarget section */
|
|
70
|
+
E2A59491D3A693D6CF8FAA99 /* iosApp */ = {
|
|
71
|
+
isa = PBXNativeTarget;
|
|
72
|
+
buildConfigurationList = D52D642D761017D884957B7E /* Build configuration list for PBXNativeTarget "iosApp" */;
|
|
73
|
+
buildPhases = (
|
|
74
|
+
EE9693A36170387366D41FA0 /* Compile Kotlin Framework */,
|
|
75
|
+
8837E53A0E1163C8B8D7510B /* Sources */,
|
|
76
|
+
B0D8C1A0EDB9473CC67F2043 /* Frameworks */,
|
|
77
|
+
5DEFDCB68438EDBC24577A8F /* Resources */,
|
|
78
|
+
);
|
|
79
|
+
buildRules = (
|
|
80
|
+
);
|
|
81
|
+
dependencies = (
|
|
82
|
+
);
|
|
83
|
+
fileSystemSynchronizedGroups = (
|
|
84
|
+
F584CF6A856159BE8A9D4B6B /* iosApp */,
|
|
85
|
+
);
|
|
86
|
+
name = iosApp;
|
|
87
|
+
packageProductDependencies = (
|
|
88
|
+
);
|
|
89
|
+
productName = iosApp;
|
|
90
|
+
productReference = 4AFEA63EE4E382DCEE9C7342 /* iosApp.app */;
|
|
91
|
+
productType = "com.apple.product-type.application";
|
|
92
|
+
};
|
|
93
|
+
/* End PBXNativeTarget section */
|
|
94
|
+
|
|
95
|
+
/* Begin PBXProject section */
|
|
96
|
+
A9A73D31A68B735AF32426B0 /* Project object */ = {
|
|
97
|
+
isa = PBXProject;
|
|
98
|
+
attributes = {
|
|
99
|
+
BuildIndependentTargetsInParallel = 1;
|
|
100
|
+
LastSwiftUpdateCheck = 1620;
|
|
101
|
+
LastUpgradeCheck = 1620;
|
|
102
|
+
TargetAttributes = {
|
|
103
|
+
E2A59491D3A693D6CF8FAA99 = {
|
|
104
|
+
CreatedOnToolsVersion = 16.2;
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
};
|
|
108
|
+
buildConfigurationList = A292E86A6D307910A1FF1174 /* Build configuration list for PBXProject "iosApp" */;
|
|
109
|
+
developmentRegion = en;
|
|
110
|
+
hasScannedForEncodings = 0;
|
|
111
|
+
knownRegions = (
|
|
112
|
+
en,
|
|
113
|
+
Base,
|
|
114
|
+
);
|
|
115
|
+
mainGroup = 1697F1640D261BE07EB49B9B;
|
|
116
|
+
minimizedProjectReferenceProxies = 1;
|
|
117
|
+
preferredProjectObjectVersion = 77;
|
|
118
|
+
productRefGroup = 0AB826A394E372549F7760E1 /* Products */;
|
|
119
|
+
projectDirPath = "";
|
|
120
|
+
projectRoot = "";
|
|
121
|
+
targets = (
|
|
122
|
+
E2A59491D3A693D6CF8FAA99 /* iosApp */,
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
/* End PBXProject section */
|
|
126
|
+
|
|
127
|
+
/* Begin PBXResourcesBuildPhase section */
|
|
128
|
+
5DEFDCB68438EDBC24577A8F /* Resources */ = {
|
|
129
|
+
isa = PBXResourcesBuildPhase;
|
|
130
|
+
buildActionMask = 2147483647;
|
|
131
|
+
files = (
|
|
132
|
+
);
|
|
133
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
134
|
+
};
|
|
135
|
+
/* End PBXResourcesBuildPhase section */
|
|
136
|
+
|
|
137
|
+
/* Begin PBXShellScriptBuildPhase section */
|
|
138
|
+
EE9693A36170387366D41FA0 /* Compile Kotlin Framework */ = {
|
|
139
|
+
isa = PBXShellScriptBuildPhase;
|
|
140
|
+
alwaysOutOfDate = 1;
|
|
141
|
+
buildActionMask = 2147483647;
|
|
142
|
+
files = (
|
|
143
|
+
);
|
|
144
|
+
inputFileListPaths = (
|
|
145
|
+
);
|
|
146
|
+
inputPaths = (
|
|
147
|
+
);
|
|
148
|
+
name = "Compile Kotlin Framework";
|
|
149
|
+
outputFileListPaths = (
|
|
150
|
+
);
|
|
151
|
+
outputPaths = (
|
|
152
|
+
);
|
|
153
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
154
|
+
shellPath = /bin/sh;
|
|
155
|
+
shellScript = "bash \"$SRCROOT/scripts/build_framework.sh\"";
|
|
156
|
+
};
|
|
157
|
+
/* End PBXShellScriptBuildPhase section */
|
|
158
|
+
|
|
159
|
+
/* Begin PBXSourcesBuildPhase section */
|
|
160
|
+
8837E53A0E1163C8B8D7510B /* Sources */ = {
|
|
161
|
+
isa = PBXSourcesBuildPhase;
|
|
162
|
+
buildActionMask = 2147483647;
|
|
163
|
+
files = (
|
|
164
|
+
);
|
|
165
|
+
runOnlyForDeploymentPostprocessing = 0;
|
|
166
|
+
};
|
|
167
|
+
/* End PBXSourcesBuildPhase section */
|
|
168
|
+
|
|
169
|
+
/* Begin XCBuildConfiguration section */
|
|
170
|
+
B29A3552D2FACC51F8276345 /* Debug */ = {
|
|
171
|
+
isa = XCBuildConfiguration;
|
|
172
|
+
baseConfigurationReferenceAnchor = 995164853EA3993193B95917 /* Configuration */;
|
|
173
|
+
baseConfigurationReferenceRelativePath = Config.xcconfig;
|
|
174
|
+
buildSettings = {
|
|
175
|
+
};
|
|
176
|
+
name = Debug;
|
|
177
|
+
};
|
|
178
|
+
4308030FE4D985B225B66823 /* Release */ = {
|
|
179
|
+
isa = XCBuildConfiguration;
|
|
180
|
+
baseConfigurationReferenceAnchor = 995164853EA3993193B95917 /* Configuration */;
|
|
181
|
+
baseConfigurationReferenceRelativePath = Config.xcconfig;
|
|
182
|
+
buildSettings = {
|
|
183
|
+
};
|
|
184
|
+
name = Release;
|
|
185
|
+
};
|
|
186
|
+
7547BA787DAEFF9EC0A9F930 /* Debug */ = {
|
|
187
|
+
isa = XCBuildConfiguration;
|
|
188
|
+
baseConfigurationReferenceAnchor = 995164853EA3993193B95917 /* Configuration */;
|
|
189
|
+
baseConfigurationReferenceRelativePath = Config.xcconfig;
|
|
190
|
+
buildSettings = {
|
|
191
|
+
ASSETCATALOG_COMPILER_APPICON_NAME = "";
|
|
192
|
+
SWIFT_VERSION = 5.0;
|
|
193
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
194
|
+
};
|
|
195
|
+
name = Debug;
|
|
196
|
+
};
|
|
197
|
+
A6E704604B3DA0BC26B26C0A /* Release */ = {
|
|
198
|
+
isa = XCBuildConfiguration;
|
|
199
|
+
baseConfigurationReferenceAnchor = 995164853EA3993193B95917 /* Configuration */;
|
|
200
|
+
baseConfigurationReferenceRelativePath = Config.xcconfig;
|
|
201
|
+
buildSettings = {
|
|
202
|
+
ASSETCATALOG_COMPILER_APPICON_NAME = "";
|
|
203
|
+
SWIFT_VERSION = 5.0;
|
|
204
|
+
TARGETED_DEVICE_FAMILY = "1,2";
|
|
205
|
+
};
|
|
206
|
+
name = Release;
|
|
207
|
+
};
|
|
208
|
+
/* End XCBuildConfiguration section */
|
|
209
|
+
|
|
210
|
+
/* Begin XCConfigurationList section */
|
|
211
|
+
A292E86A6D307910A1FF1174 /* Build configuration list for PBXProject "iosApp" */ = {
|
|
212
|
+
isa = XCConfigurationList;
|
|
213
|
+
buildConfigurations = (
|
|
214
|
+
B29A3552D2FACC51F8276345 /* Debug */,
|
|
215
|
+
4308030FE4D985B225B66823 /* Release */,
|
|
216
|
+
);
|
|
217
|
+
defaultConfigurationIsVisible = 0;
|
|
218
|
+
defaultConfigurationName = Release;
|
|
219
|
+
};
|
|
220
|
+
D52D642D761017D884957B7E /* Build configuration list for PBXNativeTarget "iosApp" */ = {
|
|
221
|
+
isa = XCConfigurationList;
|
|
222
|
+
buildConfigurations = (
|
|
223
|
+
7547BA787DAEFF9EC0A9F930 /* Debug */,
|
|
224
|
+
A6E704604B3DA0BC26B26C0A /* Release */,
|
|
225
|
+
);
|
|
226
|
+
defaultConfigurationIsVisible = 0;
|
|
227
|
+
defaultConfigurationName = Release;
|
|
228
|
+
};
|
|
229
|
+
/* End XCConfigurationList section */
|
|
230
|
+
};
|
|
231
|
+
rootObject = A9A73D31A68B735AF32426B0 /* Project object */;
|
|
232
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
#!/bin/sh
|
|
2
|
+
|
|
3
|
+
set -euo pipefail
|
|
4
|
+
|
|
5
|
+
PROJECT_DIR="$SRCROOT"
|
|
6
|
+
ROOT_DIR="$PROJECT_DIR/.."
|
|
7
|
+
FRAMEWORK_NAME="__FRAMEWORK_NAME__"
|
|
8
|
+
|
|
9
|
+
TARGET_BUILD_DIR="${TARGET_BUILD_DIR:?TARGET_BUILD_DIR not set}"
|
|
10
|
+
DEST_DIR="$TARGET_BUILD_DIR/$FRAMEWORK_NAME.framework"
|
|
11
|
+
|
|
12
|
+
if [ "YES" = "${OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED:-NO}" ]; then
|
|
13
|
+
if [ -d "$DEST_DIR" ]; then
|
|
14
|
+
echo "Skipping Gradle build task invocation due to OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED environment variable set to \"YES\""
|
|
15
|
+
exit 0
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
echo "[KMP] OVERRIDE_KOTLIN_BUILD_IDE_SUPPORTED=YES but framework is missing at: $DEST_DIR"
|
|
19
|
+
echo "[KMP] Falling back to building framework via Gradle."
|
|
20
|
+
fi
|
|
21
|
+
|
|
22
|
+
SDK_NAME_VALUE="${SDK_NAME:-}"
|
|
23
|
+
CONFIGURATION_NAME="${CONFIGURATION:-Debug}"
|
|
24
|
+
CONFIGURATION_LOWER="$(printf '%s' "$CONFIGURATION_NAME" | tr '[:upper:]' '[:lower:]')"
|
|
25
|
+
|
|
26
|
+
if echo "$SDK_NAME_VALUE" | grep -qi "simulator"; then
|
|
27
|
+
KOTLIN_TARGET="iosSimulatorArm64"
|
|
28
|
+
else
|
|
29
|
+
KOTLIN_TARGET="iosArm64"
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [ "$CONFIGURATION_NAME" = "Release" ]; then
|
|
33
|
+
if [ "$KOTLIN_TARGET" = "iosSimulatorArm64" ]; then
|
|
34
|
+
TASK=":library:linkReleaseFrameworkIosSimulatorArm64"
|
|
35
|
+
else
|
|
36
|
+
TASK=":library:linkReleaseFrameworkIosArm64"
|
|
37
|
+
fi
|
|
38
|
+
else
|
|
39
|
+
if [ "$KOTLIN_TARGET" = "iosSimulatorArm64" ]; then
|
|
40
|
+
TASK=":library:linkDebugFrameworkIosSimulatorArm64"
|
|
41
|
+
else
|
|
42
|
+
TASK=":library:linkDebugFrameworkIosArm64"
|
|
43
|
+
fi
|
|
44
|
+
fi
|
|
45
|
+
|
|
46
|
+
echo "[KMP] Building framework via Gradle task: $TASK"
|
|
47
|
+
(cd "$ROOT_DIR" && ./gradlew "$TASK")
|
|
48
|
+
|
|
49
|
+
SRC_FRAMEWORK="$ROOT_DIR/library/build/bin/$KOTLIN_TARGET/${CONFIGURATION_LOWER}Framework/$FRAMEWORK_NAME.framework"
|
|
50
|
+
if [ ! -d "$SRC_FRAMEWORK" ]; then
|
|
51
|
+
echo "[KMP] Framework not found at: $SRC_FRAMEWORK"
|
|
52
|
+
exit 1
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
rm -rf "$DEST_DIR"
|
|
56
|
+
cp -R "$SRC_FRAMEWORK" "$DEST_DIR"
|
|
57
|
+
|
|
58
|
+
echo "[KMP] Framework ready: $DEST_DIR"
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import com.android.build.api.dsl.androidLibrary
|
|
2
|
+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
3
|
+
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTarget
|
|
4
|
+
import org.jetbrains.kotlin.gradle.plugin.mpp.apple.XCFramework
|
|
5
|
+
|
|
6
|
+
plugins {
|
|
7
|
+
alias(libs.plugins.kotlinMultiplatform)
|
|
8
|
+
alias(libs.plugins.android.kotlin.multiplatform.library)
|
|
9
|
+
alias(libs.plugins.kotlinCompose)
|
|
10
|
+
alias(libs.plugins.composeMultiplatform)
|
|
11
|
+
alias(libs.plugins.vanniktech.mavenPublish)
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
group = "__GROUP_ID__"
|
|
15
|
+
version = "__VERSION__"
|
|
16
|
+
|
|
17
|
+
val frameworkName = "__FRAMEWORK_NAME__"
|
|
18
|
+
val xcframework = XCFramework(frameworkName)
|
|
19
|
+
|
|
20
|
+
kotlin {
|
|
21
|
+
androidLibrary {
|
|
22
|
+
namespace = "__PACKAGE__.library"
|
|
23
|
+
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
24
|
+
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
25
|
+
|
|
26
|
+
withJava()
|
|
27
|
+
|
|
28
|
+
compilations.configureEach {
|
|
29
|
+
compileTaskProvider.configure {
|
|
30
|
+
compilerOptions {
|
|
31
|
+
jvmTarget.set(JvmTarget.JVM_11)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
iosArm64()
|
|
38
|
+
iosSimulatorArm64()
|
|
39
|
+
|
|
40
|
+
__EXTRA_KOTLIN_TARGETS__
|
|
41
|
+
|
|
42
|
+
targets.withType(KotlinNativeTarget::class.java).configureEach {
|
|
43
|
+
binaries.framework {
|
|
44
|
+
baseName = frameworkName
|
|
45
|
+
isStatic = true
|
|
46
|
+
binaryOption("bundleId", "__IOS_FRAMEWORK_BUNDLE_ID__")
|
|
47
|
+
xcframework.add(this)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
sourceSets {
|
|
52
|
+
commonMain.dependencies {
|
|
53
|
+
implementation(compose.runtime)
|
|
54
|
+
implementation(compose.foundation)
|
|
55
|
+
implementation(compose.material3)
|
|
56
|
+
implementation(compose.ui)
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
commonTest.dependencies {
|
|
60
|
+
implementation(libs.kotlin.test)
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
mavenPublishing {
|
|
66
|
+
coordinates(group.toString(), "__ARTIFACT_ID__", version.toString())
|
|
67
|
+
|
|
68
|
+
pom {
|
|
69
|
+
name.set("__ARTIFACT_ID__")
|
|
70
|
+
description.set("A Compose Multiplatform UI library.")
|
|
71
|
+
}
|
|
72
|
+
}
|
package/template/base-cmp/library/src/iosMain/kotlin/__PACKAGE_PATH__/MainViewControllerFactory.kt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
package __PACKAGE__
|
|
2
|
+
|
|
3
|
+
import androidx.compose.ui.window.ComposeUIViewController
|
|
4
|
+
import platform.UIKit.UIViewController
|
|
5
|
+
|
|
6
|
+
class MainViewControllerFactory {
|
|
7
|
+
fun create(): UIViewController {
|
|
8
|
+
return ComposeUIViewController {
|
|
9
|
+
LibraryRoot()
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
pluginManagement {
|
|
2
|
+
repositories {
|
|
3
|
+
google()
|
|
4
|
+
mavenCentral()
|
|
5
|
+
gradlePluginPortal()
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
dependencyResolutionManagement {
|
|
10
|
+
repositories {
|
|
11
|
+
google()
|
|
12
|
+
mavenCentral()
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
rootProject.name = "__PROJECT_NAME__"
|
|
17
|
+
include(":library")
|
|
18
|
+
include(":androidApp")
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
2
|
+
|
|
3
|
+
plugins {
|
|
4
|
+
alias(libs.plugins.android.application)
|
|
5
|
+
alias(libs.plugins.kotlinAndroid)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
android {
|
|
9
|
+
namespace = "__PACKAGE__.androidapp"
|
|
10
|
+
compileSdk = libs.versions.android.compileSdk.get().toInt()
|
|
11
|
+
|
|
12
|
+
defaultConfig {
|
|
13
|
+
applicationId = "__ANDROID_APPLICATION_ID__"
|
|
14
|
+
minSdk = libs.versions.android.minSdk.get().toInt()
|
|
15
|
+
targetSdk = libs.versions.android.compileSdk.get().toInt()
|
|
16
|
+
versionCode = 1
|
|
17
|
+
versionName = "1.0"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
compileOptions {
|
|
21
|
+
sourceCompatibility = JavaVersion.VERSION_11
|
|
22
|
+
targetCompatibility = JavaVersion.VERSION_11
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
kotlin {
|
|
28
|
+
compilerOptions {
|
|
29
|
+
jvmTarget.set(JvmTarget.JVM_11)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
dependencies {
|
|
34
|
+
implementation(project(":library"))
|
|
35
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
|
2
|
+
<application
|
|
3
|
+
android:label="__PROJECT_NAME__"
|
|
4
|
+
android:theme="@android:style/Theme.Material.Light.NoActionBar">
|
|
5
|
+
<activity
|
|
6
|
+
android:name="__PACKAGE__.androidapp.MainActivity"
|
|
7
|
+
android:exported="true">
|
|
8
|
+
<intent-filter>
|
|
9
|
+
<action android:name="android.intent.action.MAIN" />
|
|
10
|
+
<category android:name="android.intent.category.LAUNCHER" />
|
|
11
|
+
</intent-filter>
|
|
12
|
+
</activity>
|
|
13
|
+
</application>
|
|
14
|
+
</manifest>
|
package/template/base-kmp/androidApp/src/main/kotlin/__PACKAGE_PATH__/androidapp/MainActivity.kt
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package __PACKAGE__.androidapp
|
|
2
|
+
|
|
3
|
+
import android.app.Activity
|
|
4
|
+
import android.os.Bundle
|
|
5
|
+
import android.widget.TextView
|
|
6
|
+
import __PACKAGE__.Greeting
|
|
7
|
+
|
|
8
|
+
class MainActivity : Activity() {
|
|
9
|
+
override fun onCreate(savedInstanceState: Bundle?) {
|
|
10
|
+
super.onCreate(savedInstanceState)
|
|
11
|
+
|
|
12
|
+
val textView = TextView(this)
|
|
13
|
+
textView.text = Greeting().greet()
|
|
14
|
+
|
|
15
|
+
setContentView(textView)
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
plugins {
|
|
2
|
+
alias(libs.plugins.android.application) apply false
|
|
3
|
+
alias(libs.plugins.android.kotlin.multiplatform.library) apply false
|
|
4
|
+
alias(libs.plugins.kotlinAndroid) apply false
|
|
5
|
+
alias(libs.plugins.kotlinCompose) apply false
|
|
6
|
+
alias(libs.plugins.kotlinMultiplatform) apply false
|
|
7
|
+
alias(libs.plugins.composeMultiplatform) apply false
|
|
8
|
+
alias(libs.plugins.vanniktech.mavenPublish) apply false
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
[versions]
|
|
2
|
+
agp = "8.13.0"
|
|
3
|
+
kotlin = "2.2.20"
|
|
4
|
+
android-minSdk = "24"
|
|
5
|
+
android-compileSdk = "36"
|
|
6
|
+
vanniktechMavenPublish = "0.34.0"
|
|
7
|
+
compose = "1.9.3"
|
|
8
|
+
androidxActivityCompose = "1.10.0"
|
|
9
|
+
|
|
10
|
+
[libraries]
|
|
11
|
+
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
|
|
12
|
+
androidx-activity-compose = { module = "androidx.activity:activity-compose", version.ref = "androidxActivityCompose" }
|
|
13
|
+
|
|
14
|
+
[plugins]
|
|
15
|
+
android-kotlin-multiplatform-library = { id = "com.android.kotlin.multiplatform.library", version.ref = "agp" }
|
|
16
|
+
android-application = { id = "com.android.application", version.ref = "agp" }
|
|
17
|
+
kotlinMultiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
|
|
18
|
+
kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
|
19
|
+
kotlinCompose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
|
20
|
+
composeMultiplatform = { id = "org.jetbrains.compose", version.ref = "compose" }
|
|
21
|
+
vanniktech-mavenPublish = { id = "com.vanniktech.maven.publish", version.ref = "vanniktechMavenPublish" }
|
|
Binary file
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Gradle
|
|
2
|
+
org.gradle.jvmargs=-Xmx4096M -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options\="-Xmx4096M"
|
|
3
|
+
org.gradle.caching=true
|
|
4
|
+
org.gradle.configuration-cache=true
|
|
5
|
+
|
|
6
|
+
# Kotlin
|
|
7
|
+
kotlin.code.style=official
|
|
8
|
+
|
|
9
|
+
# MPP
|
|
10
|
+
kotlin.mpp.enableCInteropCommonization=true
|
|
11
|
+
|
|
12
|
+
# Android
|
|
13
|
+
android.useAndroidX=true
|
|
14
|
+
android.nonTransitiveRClass=true
|