This repository has been archived by the owner on Oct 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
129 lines (116 loc) · 3.63 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import org.danilopianini.gradle.mavencentral.mavenCentral
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`java-gradle-plugin`
id("org.danilopianini.git-sensitive-semantic-versioning")
kotlin("jvm")
id("com.gradle.plugin-publish")
id("org.danilopianini.publish-on-central")
id("org.jetbrains.dokka")
id("kotlin-qa")
}
gitSemVer {
buildMetadataSeparator.set("-")
}
group = "org.danilopianini"
val projectId = "$group.$name"
val fullName = "Gradle Latex Plugin"
val websiteUrl = "https://github.com/DanySK/gradle-latex"
val projectDetails = "A plugin for compiling LaTeX, inspired by https://github.com/csabasulyok/gradle-latex"
val pluginImplementationClass = "org.danilopianini.gradle.latex.Latex"
repositories {
mavenCentral()
}
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(gradleApi())
implementation(gradleKotlinDsl())
testImplementation(gradleTestKit())
testImplementation("io.github.classgraph:classgraph:_")
testImplementation("com.uchuhimo:konf-yaml:_")
testImplementation("io.kotest:kotest-runner-junit5-jvm:_")
testImplementation("io.kotest:kotest-assertions-core-jvm:_")
testImplementation("io.kotest:kotest-property-jvm:_")
}
tasks.withType<KotlinCompile> {
kotlinOptions {
allWarningsAsErrors = true
jvmTarget = JavaVersion.VERSION_1_8.toString()
}
}
tasks.withType<Copy> {
duplicatesStrategy = org.gradle.api.file.DuplicatesStrategy.WARN
}
publishOnCentral {
projectDescription = projectDetails
projectLongName = fullName
repository("https://maven.pkg.github.com/danysk/gradle-latex") {
user = "DanySK"
password = System.getenv("GITHUB_TOKEN")
}
}
tasks {
"test"(Test::class) {
useJUnitPlatform()
testLogging.showStandardStreams = true
testLogging {
showCauses = true
showStackTraces = true
showStandardStreams = true
events(*TestLogEvent.values())
exceptionFormat = TestExceptionFormat.FULL
}
}
register("createClasspathManifest") {
val outputDir = file("$buildDir/$name")
inputs.files(sourceSets.main.get().runtimeClasspath)
outputs.dir(outputDir)
doLast {
outputDir.mkdirs()
file("$outputDir/plugin-classpath.txt").writeText(sourceSets.main.get().runtimeClasspath.joinToString("\n"))
}
}
}
// Add the classpath file to the test runtime classpath
dependencies {
testRuntimeOnly(files(tasks["createClasspathManifest"]))
}
publishing {
publications {
withType<MavenPublication> {
pom {
developers {
developer {
name.set("Danilo Pianini")
email.set("danilo.pianini@gmail.com")
url.set("http://www.danilopianini.org/")
}
}
}
}
}
}
pluginBundle {
website = websiteUrl
vcsUrl = websiteUrl
tags = listOf("maven", "maven central", "ossrh", "central", "publish")
}
gradlePlugin {
plugins {
create("GradleLatex") {
id = projectId
displayName = fullName
description = projectDetails
implementationClass = pluginImplementationClass
}
}
}
if (System.getenv("CI") == true.toString()) {
signing {
val signingKey: String? by project
val signingPassword: String? by project
useInMemoryPgpKeys(signingKey, signingPassword)
}
}