-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
78 lines (66 loc) · 2.51 KB
/
build.gradle.kts
File metadata and controls
78 lines (66 loc) · 2.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
plugins {
id("com.android.library")
`maven-publish`
}
group = "com.goodanser.clj-android"
version = "0.1.0-SNAPSHOT"
android {
namespace = "com.goodanser.clj_android.runtime.repl"
compileSdk = 35
defaultConfig {
minSdk = 26
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
// Include Clojure source files as resources so they can be loaded at runtime
sourceSets["main"].resources.srcDirs("src/main/clojure")
publishing {
singleVariant("release") {
withSourcesJar()
}
}
}
dependencies {
// Clojure runtime — compileOnly because the app provides it
compileOnly("org.clojure:clojure:1.12.0")
// AOSP dx library for JVM bytecode -> DEX translation at runtime
implementation("com.jakewharton.android.repackaged:dalvik-dx:9.0.0_r3")
// nREPL server
// nREPL 1.0.0: last version before Unix domain socket support (nrepl.socket)
// which requires java.net.UnixDomainSocketAddress (JDK 16+, not available on Android)
// implementation (not api) — clj-android.repl.server loads nREPL lazily via
// dynamic require, so consumers don't need nrepl on their compile classpath.
implementation("nrepl:nrepl:1.0.0")
}
// When consumed via includeBuild(), raw project configurations are exposed
// instead of published module metadata. AGP's published metadata includes
// these attributes automatically, but the raw configurations do not, so we
// add them here for composite-build compatibility.
afterEvaluate {
val categoryAttr = Attribute.of("org.gradle.category", Named::class.java)
val jvmEnvAttr = Attribute.of("org.gradle.jvm.environment", Named::class.java)
val kotlinPlatformAttr = Attribute.of("org.jetbrains.kotlin.platform.type", Named::class.java)
configurations.configureEach {
if (isCanBeConsumed && !isCanBeResolved && name != "archives") {
attributes {
attribute(categoryAttr, objects.named("library"))
attribute(jvmEnvAttr, objects.named("android"))
attribute(kotlinPlatformAttr, objects.named("androidJvm"))
}
}
}
}
publishing {
publications {
register<MavenPublication>("release") {
afterEvaluate {
from(components["release"])
}
groupId = "com.goodanser.clj-android"
artifactId = "runtime-repl"
version = project.version.toString()
}
}
}