Skip to content
This repository was archived by the owner on Oct 3, 2021. It is now read-only.

Commit 870670d

Browse files
author
Krystian Panek
committed
OSGified kotlin
1 parent 68279b6 commit 870670d

File tree

16 files changed

+797
-100
lines changed

16 files changed

+797
-100
lines changed

build.gradle.kts

+16-24
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ defaultTasks(":instanceSetup", ":packageDeploy")
1717
description = "Slinkt"
1818
group = "com.cognifide"
1919

20-
repositories {
21-
jcenter()
22-
maven("https://repo.adobe.com/nexus/content/groups/public")
23-
maven("https://dl.bintray.com/acs/releases")
20+
allprojects {
21+
repositories {
22+
jcenter()
23+
maven("https://repo.adobe.com/nexus/content/groups/public")
24+
maven("https://dl.bintray.com/acs/releases")
25+
maven("https://dl.bintray.com/jetbrains/intellij-third-party-dependencies")
26+
}
2427
}
2528

2629
dependencies {
@@ -39,12 +42,8 @@ dependencies {
3942
compileOnly("com.google.code.gson:gson:2.8.2")
4043
compileOnly("joda-time:joda-time:2.9.1")
4144

42-
43-
compileOnly("org.jetbrains.kotlin:kotlin-script-runtime:1.4.0")
4445
compileOnly("org.jetbrains.kotlin:kotlin-script-util:1.4.0")
4546
compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.0")
46-
compileOnly("org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.0")
47-
compileOnly("org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.0") // runtime
4847

4948
compileOnly("com.adobe.aem:uber-jar:6.5.0:apis")
5049

@@ -74,26 +73,20 @@ tasks {
7473
}
7574
packageCompose {
7675
installBundle("org.jetbrains.kotlin:kotlin-osgi-bundle:1.4.0")
76+
installBundleProject(":kotlin:compiler-embeddable")
77+
installBundleProject(":kotlin:script-runtime")
78+
installBundleProject(":kotlin:script-util")
79+
installBundleProject(":kotlin:scripting-common")
80+
installBundleProject(":kotlin:scripting-jvm")
81+
installBundleProject(":kotlin:scripting-compiler")
82+
installBundleProject(":kotlin:scripting-compiler-embeddable")
83+
installBundleProject(":kotlin:scripting-compiler-impl-embeddable")
7784
}
7885
jar {
7986
bundle {
8087
attribute("ScriptEngine-Name", "kts")
8188
attribute("ScriptEngine-Version", "1.4")
82-
83-
// embed jsr
84-
attribute("Include-Resource", "kotlin-script-util-1.4.0.jar,kotlin-script-runtime-1.4.0.jar,kotlin-scripting-compiler-embeddable-1.4.0.jar,/Users/krystian.panek/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-scripting-compiler-impl-embeddable/1.4.0/b2446c3e97bc1aeb4c5e5565c25393f377827aca/kotlin-scripting-compiler-impl-embeddable-1.4.0.jar,trove4j-1.0.20181211.jar,kotlin-scripting-compiler-impl-embeddable-1.4.0.jar")
85-
attribute("Bundle-ClassPath", ".,kotlin-script-util-1.4.0.jar,kotlin-script-runtime-1.4.0.jar,kotlin-scripting-compiler-embeddable-1.4.0.jar,kotlin-scripting-compiler-impl-embeddable-1.4.0.jar,trove4j-1.0.20181211.jar,kotlin-scripting-compiler-impl-embeddable-1.4.0.jar")
86-
87-
exportPackage("kotlin.script.*")
88-
privatePackage("org.jetbrains.kotlin.*", "org.jetbrains.jps.*", "gnu.trove.*")
89-
excludePackage("org.sonatype.aether.*", "com.jcabi.aether", "sun.misc", "sun.nio.ch", "com.sun.*", "gnu.trove",
90-
"org.jetbrains.kotlin.com.*", "org.jetbrains.kotlin.org.*", "org.jetbrains.org.*",
91-
"org.jetbrains.ide", "org.jetbrains.annotations", "org.checkerframework.*",
92-
// TODO ?
93-
"javaslang.*",
94-
"net.rubygrapefruit.platform",
95-
"kotlinx.coroutines"
96-
)
89+
exportPackage("com.neva.slinkt")
9790
}
9891
}
9992
}
@@ -108,4 +101,3 @@ publishing {
108101
}
109102
}
110103
}
111-

gradle.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Project specific
2-
version=1.0.0-SNAPSHOT
2+
version=1.4.0-SNAPSHOT
3+
4+
bundle.attributesConvention=false
35

46
# Performance tuning
57
org.gradle.daemon=true
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-compiler-embeddable:1.4.0")
9+
compileOnly("org.jetbrains.intellij.deps:trove4j:1.0.20181211")
10+
}
11+
12+
tasks {
13+
jar {
14+
bundle {
15+
attribute("Include-Resource", "@kotlin-compiler-embeddable-1.4.0.jar")
16+
privatePackage("javaslang.*", "gnu.trove.*", "kotlin.*")
17+
exportPackage("org.jetbrains.kotlin.*")
18+
excludePackage(
19+
"org.sonatype.aether.*",
20+
"com.jcabi.aether",
21+
"sun.misc",
22+
"sun.nio.ch",
23+
"com.sun.*",
24+
"org.jetbrains.ide",
25+
"org.jetbrains.annotations",
26+
"org.jetbrains.kotlin.com.google.errorprone.*",
27+
"org.checkerframework.*",
28+
// specific
29+
"org.jetbrains.kotlin.com.intellij.ui.mac.foundation",
30+
"org.jetbrains.kotlin.com.intellij.util.ui",
31+
"org.jetbrains.kotlin.org.apache.commons.collections.map" // TODO ?
32+
)
33+
}
34+
}
35+
}
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-script-runtime:1.4.0")
9+
}
10+
11+
tasks {
12+
jar {
13+
bundle {
14+
attribute("Include-Resource", "@kotlin-script-runtime-1.4.0.jar")
15+
exportPackage("kotlin.script.*")
16+
// excludePackage(
17+
// "org.sonatype.aether.*",
18+
// "com.jcabi.aether",
19+
// "sun.misc",
20+
// "sun.nio.ch",
21+
// "com.sun.*",
22+
// "org.jetbrains.ide",
23+
// "org.jetbrains.annotations",
24+
// "org.jetbrains.kotlin.com.google.errorprone.*",
25+
// "org.checkerframework.*"
26+
// )
27+
}
28+
}
29+
}

kotlin/script-util/build.gradle.kts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-script-util:1.4.0")
9+
}
10+
11+
tasks {
12+
jar {
13+
bundle {
14+
attribute("Include-Resource", "@/Users/krystian.panek/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-script-util/1.4.0/7a46a84420efbeff02a9e2cb7306bbe288bf01cc/kotlin-script-util-1.4.0.jar")
15+
exportPackage("org.jetbrains.kotlin.*")
16+
excludePackage(
17+
"org.sonatype.aether.*",
18+
"com.jcabi.aether",
19+
"sun.misc",
20+
"sun.nio.ch",
21+
"com.sun.*",
22+
"org.jetbrains.ide",
23+
"org.jetbrains.annotations",
24+
"org.jetbrains.kotlin.com.google.errorprone.*",
25+
"org.checkerframework.*",
26+
// specific
27+
"kotlinx.coroutines.*",
28+
"net.rubygrapefruit.platform"
29+
)
30+
}
31+
}
32+
}
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-scripting-common:1.4.0")
9+
}
10+
11+
tasks {
12+
jar {
13+
bundle {
14+
attribute("Include-Resource", "@kotlin-scripting-common-1.4.0.jar")
15+
exportPackage("kotlin.script.*")
16+
excludePackage(
17+
"org.sonatype.aether.*",
18+
"com.jcabi.aether",
19+
"sun.misc",
20+
"sun.nio.ch",
21+
"com.sun.*",
22+
"org.jetbrains.ide",
23+
"org.jetbrains.annotations",
24+
"org.jetbrains.kotlin.com.google.errorprone.*",
25+
"org.checkerframework.*",
26+
// specific
27+
"kotlinx.coroutines.*",
28+
"net.rubygrapefruit.platform"
29+
)
30+
}
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.0")
9+
}
10+
11+
tasks {
12+
jar {
13+
bundle {
14+
attribute("Include-Resource", "@kotlin-scripting-compiler-embeddable-1.4.0.jar")
15+
exportPackage("org.jetbrains.kotlin.scripting.*")
16+
excludePackage(
17+
"org.sonatype.aether.*",
18+
"com.jcabi.aether",
19+
"sun.misc",
20+
"sun.nio.ch",
21+
"com.sun.*",
22+
"org.jetbrains.ide",
23+
"org.jetbrains.annotations",
24+
"org.jetbrains.kotlin.com.google.errorprone.*",
25+
"org.checkerframework.*",
26+
// specific
27+
"kotlinx.coroutines.*",
28+
"net.rubygrapefruit.platform"
29+
)
30+
}
31+
}
32+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-scripting-compiler-impl-embeddable:1.4.0")
9+
}
10+
11+
tasks {
12+
jar {
13+
bundle {
14+
attribute("Include-Resource", "@kotlin-scripting-compiler-impl-embeddable-1.4.0.jar")
15+
exportPackage("kotlin.script.*")
16+
excludePackage(
17+
"org.sonatype.aether.*",
18+
"com.jcabi.aether",
19+
"sun.misc",
20+
"sun.nio.ch",
21+
"com.sun.*",
22+
"org.jetbrains.ide",
23+
"org.jetbrains.annotations",
24+
"org.jetbrains.kotlin.com.google.errorprone.*",
25+
"org.checkerframework.*",
26+
// specific
27+
"kotlinx.coroutines.*",
28+
"net.rubygrapefruit.platform"
29+
)
30+
}
31+
}
32+
}
+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-scripting-compiler:1.4.0")
9+
compileOnly("org.jetbrains.intellij.deps:asm-all:8.0.1")
10+
}
11+
12+
tasks {
13+
jar {
14+
bundle {
15+
attribute("Include-Resource", "@kotlin-scripting-compiler-1.4.0.jar")
16+
exportPackage("org.jetbrains.kotlin.scripting.*", "org.jetbrains.org.objectweb.asm.*")
17+
excludePackage(
18+
"org.sonatype.aether.*",
19+
"com.jcabi.aether",
20+
"sun.misc",
21+
"sun.nio.ch",
22+
"com.sun.*",
23+
"org.jetbrains.ide",
24+
"org.jetbrains.annotations",
25+
"org.jetbrains.kotlin.com.google.errorprone.*",
26+
"org.checkerframework.*",
27+
// specific
28+
"kotlinx.coroutines.*",
29+
"net.rubygrapefruit.platform",
30+
"org.jetbrains.kotlin.js.*",
31+
"org.jline.*",
32+
"com.intellij.*" // TODO !!!!!!!!
33+
)
34+
}
35+
}
36+
}

kotlin/scripting-jvm/build.gradle.kts

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import com.cognifide.gradle.aem.bundle.tasks.bundle
2+
3+
plugins {
4+
id("com.cognifide.aem.bundle")
5+
}
6+
7+
dependencies {
8+
compileOnly("org.jetbrains.kotlin:kotlin-scripting-jvm:1.4.0")
9+
}
10+
11+
tasks {
12+
jar {
13+
bundle {
14+
attribute("Include-Resource", "@kotlin-scripting-jvm-1.4.0.jar")
15+
exportPackage("kotlin.script.*")
16+
excludePackage(
17+
"org.sonatype.aether.*",
18+
"com.jcabi.aether",
19+
"sun.misc",
20+
"sun.nio.ch",
21+
"com.sun.*",
22+
"org.jetbrains.ide",
23+
"org.jetbrains.annotations",
24+
"org.jetbrains.kotlin.com.google.errorprone.*",
25+
"org.checkerframework.*",
26+
// specific
27+
"kotlinx.coroutines.*",
28+
"net.rubygrapefruit.platform"
29+
)
30+
}
31+
}
32+
}

settings.gradle.kts

+9
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
rootProject.name = "slinkt"
2+
3+
include(":kotlin:compiler-embeddable")
4+
include(":kotlin:script-runtime")
5+
include(":kotlin:script-util")
6+
include(":kotlin:scripting-common")
7+
include(":kotlin:scripting-jvm")
8+
include(":kotlin:scripting-compiler")
9+
include(":kotlin:scripting-compiler-embeddable")
10+
include(":kotlin:scripting-compiler-impl-embeddable")

0 commit comments

Comments
 (0)