Skip to content

Commit 4cb012c

Browse files
committed
Code Updates
0 parents  commit 4cb012c

34 files changed

+2207
-0
lines changed

.gitignore

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/modules.xml
9+
.idea/jarRepositories.xml
10+
.idea/compiler.xml
11+
.idea/libraries/
12+
*.iws
13+
*.iml
14+
*.ipr
15+
out/
16+
!**/src/main/**/out/
17+
!**/src/test/**/out/
18+
19+
### Kotlin ###
20+
.kotlin
21+
22+
### Eclipse ###
23+
.apt_generated
24+
.classpath
25+
.factorypath
26+
.project
27+
.settings
28+
.springBeans
29+
.sts4-cache
30+
bin/
31+
!**/src/main/**/bin/
32+
!**/src/test/**/bin/
33+
34+
### NetBeans ###
35+
/nbproject/private/
36+
/nbbuild/
37+
/dist/
38+
/nbdist/
39+
/.nb-gradle/
40+
41+
### VS Code ###
42+
.vscode/
43+
44+
### Mac OS ###
45+
.DS_Store

.idea/.gitignore

+8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/gradle.xml

+16
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/misc.xml

+10
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/vcs.xml

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
# kotlinc for Android
3+
4+
5+
## English
6+
7+
This project can build the `kotlin-compiler` jar file that runs on Android
8+
9+
10+
## 中文
11+
12+
该项目可以生成在Android上运行的“kotlin-compiler”jar文件
13+
14+
15+
### build / 打包
16+
17+
```shell
18+
19+
gradle build
20+
```
21+

build.gradle.kts

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
2+
val kotlinVersion = "2.1.10"
3+
4+
plugins {
5+
kotlin("jvm") version "2.1.10"
6+
id("java-library")
7+
id("com.gradleup.shadow") version "9.0.0-beta8"
8+
}
9+
10+
group = "org.jetbrains.kotlin"
11+
version = "2.1.10"
12+
13+
repositories {
14+
mavenCentral()
15+
}
16+
17+
18+
tasks {
19+
named<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar>("shadowJar") {
20+
exclude("META-INF/maven/org.jetbrains/*/pom.xml")
21+
exclude("META-INF/maven/org.jetbrains/*/pom.properties")
22+
23+
exclude("sun/misc/Unsafe.class")
24+
25+
exclude("com/google/common/**")
26+
exclude("org/jdom/**")
27+
exclude("kotlin/**")
28+
exclude("org/jetbrains/annotations/Nls**")
29+
exclude("android/**")
30+
exclude("dalvik/**")
31+
exclude("org/lsposed/hiddenapibypass/**")
32+
33+
34+
35+
//If `ktfmt` is imported, please uncomment the following code
36+
// exclude("org/checkerframework/**")
37+
// exclude("com/google/errorprone/**")
38+
// exclude("com/google/thirdparty/**")
39+
40+
dependencies {
41+
exclude(dependency("org.jetbrains.kotlin:kotlin-reflect:1.6.10"))
42+
exclude(dependency("org.jetbrains.intellij.deps:trove4j:1.0.20200330"))
43+
exclude(dependency("org.jetbrains.kotlinx:kotlinx-coroutines-core-jvm:1.6.4"))
44+
exclude(dependency("org.jetbrains.kotlin:kotlin-stdlib-jdk8:2.1.0"))
45+
exclude(dependency("org.jetbrains.kotlin:kotlin-script-runtime:2.1.0"))
46+
exclude(dependency("io.github.itsaky:nb-javac-android:17.0.0.3"))
47+
exclude(dependency("org.jetbrains:annotations:26.0.1"))
48+
49+
// If `ktfmt` is imported, please uncomment the following code
50+
// exclude(dependency("com.google.googlejavaformat:google-java-format:1.23.0"))
51+
// exclude(dependency("com.google.guava:guava:32.0.0-jre"))
52+
// exclude(dependency("net.java.dev.jna:jna:4.2.2"))
53+
// exclude(dependency("org.jetbrains.kotlin:kotlin-test:2.0.0"))
54+
// exclude(dependency("org.checkerframework:checker-qual:3.33.0"))
55+
// exclude(dependency("com.google.j2objc:j2objc-annotations:2.8"))
56+
// exclude(dependency("com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava"))
57+
// exclude(dependency("com.google.guava:failureaccess:1.0.1"))
58+
// exclude(dependency("com.google.errorprone:error_prone_annotations:2.18.0"))
59+
// exclude(dependency("com.google.code.findbugs:jsr305:3.0.2"))
60+
// exclude(dependency("org.jspecify:jspecify:1.0.0"))
61+
// exclude(dependency("com.google.errorprone:error_prone_annotations:2.28.0"))
62+
// exclude(dependency("com.google.auto.value:auto-value-annotations:1.9"))
63+
// exclude(dependency("com.google.auto.service:auto-service-annotations:1.0.1"))
64+
}
65+
66+
archiveFileName.set("kotlin-compiler-$kotlinVersion.jar")
67+
}
68+
69+
assemble {
70+
dependsOn(shadowJar)
71+
}
72+
build {
73+
dependsOn(shadowJar)
74+
}
75+
}
76+
77+
dependencies {
78+
79+
compileOnly(files("libs/android-35.jar"))
80+
compileOnly(files("libs/hiddenapibypass-6.1.jar"))
81+
82+
implementation("io.github.itsaky:nb-javac-android:17.0.0.3")
83+
implementation("org.jetbrains.kotlin:kotlin-compiler:$kotlinVersion")
84+
implementation("org.jetbrains:annotations:26.0.1")
85+
86+
87+
// If you want to import `ktfmt` then please uncomment the following code
88+
// implementation("com.facebook:ktfmt:0.54")
89+
90+
91+
92+
93+
94+
}
95+
96+
tasks.test {
97+
useJUnitPlatform()
98+
}
99+
kotlin {
100+
jvmToolchain(21)
101+
}

gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
kotlin.code.style=official

gradle/wrapper/gradle-wrapper.jar

59.3 KB
Binary file not shown.
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#Sun Feb 23 19:13:17 CET 2025
2+
distributionBase=GRADLE_USER_HOME
3+
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
5+
zipStoreBase=GRADLE_USER_HOME
6+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)