-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
71 lines (60 loc) · 2.15 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
plugins {
kotlin("js") version "1.5.10"
id("org.ajoberstar.git-publish") version "3.0.0"
id("org.ajoberstar.grgit") version "4.1.0"
}
allprojects {
group = "eu.koders"
version = "2021"
repositories {
mavenCentral()
maven(url = "https://ajoberstar.github.io/bintray-backup/")
}
}
kotlin {
js(IR) {
browser {
commonWebpackConfig {
cssSupport.enabled = true
}
}
useCommonJs()
binaries.executable()
sourceSets["main"].dependencies {
val reactVersion = "17.0.2"
val reactRouterVersion = "5.2.0"
val styledVersion = "5.3.0"
val kotlinWrapperVersion = "pre.213-kotlin-1.5.10"
implementation(project(":data"))
implementation("org.jetbrains.kotlin-wrappers:kotlin-react:$reactVersion-$kotlinWrapperVersion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-dom:$reactVersion-$kotlinWrapperVersion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-react-router-dom:$reactRouterVersion-$kotlinWrapperVersion")
implementation("org.jetbrains.kotlin-wrappers:kotlin-styled:$styledVersion-$kotlinWrapperVersion")
implementation(npm("react-markdown", "7.1.0"))
}
}
}
val auth = (project.findProperty("com.github.http.auth") as? String)?.split(":")
if (auth != null) {
System.setProperty("org.ajoberstar.grgit.auth.username", auth[0])
System.setProperty("org.ajoberstar.grgit.auth.password", auth[1])
}
gitPublish {
repoUri.set("https://github.com/KodeinKoders/kotlin-koders.eu.git")
branch.set("gh-pages")
contents.apply {
from("$projectDir/build/distributions")
}
val head = grgit.head()
commitMessage.set("${head.abbreviatedId}: ${head.fullMessage}")
}
task("deployWebsiteToGithubPages") {
group = "publishing"
dependsOn("gitPublishPush")
}
tasks["gitPublishCopy"].dependsOn("browserDistribution")
tasks["gitPublishCommit"].doFirst {
if (!grgit.status().isClean) {
error("Refusing to commit new pages on a non-clean repo. Please commit first.\n${grgit.status()}")
}
}