forked from aws/aws-toolkit-jetbrains
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
85 lines (73 loc) · 2.71 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
// Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
import org.jetbrains.gradle.ext.ProjectSettings
import org.jetbrains.gradle.ext.TaskTriggersConfig
import software.aws.toolkits.gradle.changelog.tasks.GenerateGithubChangeLog
plugins {
id("base")
id("toolkit-changelog")
id("toolkit-git-secrets")
id("toolkit-jacoco-report")
id("org.jetbrains.gradle.plugin.idea-ext")
}
allprojects {
repositories {
val codeArtifactUrl: Provider<String> = providers.environmentVariable("CODEARTIFACT_URL")
val codeArtifactToken: Provider<String> = providers.environmentVariable("CODEARTIFACT_AUTH_TOKEN")
if (codeArtifactUrl.isPresent && codeArtifactToken.isPresent) {
maven {
url = uri(codeArtifactUrl.get())
credentials {
username = "aws"
password = codeArtifactToken.get()
}
}
}
mavenCentral()
gradlePluginPortal()
}
configurations.all {
resolutionStrategy {
failOnDynamicVersions()
failOnChangingVersions()
}
}
}
val generateChangeLog = tasks.register<GenerateGithubChangeLog>("generateChangeLog") {
mustRunAfter(tasks.createRelease)
changeLogFile.set(project.file("CHANGELOG.md"))
}
tasks.createRelease.configure {
releaseVersion.set(providers.gradleProperty("toolkitVersion"))
}
dependencies {
aggregateCoverage(project(":plugin-toolkit:intellij"))
project.findProject(":plugin-toolkit:jetbrains-gateway")?.let {
aggregateCoverage(it)
}
aggregateCoverage(project(":ui-tests"))
}
tasks.register("runIde") {
doFirst {
throw GradleException("Use project specific runIde command, i.e. :plugin-toolkit:intellij:runIde")
}
}
if (idea.project != null) { // may be null during script compilation
idea {
project {
settings {
taskTriggers {
afterSync(":plugin-core:sdk-codegen:generateSdks")
afterSync(":plugin-core:jetbrains-community:generateTelemetry")
}
}
}
}
}
fun org.gradle.plugins.ide.idea.model.IdeaProject.settings(configuration: ProjectSettings.() -> Unit) = (this as ExtensionAware).configure(configuration)
fun ProjectSettings.taskTriggers(action: TaskTriggersConfig.() -> Unit, ) = (this as ExtensionAware).extensions.configure("taskTriggers", action)
// is there a better way to do this?
// coverageReport has implicit dependency on 'test' outputs since the task outputs the test.exec file
tasks.coverageReport {
mustRunAfter(rootProject.subprojects.map { it.tasks.withType<AbstractTestTask>() })
}