Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
testDemo
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
jiangyh
testDemo
Commits
cf79f399
Commit
cf79f399
authored
Dec 25, 2025
by
jiangyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增一个lib
parent
99e28c21
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
50 additions
and
2 deletions
+50
-2
build.gradle.kts
composeApp/build.gradle.kts
+1
-0
MainActivity.kt
...c/androidMain/kotlin/com/example/testdemo/MainActivity.kt
+9
-0
gradle.properties
gradle.properties
+3
-1
build.gradle.kts
lib-arith/build.gradle.kts
+28
-0
AndroidManifest.xml
lib-arith/src/androidMain/AndroidManifest.xml
+1
-0
Arith.kt
lib-arith/src/commonMain/kotlin/com/example/arith/Arith.kt
+6
-0
settings.gradle.kts
settings.gradle.kts
+2
-1
No files found.
composeApp/build.gradle.kts
View file @
cf79f399
...
...
@@ -35,6 +35,7 @@ kotlin {
sourceSets
{
androidMain
.
dependencies
{
implementation
(
libs
.
androidx
.
activity
.
compose
)
implementation
(
project
(
":lib-arith"
))
}
commonMain
.
dependencies
{
}
...
...
composeApp/src/androidMain/kotlin/com/example/testdemo/MainActivity.kt
View file @
cf79f399
...
...
@@ -27,7 +27,16 @@ class MainActivity : ComponentActivity() {
textSize
=
24f
}
val
resultAdd
=
com
.
example
.
arith
.
Arith
.
add
(
7
,
3
)
val
resultSub
=
com
.
example
.
arith
.
Arith
.
sub
(
7
,
3
)
val
addView
=
TextView
(
this
).
apply
{
text
=
"Add is ${resultAdd}, Sub is ${resultSub}"
textSize
=
24f
}
root
.
addView
(
msgView
)
root
.
addView
(
addView
)
setContentView
(
root
)
}
...
...
gradle.properties
View file @
cf79f399
...
...
@@ -12,3 +12,5 @@ android.nonTransitiveRClass=true
android.useAndroidX
=
true
org.gradle.java.home
=
/Users/jiangyuhuan/zulu-17.jdk/Contents/Home
kotlin.mpp.androidGradlePluginCompatibility.nowarn
=
true
kotlin.mpp.applyDefaultHierarchyTemplate
=
false
\ No newline at end of file
lib-arith/build.gradle.kts
0 → 100644
View file @
cf79f399
plugins
{
id
(
"org.jetbrains.kotlin.multiplatform"
)
id
(
"com.android.library"
)
}
kotlin
{
androidTarget
()
iosArm64
()
iosSimulatorArm64
()
iosX64
()
sourceSets
{
val
commonMain
by
getting
val
androidMain
by
getting
val
iosMain
by
creating
{
dependsOn
(
commonMain
)
}
val
iosArm64Main
by
getting
{
dependsOn
(
iosMain
)
}
val
iosSimulatorArm64Main
by
getting
{
dependsOn
(
iosMain
)
}
val
iosX64Main
by
getting
{
dependsOn
(
iosMain
)
}
}
}
android
{
namespace
=
"com.example.arith"
compileSdk
=
34
defaultConfig
{
minSdk
=
24
}
}
\ No newline at end of file
lib-arith/src/androidMain/AndroidManifest.xml
0 → 100644
View file @
cf79f399
<manifest
package=
"com.example.arith"
/>
\ No newline at end of file
lib-arith/src/commonMain/kotlin/com/example/arith/Arith.kt
0 → 100644
View file @
cf79f399
package
com.example.arith
object
Arith
{
fun
add
(
a
:
Int
,
b
:
Int
):
Int
=
a
+
b
fun
sub
(
a
:
Int
,
b
:
Int
):
Int
=
a
-
b
}
\ No newline at end of file
settings.gradle.kts
View file @
cf79f399
...
...
@@ -31,3 +31,4 @@ dependencyResolutionManagement {
}
include
(
":composeApp"
)
include
(
":lib-arith"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment