-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
executable file
·72 lines (64 loc) · 2.26 KB
/
build.gradle.kts
File metadata and controls
executable file
·72 lines (64 loc) · 2.26 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
plugins {
`kotlin-dsl`
`java-gradle-plugin`
`maven-publish`
}
group = "com.goodanser.clj-android"
version = "0.5.0-SNAPSHOT"
description = "Clojure plugin for the Gradle-based Android build system"
repositories {
google()
mavenCentral()
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}
dependencies {
compileOnly("com.android.tools.build:gradle:8.9.0")
testImplementation("com.android.tools.build:gradle:8.9.0")
testImplementation("junit:junit:4.13.2")
}
// Generate build-info.properties so the plugin can detect stale daemon classloaders.
val generateBuildInfo = tasks.register("generateBuildInfo") {
val outputDir = layout.buildDirectory.dir("generated/build-info")
val propsFile = outputDir.map { it.file("android-clojure-plugin-build-info.properties") }
outputs.dir(outputDir)
// Re-run whenever any plugin source file changes.
inputs.files(fileTree("src/main/kotlin") { include("**/*.kt") })
.withPathSensitivity(org.gradle.api.tasks.PathSensitivity.RELATIVE)
doLast {
val f = propsFile.get().asFile
f.parentFile.mkdirs()
f.writeText("build.timestamp=${System.currentTimeMillis()}\n")
}
}
sourceSets["main"].resources.srcDir(generateBuildInfo.map { it.outputs.files.singleFile })
gradlePlugin {
plugins {
create("androidClojure") {
id = "com.goodanser.clj-android.android-clojure"
implementationClass = "com.goodanser.clj_android.gradle.AndroidClojurePlugin"
displayName = "Android Clojure Plugin"
description = "Integrates Clojure AOT compilation into Android Gradle builds"
}
}
}
// Test publishing repo — only configured when explicitly requested via
// -PpublishToTestRepo to avoid F-Droid scanner flagging it as an unknown
// maven repository.
if (findProperty("publishToTestRepo") != null) {
publishing {
repositories {
maven {
name = "test"
url = uri(layout.buildDirectory.dir("test-repo"))
}
}
}
}