Skip to content

Commit 3cef290

Browse files
committed
misc: Add copyright header
1 parent 75ee222 commit 3cef290

File tree

128 files changed

+757
-315
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

128 files changed

+757
-315
lines changed

.github/workflows/test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,15 @@ jobs:
3535
java-version: '21'
3636
- name: Build with Gradle
3737
uses: gradle/actions/setup-gradle@v4
38-
- name: Run the Test
38+
- name: Run check
39+
if: matrix.os == 'macos-latest'
40+
run: ./gradlew check
41+
- name: Run test
3942
run: ./gradlew ${{ matrix.target }}
43+
- name: Upload reports
44+
if: failure()
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: reports
48+
path: |
49+
**/build/reports/**

build.gradle.kts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
plugins {
25
id("root.publication")
36
alias(libs.plugins.android.application) apply false
47
alias(libs.plugins.android.library) apply false
58
alias(libs.plugins.compose.compiler) apply false
69
alias(libs.plugins.jetbrains.compose) apply false
7-
alias(libs.plugins.kotlin.multiplatform) apply false
810
alias(libs.plugins.jetbrains.dokka) apply false
11+
alias(libs.plugins.kotlin.multiplatform) apply false
12+
alias(libs.plugins.spotless) apply false
913
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
plugins {
25
`kotlin-dsl`
36
}

convention-plugins/settings.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
@file:Suppress("UnstableApiUsage")
25

36
pluginManagement {

convention-plugins/src/main/kotlin/module.publication.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
import java.io.FileInputStream
25
import java.util.Properties
36

convention-plugins/src/main/kotlin/root.publication.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
allprojects {
25
group = "top.yukonga.miuix.kmp"
36
version = "0.4.3"

example/build.gradle.kts

Lines changed: 31 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
@file:Suppress("UnstableApiUsage")
25

36
import com.android.build.gradle.internal.api.BaseVariantOutputImpl
@@ -10,6 +13,7 @@ plugins {
1013
alias(libs.plugins.compose.compiler)
1114
alias(libs.plugins.jetbrains.compose)
1215
alias(libs.plugins.kotlin.multiplatform)
16+
alias(libs.plugins.spotless)
1317
}
1418

1519
val appName = "Miuix"
@@ -30,28 +34,31 @@ kotlin {
3034
listOf(
3135
iosX64(),
3236
iosArm64(),
33-
iosSimulatorArm64()
37+
iosSimulatorArm64(),
3438
).forEach {
3539
it.binaries.framework {
3640
baseName = "shared"
3741
isStatic = true
38-
freeCompilerArgs += listOf(
39-
"-linker-option", "-framework", "-linker-option", "Metal",
40-
"-linker-option", "-framework", "-linker-option", "CoreText",
41-
"-linker-option", "-framework", "-linker-option", "CoreGraphics"
42-
)
42+
freeCompilerArgs +=
43+
listOf(
44+
"-linker-option", "-framework", "-linker-option", "Metal",
45+
"-linker-option", "-framework", "-linker-option", "CoreText",
46+
"-linker-option", "-framework", "-linker-option",
47+
"CoreGraphics",
48+
)
4349
}
4450
}
4551

4652
listOf(
4753
macosX64(),
48-
macosArm64()
54+
macosArm64(),
4955
).forEach { macosTarget ->
5056
macosTarget.binaries.executable {
5157
entryPoint = "main"
52-
freeCompilerArgs += listOf(
53-
"-linker-option", "-framework", "-linker-option", "Metal"
54-
)
58+
freeCompilerArgs +=
59+
listOf(
60+
"-linker-option", "-framework", "-linker-option", "Metal",
61+
)
5562
}
5663
}
5764

@@ -190,14 +197,24 @@ compose.desktop {
190197
}
191198
}
192199

200+
spotless {
201+
kotlin {
202+
target("src/**/*.kt")
203+
licenseHeaderFile(rootProject.file("/spotless/copyright.txt"), "(^(?![\\/ ]\\**).*$)")
204+
}
205+
206+
kotlinGradle {
207+
target("*.kts")
208+
licenseHeaderFile(rootProject.file("/spotless/copyright.txt"), "(^(?![\\/ ]\\**).*$)")
209+
}
210+
}
211+
193212
fun getGitCommitCount(): Int {
194213
val process = Runtime.getRuntime().exec(arrayOf("git", "rev-list", "--count", "HEAD"))
195214
return process.inputStream.bufferedReader().use { it.readText().trim().toInt() }
196215
}
197216

198-
fun getVersionCode(): Int {
199-
return getGitCommitCount()
200-
}
217+
fun getVersionCode(): Int = getGitCommitCount()
201218

202219
val generateVersionInfo by tasks.registering {
203220
doLast {
@@ -216,7 +233,7 @@ val generateVersionInfo by tasks.registering {
216233
const val JDK_VERSION = "${System.getProperty("java.version")}"
217234
218235
}
219-
""".trimIndent()
236+
""".trimIndent(),
220237
)
221238
}
222239
}

example/src/androidMain/kotlin/Preview.android.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
package top.yukonga.miuix.uitest
25

36
import App

example/src/androidMain/kotlin/top/yukonga/miuix/uitest/MainActivity.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
package top.yukonga.miuix.uitest
25

36
import App
@@ -14,7 +17,6 @@ import androidx.compose.runtime.mutableIntStateOf
1417
import androidx.compose.runtime.remember
1518

1619
class MainActivity : ComponentActivity() {
17-
1820
override fun onCreate(savedInstanceState: Bundle?) {
1921
super.onCreate(savedInstanceState)
2022

@@ -38,5 +40,4 @@ class MainActivity : ComponentActivity() {
3840
App(colorMode)
3941
}
4042
}
41-
42-
}
43+
}

example/src/commonMain/kotlin/App.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// Copyright 2025, miuix-kotlin-multiplatform contributors
2+
// SPDX-License-Identifier: Apache-2.0
3+
14
import androidx.compose.runtime.Composable
25
import androidx.compose.runtime.MutableState
36
import androidx.compose.runtime.mutableStateOf

0 commit comments

Comments
 (0)