This repository has been archived by the owner on Jan 11, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
/
build.gradle.kts
101 lines (83 loc) · 2.94 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
/*
* Copyright 2018 Google Inc. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import net.researchgate.release.GitAdapter
import org.jetbrains.intellij.tasks.PublishTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.jetbrains.intellij") version "0.3.7"
id("com.diffplug.gradle.spotless") version "3.14.0"
id("net.researchgate.release") version "2.7.0"
kotlin("jvm") version "1.3.11"
}
allprojects {
repositories {
jcenter()
}
apply(plugin = "org.jetbrains.intellij")
apply(plugin = "kotlin")
apply(plugin = "com.diffplug.gradle.spotless")
intellij {
setPlugins("yaml")
type = project.properties["ideaEdition"].toString()
version = project.properties["ideaVersion"].toString()
intellijRepo = project.properties["intellijRepoUrl"].toString()
updateSinceUntilBuild = false
project.properties["alternativeIdePath"]?.let { alternativeIdePath = it.toString() }
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
dependencies {
testCompile("com.google.truth:truth:+") {
exclude(group = "com.google.guava", module = "guava")
}
testCompile("io.mockk:mockk:+") {
// this ensures kotlin plugin/version takes precedence, mockk updates less often
exclude(group = "org.jetbrains.kotlin", module = "kotlin-reflect")
}
}
spotless {
kotlin {
target("**/src/**/*.kt")
// Set ktlint to follow the Android Style Guide for source files
ktlint().userData(mapOf("android" to "true"))
}
kotlinGradle {
target("**/*.gradle.kts")
ktlint()
}
}
}
dependencies {
compile(project(":skaffold"))
compile(project(":skaffold-editing"))
compile(project(":common-test-lib"))
compile(files("lib/GoogleFeedback.jar"))
compile("com.google.protobuf:protobuf-java:2.5.0")
}
val intellijRepoChannel: String by project
val publishPlugin: PublishTask by tasks
publishPlugin {
username(System.getenv("IJ_REPO_USERNAME"))
password(System.getenv("IJ_REPO_PASSWORD"))
channels(intellijRepoChannel)
}
release {
tagTemplate = "v\${version}"
val git: GitAdapter.GitConfig = getProperty("git") as GitAdapter.GitConfig
git.requireBranch = "^release_v\\d+.*$"
}
inline operator fun <T : Task> T.invoke(a: T.() -> Unit): T = apply(a)