-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
102 lines (82 loc) · 2.56 KB
/
build.gradle.kts
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
buildscript {
dependencyLocking {
lockAllConfigurations()
lockMode.set(LockMode.STRICT)
}
}
plugins {
id("java-gradle-plugin")
id("org.jetbrains.kotlin.jvm") version "1.6.0"
id("org.jlleitschuh.gradle.ktlint") version "10.2.0"
}
val jdkVersion: JavaLanguageVersion = JavaLanguageVersion.of(11)
val functionalTestSourceSet: SourceSet = sourceSets.create("functionalTest")
configurations["functionalTestImplementation"].extendsFrom(configurations["testImplementation"])
dependencyLocking {
lockAllConfigurations()
lockMode.set(LockMode.STRICT)
}
gradlePlugin {
testSourceSets(functionalTestSourceSet)
plugins.create("denoPlugin") {
id = "org.rognan.gradle.deno-plugin"
displayName = "Deno Gradle Plugin"
description = "Use Deno, a runtime for JavaScript and Typescript, as part of your Gradle build."
implementationClass = "org.rognan.gradle.deno.DenoPlugin"
}
}
java {
toolchain {
languageVersion.set(jdkVersion)
}
}
kotlin {
jvmToolchain {
(this as JavaToolchainSpec).languageVersion.set(jdkVersion)
}
}
tasks.withType<JavaCompile>().configureEach {
options.release.set(8)
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
allWarningsAsErrors = true
}
}
tasks.withType<Test>().configureEach {
useJUnitPlatform()
}
val functionalTest by tasks.registering(Test::class) {
group = "Verification"
testClassesDirs = functionalTestSourceSet.output.classesDirs
classpath = functionalTestSourceSet.runtimeClasspath
}
tasks.check {
dependsOn(functionalTest)
}
tasks.withType<AbstractArchiveTask>().configureEach {
isReproducibleFileOrder = true
isPreserveFileTimestamps = false
// 755 and 644, respectively, when converted from base-10 (decimal) to base-8 (octal)
dirMode = 493
fileMode = 420
}
tasks.named<Jar>("jar") {
archiveBaseName.set("deno-plugin")
manifest.attributes["Implementation-Title"] = "deno-plugin"
manifest.attributes["Implementation-Version"] = project.version
manifest.attributes["Created-By"] =
"${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
from(rootDir) {
include("LICENSE")
}
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testImplementation("org.junit.jupiter:junit-jupiter-params:5.8.1")
testImplementation("org.assertj:assertj-core:3.21.0")
}