-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add intellij-annotations module for Language
- Loading branch information
Showing
5 changed files
with
53 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* Copyright (C) 2024 OpenAni and contributors. | ||
* | ||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. | ||
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link. | ||
* | ||
* https://github.com/open-ani/ani/blob/main/LICENSE | ||
*/ | ||
|
||
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi | ||
|
||
plugins { | ||
kotlin("multiplatform") | ||
`ani-mpp-lib-targets` | ||
} | ||
|
||
kotlin { | ||
@OptIn(ExperimentalKotlinGradlePluginApi::class) | ||
compilerOptions.freeCompilerArgs.add("-Xexpect-actual-classes") | ||
|
||
sourceSets.getByName("jvmMain").dependencies { | ||
api(libs.jetbrains.annotations) | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
utils/intellij-annotations/src/commonMain/kotlin/Language.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
/* | ||
* Copyright (C) 2024 OpenAni and contributors. | ||
* | ||
* 此源代码的使用受 GNU AFFERO GENERAL PUBLIC LICENSE version 3 许可证的约束, 可以在以下链接找到该许可证. | ||
* Use of this source code is governed by the GNU AGPLv3 license, which can be found at the following link. | ||
* | ||
* https://github.com/open-ani/ani/blob/main/LICENSE | ||
*/ | ||
|
||
package org.intellij.lang.annotations // 必须和 IJ 相同 | ||
|
||
/** | ||
* @sample org.intellij.lang.annotations.Language | ||
*/ | ||
@OptIn(ExperimentalMultiplatform::class) | ||
@Retention(AnnotationRetention.SOURCE) // 我们不分发, 有 SOURCE 就够了 | ||
@OptionalExpectation | ||
expect annotation class Language( | ||
val value: String, | ||
val prefix: String = "", | ||
val suffix: String = "" | ||
) // no actual on any platform. 实际上 JVM 有这个类, 所以如果这里 JVM actual, 会有冲突 |